From: pichetp Date: Wed, 31 Oct 2007 02:31:33 +0000 (+0000) Subject: solving MDL-7496 for calculated X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=20bf2c1a3fa543456032e3b3055f5b46c8a04265;p=moodle.git solving MDL-7496 for calculated --- diff --git a/question/type/calculated/questiontype.php b/question/type/calculated/questiontype.php index d9eb54f773..0dd3dca01a 100644 --- a/question/type/calculated/questiontype.php +++ b/question/type/calculated/questiontype.php @@ -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)){ diff --git a/question/type/shortanswer/questiontype.php b/question/type/shortanswer/questiontype.php index 290afc9585..58e5620834 100644 --- a/question/type/shortanswer/questiontype.php +++ b/question/type/shortanswer/questiontype.php @@ -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) {