Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes for some cases where shortanswer responses contain commas

  • Loading branch information...
commit b31538496576215f314f44c9d31634d20cfc813c 1 parent d678b11
moodler authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 mod/quiz/lib.php
View
5 mod/quiz/lib.php
@@ -556,10 +556,13 @@ function quiz_get_attempt_responses($attempt) {
$responses[$key]->random = $response->answer;
$responses[$response->answer]->delete = true;
- $realanswer = $responses[$response->answer]->answer;
+ $realresponse = $responses[$response->answer];
+ $realanswer = $realresponse->answer;
if (is_array($realanswer)) {
$responses[$key]->answer = $realanswer;
+ } else if ($realresponse->qtype == NUMERICAL or $realresponse->qtype == SHORTANSWER) {
+ $responses[$key]->answer = array("$realanswer");
} else {
$responses[$key]->answer = explode(",", $realanswer);
}
Please sign in to comment.
Something went wrong with that request. Please try again.