Skip to content

Commit

Permalink
gap-fill parts are invalid if any gap is invalid.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
christianp committed Mar 13, 2024
1 parent 2eff9a0 commit fb9d2d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions runtime/scripts/marking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<states.length && states[i+1].op!="end_lift") {
i += 1;
}
} else {
end = true;
if(state.invalid) {
valid = false;
}
}
break;
case FeedbackOps.CONCAT:
Expand Down
6 changes: 3 additions & 3 deletions runtime/scripts/part.js
Original file line number Diff line number Diff line change
Expand Up @@ -1705,15 +1705,15 @@ if(res) { \
part.markingComment(state.message,state.reason, state.format);
break;
case FeedbackOps.END:
if(state.invalid) {
valid = false;
}
if(lifts.length) {
while(i+1<states.length && states[i+1].op!="end_lift") {
i += 1;
}
} else {
end = true;
if(state.invalid) {
valid = false;
}
}
break;
case "start_lift":
Expand Down

0 comments on commit fb9d2d7

Please sign in to comment.