From: tjhunt Date: Tue, 6 Jun 2006 14:29:05 +0000 (+0000) Subject: Bug #5506: Fix for calculated questions where each one builds on the last. Merged... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7d83bbc2bd3a20b90e2d310a0445e6526427d00c;p=moodle.git Bug #5506: Fix for calculated questions where each one builds on the last. Merged from MOODLE_16_STABLE. --- diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index bb72cdc8a7..e3a1ffc630 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -323,6 +323,13 @@ // Process these responses ... question_process_responses($questions[$i], $states[$i], $action, $quiz, $attempt); + + // Fix for Bug #5506: When each attempt is built on the last one, + // preserve the options from any previous attempt. + if ( isset($laststate->options) ) { + $states[$i]->options = $laststate->options; + } + // ... and save the new states save_question_session($questions[$i], $states[$i]); }