]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-7896 - error from random question type in adaptive mode. Merged from MOODLE_17_ST...
authortjhunt <tjhunt>
Mon, 11 Dec 2006 23:46:15 +0000 (23:46 +0000)
committertjhunt <tjhunt>
Mon, 11 Dec 2006 23:46:15 +0000 (23:46 +0000)
question/type/questiontype.php
question/type/random/questiontype.php

index 7e2dacd8f1ddf38db1548881355866fa49b3aada..b36fd2272ded69547af245bda1dd5518544989e1 100644 (file)
@@ -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
index e47369604318a2a4cae607fbb6801633199d011d..793716ccb2716220c8032c5dac82365b76c4e373 100644 (file)
@@ -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);
     }