Skip to content

Commit

Permalink
solving MDL-7496 for calculated
Browse files Browse the repository at this point in the history
  • Loading branch information
pichetp committed Oct 31, 2007
1 parent 597f50e commit 20bf2c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions question/type/calculated/questiontype.php
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,11 @@ function construct_dataset_menus($form, $mandatorydatasets,
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)){
Expand Down
3 changes: 2 additions & 1 deletion question/type/shortanswer/questiontype.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,10 @@ function print_question_grading_details(&$question, &$state, $cmoptions, $option
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) {
Expand Down

0 comments on commit 20bf2c1

Please sign in to comment.