From fb9d2d7064add9e62f7b9d622c3242fc98f691c7 Mon Sep 17 00:00:00 2001 From: Christian Lawson-Perfect Date: Wed, 13 Mar 2024 09:57:11 +0000 Subject: [PATCH] gap-fill parts are invalid if any gap is invalid. Fixes #1093. The score from any answered gaps is still counted, but the part is marked as unanswered. If this breaks any existing questions which expect the student not to answer one or more gaps, they can be made to show "answered" by changing the marking algorithm for the unanswered gaps to not mark an empty answer as invalid. --- runtime/scripts/marking.js | 7 ++++--- runtime/scripts/part.js | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/runtime/scripts/marking.js b/runtime/scripts/marking.js index 867df8645..e1ae5b153 100644 --- a/runtime/scripts/marking.js +++ b/runtime/scripts/marking.js @@ -619,15 +619,16 @@ Numbas.queueScript('marking',['util', 'jme','localisation','jme-variables','math credit = credit.subtract(Fraction.fromFloat(state.credit)); break; case FeedbackOps.END: + out_states.push(state); + if(state.invalid) { + valid = false; + } if(num_lifts) { while(i+1