From: Aleksander Ɓukasz Date: Thu, 14 Nov 2013 09:37:30 +0000 (+0100) Subject: All-or-nothing answer checking mode for questions of type "wybor" X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/394b340d9aa9fdd1259e39febe95a8201ebc1cbf?ds=sidebyside;hp=28e55ad9db74291ea3ca8380fb2bf96280336f55 All-or-nothing answer checking mode for questions of type "wybor" --- diff --git a/wtem/models.py b/wtem/models.py index 51515fe..27e1912 100644 --- a/wtem/models.py +++ b/wtem/models.py @@ -113,9 +113,12 @@ class Submission(models.Model): return 0 else: toret = 0 - for id in map(int, answer): - if id in exercise['answer']: - toret += exercise['points_per_hit'] + if exercise.get('answer_mode', None) == 'all_or_nothing': + toret = exercise['points'] if map(int, answer) == exercise['answer'] else 0 + else: + for id in map(int, answer): + if id in exercise['answer']: + toret += exercise['points_per_hit'] return toret if t == 'edumed_prawdafalsz': toret = 0