Skip to content

Commit

Permalink
Merge pull request #571 from correctexam/563-migrate-to-the-last-angu…
Browse files Browse the repository at this point in the history
…lar-182-to-support-isolated-module

fix buf for input type number that increase automaticaly after one click
  • Loading branch information
barais authored Oct 25, 2024
2 parents 35f907d + b6e3009 commit 6450287
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/webapp/app/qcm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ function analyseStudentSheet(casesExamTemplate: any, templateimage: any, student

const score1 = scoreKmean(km, diffs);
const score2 = scoreKmean(kmAdaptative, diffsAdaptative);
console.error('score kmean', score1, score2);
// console.error('score kmean', score1, score2);
const maxScore = score1 > score2 ? score1 : score2;
for (const [k, case1] of casesExamTemplate.cases.entries()) {
const r = infos_cases.get(k);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ <h5 class="card-title">{{ comment.text }}</h5>
[step]="1"
[min]="1"
[max]="12"
[(ngModel)]="comment.step"
(change)="updateComment($event, comment, true, true)"
[ngModel]="comment.step"
(change)="updateCommentStep($event, comment, true, true)"
[pTooltip]="'scanexam.hybridcommentStepTooltip' | translate"
[tooltipPosition]="'left'"
/>
Expand Down Expand Up @@ -321,7 +321,7 @@ <h5 class="card-title" jhiTranslate="scanexam.newcomment">Nouveau commentaire</h
[min]="1"
[max]="12"
(change)="cancelEvent($event)"
[(ngModel)]="step"
[ngModel]="step"
[pTooltip]="'scanexam.hybridcommentStepTooltip' | translate"
[tooltipPosition]="'left'"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ export class CreateCommentsComponent implements OnInit {
});
}

updateCommentStep($event: any, l: IHybridGradedComment, graded: boolean, hybrid: boolean): any {
l.step = +$event.target.value;
this.updateComment($event, l, graded, hybrid);
}

updateComment($event: any, l: IGradedComment | ITextComment | IHybridGradedComment, graded: boolean, hybrid: boolean): any {
if (graded && !hybrid) {
if ((l as IGradedComment).grade === null) {
Expand Down Expand Up @@ -384,6 +389,7 @@ export class CreateCommentsComponent implements OnInit {
}

cancelEvent(event: any): void {
this.step = +event.target.value;
if (event?.preventDefault) {
event.preventDefault();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ export class QuestionpropertiesviewComponent implements OnInit, OnDestroy {
}

changeForceEdit(): void {
console.error(this.forceEdit);
if (this.forceEdit) {
this.disableGradeType = false;
this.disableNumero = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1241,8 +1241,8 @@ <h5 class="card-title">{{ comment.text }}</h5>
[step]="1"
[min]="1"
[max]="12"
[(ngModel)]="comment.step"
(change)="updateComment($event, comment, true, true)"
[ngModel]="comment.step"
(change)="updateCommentStep($event, comment, true, true)"
[pTooltip]="'scanexam.hybridcommentStepTooltip' | translate"
[tooltipPosition]="'left'"
/>
Expand Down Expand Up @@ -1444,7 +1444,7 @@ <h5 class="card-title" jhiTranslate="scanexam.newcomment">Nouveau commentaire</h
[min]="1"
[max]="12"
(change)="cancelEvent($event)"
[(ngModel)]="step"
[ngModel]="step"
[pTooltip]="'scanexam.hybridcommentStepTooltip' | translate"
[tooltipPosition]="'left'"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2152,6 +2152,10 @@ export class CorrigequestionComponent implements OnInit, AfterViewInit {
i.src = file;
});
}
updateCommentStep(event: any, l: IHybridGradedComment, graded: boolean, hybrid: boolean): any {
l.step = +event.target.value;
this.updateComment(event, l, graded, hybrid);
}

updateComment(event: any, l: IGradedComment | ITextComment | IHybridGradedComment, graded: boolean, hybrid: boolean): any {
if (event !== undefined && event.preventDefault) {
Expand Down Expand Up @@ -2811,7 +2815,8 @@ export class CorrigequestionComponent implements OnInit, AfterViewInit {
}
}

cancelEvent(event: Event) {
cancelEvent(event: any) {
this.step = +event.target.value;
event.preventDefault();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,6 @@ export class StatsExamComponent implements OnInit {
}

private radarStudent(etudiant: StudentRes): IRadarDataset {
console.error(this.questionNumeros, this.getNotes(etudiant));
const notes: number[] = [];
const notesetu = this.getNotes(etudiant);
this.questionNumeros.forEach(n => {
Expand Down

0 comments on commit 6450287

Please sign in to comment.