Skip to content

Commit

Permalink
fix: do not raise exception when clearing multianswer answers in mult…
Browse files Browse the repository at this point in the history
…iple tries mode

Businessmap: #taskid 47453
  • Loading branch information
Pol Torrent i Soler committed May 15, 2024
1 parent 82bc61b commit 735ea9c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions question.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ public function get_matching_answer(array $response) {
}

if ($this->parent) {
// Sometimes clearing existing answers call this method with the empty string when working with
// multiple tries. Do not throw exception in that case.
if ($answer == '') {
return null;
}

// Questions with parent should be graded together in multianswerwiris qtype!
throw new moodle_exception('Questions with parent should be graded together');
}
Expand Down

0 comments on commit 735ea9c

Please sign in to comment.