From 5d66ef5bf705589b15c248f47979781208838e55 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Mon, 23 Oct 2023 14:41:37 +0100 Subject: [PATCH] apply per question exemptions when generating answer data --- crowdsourcer/scoring.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crowdsourcer/scoring.py b/crowdsourcer/scoring.py index 7a91c1ee..694778d1 100644 --- a/crowdsourcer/scoring.py +++ b/crowdsourcer/scoring.py @@ -616,6 +616,17 @@ def get_response_data( else: score = "-" + section = response.question.section + q = response.question.number_and_part + if ( + SCORE_EXCEPTIONS.get(section.title, None) is not None + and SCORE_EXCEPTIONS[section.title].get(q, None) is not None + ): + if score >= SCORE_EXCEPTIONS[section.title][q]["points_for_max"]: + score = SCORE_EXCEPTIONS[section.title][q]["max_score"] + else: + score = 0 + if response.question.question_type == "negative": score = response.points