diff --git a/src/main/java/de/thm/arsnova/domain/QuestionBasedLearningProgress.java b/src/main/java/de/thm/arsnova/domain/QuestionBasedLearningProgress.java index 81dab008513ff83a801aa6302af988400d6eacd9..d1ea2d45103cf5e3eee2e8ea8e82368a37ab8f3c 100644 --- a/src/main/java/de/thm/arsnova/domain/QuestionBasedLearningProgress.java +++ b/src/main/java/de/thm/arsnova/domain/QuestionBasedLearningProgress.java @@ -50,6 +50,9 @@ public class QuestionBasedLearningProgress implements LearningProgress { int numQuestionsCorrect = 0; for (QuestionScore questionScore : courseScore) { int requiredScore = questionScore.getMaximum(); + if (!questionScore.hasScores()) { + continue; + } boolean allCorrect = true; for (UserScore userScore : questionScore) { if (!userScore.hasScore(requiredScore)) { diff --git a/src/main/java/de/thm/arsnova/domain/QuestionScore.java b/src/main/java/de/thm/arsnova/domain/QuestionScore.java index 4584d509b00e7df5c02756f37e944404891d7f22..457c84edd876201fd9834efe90f1bc2d411fbbb5 100644 --- a/src/main/java/de/thm/arsnova/domain/QuestionScore.java +++ b/src/main/java/de/thm/arsnova/domain/QuestionScore.java @@ -46,6 +46,10 @@ public class QuestionScore implements Iterable<UserScore> { return this.userScores.iterator(); } + public boolean hasScores() { + return this.userScores.size() > 0; + } + public void add(String username, int userscore) { userScores.add(new UserScore(username, userscore)); }