@@ -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 );
0 commit comments