Skip to content

Commit 7a72533

Browse files
committed
The mark_part JME function copes with pre-submit
Gap-fills run `mark_part` on all of their parts. We can't know if they're going to have pre-submit tasks until after trying to mark them. This changes the `mark_part` function to return an empty result if the part is waiting for pre-submit tasks. The gap-fill's own pre-submit note then waits for all the gaps' pre-submit tasks to finish before trying to mark again.
1 parent 34cae74 commit 7a72533

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

runtime/scripts/marking.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,17 @@ Numbas.queueScript('marking',['util', 'jme','localisation','jme-variables','math
408408
} else {
409409
var part_result = part.mark_answer(answer, part.getScope());
410410
}
411+
if(part_result.waiting_for_pre_submit) {
412+
return jme.wrapValue({
413+
marks: part.availableMarks(),
414+
credit: 0,
415+
feedback: [],
416+
valid: false,
417+
states: {},
418+
state_valid: {},
419+
values: {}
420+
});
421+
}
411422
var result = marking.finalise_state(part_result.states.mark);
412423
return jme.wrapValue({
413424
marks: part.availableMarks(),

0 commit comments

Comments
 (0)