]> git.mjollnir.org Git - moodle.git/commitdiff
solving MDL-7496 for calculated
authorpichetp <pichetp>
Wed, 31 Oct 2007 02:31:33 +0000 (02:31 +0000)
committerpichetp <pichetp>
Wed, 31 Oct 2007 02:31:33 +0000 (02:31 +0000)
question/type/calculated/questiontype.php
question/type/shortanswer/questiontype.php

index d9eb54f7731fcc344776f71e59c116cd5155ce23..0dd3dca01a0a2c28919a96dff781d1b09d5a7f60 100644 (file)
@@ -885,6 +885,11 @@ class question_calculated_qtype extends question_dataset_dependent_questiontype
         return $datasetmenus;
     }
 
+    function print_question_grading_details(&$question, &$state, &$cmoptions, &$options) {
+        $virtualqtype = $this->get_virtual_qtype();
+        $virtualqtype->print_question_grading_details($question, $state, $cmoptions, $options) ;
+    }
+
     function get_correct_responses(&$question, &$state) {
         $virtualqtype = $this->get_virtual_qtype();
         if($unit = $virtualqtype->get_default_numerical_unit($question)){
index 290afc9585a5b133f2947c9eb278a70d92b0accc..58e56208340006231dcd37bfe2b917182bef7635 100644 (file)
@@ -359,9 +359,10 @@ class question_shortanswer_qtype extends default_questiontype {
         attempt and displays the overall grade obtained counting all previous
         responses (and penalties) */
 
+        global $QTYPES ;
         // MDL-7496 show correct answer after "Incorrect"
         $correctanswer = '';
-        if ($correctanswers = $this->get_correct_responses($question, $state)) {
+        if ($correctanswers =  $QTYPES[$question->qtype]->get_correct_responses($question, $state)) {
             if ($options->readonly && $options->correct_responses) {
                 $delimiter = '';
                 if ($correctanswers) {