solving MDL-7496 for calculated

This commit is contained in:
pichetp
2007-10-31 02:31:33 +00:00
parent 597f50e616
commit 20bf2c1a3f
2 changed files with 7 additions and 1 deletions
@@ -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)){
+2 -1
View 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) {