Skip to content

Commit 8c66c14

Browse files
committed
update nbgraber
1 parent a301ae0 commit 8c66c14

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/main/java/fr/istic/service/ExamService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ public void createNoteBookExamStructure(List<AnswersNoteBook> answersNoteBook, U
452452
e.questions.add(q);
453453
Question.persistOrUpdate(q);
454454

455-
questionCaches.put(qIndex, q);
455+
questionCaches.put(qnb.getNumero(), q);
456456

457457
// Hybride comment à créer
458458
HybridGradedComment hybridGradedComment = new HybridGradedComment();
@@ -464,6 +464,7 @@ public void createNoteBookExamStructure(List<AnswersNoteBook> answersNoteBook, U
464464
// Compute minimum step
465465
Integer maxStep = 1;
466466
for(AnswersNoteBook answerNoteBook : answersNoteBook){
467+
if (qIndex < answerNoteBook.getQuestions().size()){
467468
QuestionNoteBook q1= answerNoteBook.getQuestions().get(qIndex);
468469
if (q1.getNotemax() >0.0 && q1.getNote() >0.0){
469470
Integer step = decimalToFractionDenominateur(q1.getNote()/q1.getNotemax());
@@ -472,6 +473,7 @@ public void createNoteBookExamStructure(List<AnswersNoteBook> answersNoteBook, U
472473
}
473474
}
474475
}
476+
}
475477

476478
hybridGradedComment.step = maxStep;
477479
hybridGradedComment.grade = 400;
@@ -500,7 +502,7 @@ public void createNoteBookExamStructure(List<AnswersNoteBook> answersNoteBook, U
500502
sr.sheet = es;
501503
sr.lastModifiedDate =Instant.now();
502504
sr.correctedBy = u;
503-
sr.question = questionCaches.get(qIndex);
505+
sr.question = questionCaches.get(qnb.getNumero());
504506
sr.worststar = false;
505507
sr.star = false;
506508
StudentResponse.persistOrUpdate(sr);

src/main/java/fr/istic/service/customdto/answernotebooks/QuestionNoteBook.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
@RegisterForReflection
66
public class QuestionNoteBook {
7-
private Long numero;
7+
private Integer numero;
88
private Double note;
99
private Double notemax;
1010

11-
public Long getNumero() { return numero; }
12-
public void setNumero(Long value) { this.numero = value; }
11+
public Integer getNumero() { return numero; }
12+
public void setNumero(Integer value) { this.numero = value; }
1313

1414
public Double getNote() { return note; }
1515
public void setNote(Double value) { this.note = value; }

0 commit comments

Comments
 (0)