Fixed a NASTY little bug that sometimes occurred when

re-grading quizzes with random questions in them.

(everyone got set to zero)
This commit is contained in:
moodler 2003-09-22 16:03:30 +00:00
parent 543e1c58b5
commit 0a660b03e0

View File

@ -363,8 +363,16 @@ function quiz_get_attempt_responses($attempt) {
foreach ($responses as $key => $response) {
if ($response->qtype == RANDOM) {
$responses[$key]->random = $response->answer;
$responses[$key]->answer = explode(",",$responses[$response->answer]->answer);
$responses[$response->answer]->delete = true;
$realanswer = $responses[$response->answer]->answer;
if (is_array($realanswer)) {
$responses[$key]->answer = $realanswer;
} else {
$responses[$key]->answer = explode(",", $realanswer);
}
} else if ($response->qtype == NUMERICAL or $response->qtype == SHORTANSWER) {
$responses[$key]->answer = array($response->answer);
} else {