Skip to content

Commit

Permalink
Merge pull request #132 from correctexam/develop
Browse files Browse the repository at this point in the history
correct npe
  • Loading branch information
barais authored Mar 14, 2024
2 parents fbe1a78 + 8783423 commit e8cc596
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/fr/istic/web/rest/ExtendedAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public Exam computeFinalNote(long examId, Map<Long, FinalResult> 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")) {
Expand Down Expand Up @@ -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<Integer> uncorrected = new ArrayList<>();
List<Integer> pageminsCorrected = responsesForQ.stream().map(e-> e.sheet.pagemin).collect(Collectors.toList());
for (int i=0;i<sheets.size();i++){
Expand Down

0 comments on commit e8cc596

Please sign in to comment.