From: tjhunt Date: Mon, 11 Dec 2006 23:46:15 +0000 (+0000) Subject: MDL-7896 - error from random question type in adaptive mode. Merged from MOODLE_17_ST... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bb080d2046f42aa5770bd19bdb044cd09ade4633;p=moodle.git MDL-7896 - error from random question type in adaptive mode. Merged from MOODLE_17_STABLE. --- diff --git a/question/type/questiontype.php b/question/type/questiontype.php index 7e2dacd8f1..b36fd2272d 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -861,8 +861,10 @@ class default_questiontype { * that it is safe to use. * @param object $teststate The state whose responses are to be * compared. The state will be of the same age or - * older than $state. Again, the method should only - * use the field $teststate->responses. + * older than $state. If possible, the method should + * only use the field $teststate->responses, however + * any field that is set up by restore_session_and_responses + * can be used. */ function compare_responses(&$question, $state, $teststate) { // The default implementation performs a comparison of the response diff --git a/question/type/random/questiontype.php b/question/type/random/questiontype.php index e473696043..793716ccb2 100644 --- a/question/type/random/questiontype.php +++ b/question/type/random/questiontype.php @@ -237,7 +237,7 @@ class random_qtype extends default_questiontype { function compare_responses(&$question, $state, $teststate) { global $QTYPES; - $wrappedquestion = &$state->options->question; + $wrappedquestion = &$teststate->options->question; return $QTYPES[$wrappedquestion->qtype] ->compare_responses($wrappedquestion, $state, $teststate); }