diff --git a/src/main/java/fr/istic/web/rest/ExtendedAPI.java b/src/main/java/fr/istic/web/rest/ExtendedAPI.java index ae331ce..666d56d 100644 --- a/src/main/java/fr/istic/web/rest/ExtendedAPI.java +++ b/src/main/java/fr/istic/web/rest/ExtendedAPI.java @@ -486,7 +486,7 @@ public Exam computeFinalNote(long examId, Map finalfinalResul // resp.persistOrUpdate(); finalnote = finalnote + (resp.quarternote / 4); - } else if ("QCM".equals(resp.question.type.algoName) && resp.question.step > 0) { + } else if ("QCM".equals(resp.question.type.algoName) && resp.question.step !=null && resp.question.step > 0) { int currentNote = 0; for (var g : resp.gradedcomments) { if (g.description.startsWith("correct")) { @@ -2014,7 +2014,11 @@ public int compare(ExamSheet arg0, ExamSheet arg1) { // Getting the ID of the sheets that have an answer for this question responsesForQ.sort(new ComparatorImplementation()); QuestionStateDTO qs = q.get(quest.numero.longValue()); - qs.setRandomHorizontalCorrection(quest.randomHorizontalCorrection); + if (quest.randomHorizontalCorrection != null){ + qs.setRandomHorizontalCorrection(quest.randomHorizontalCorrection); + } else { + qs.setRandomHorizontalCorrection(false); + } List uncorrected = new ArrayList<>(); List pageminsCorrected = responsesForQ.stream().map(e-> e.sheet.pagemin).collect(Collectors.toList()); for (int i=0;i