]> git.mjollnir.org Git - moodle.git/commitdiff
Merged fixes for display of correctanswers from stable
authormoodler <moodler>
Sat, 4 Sep 2004 08:12:23 +0000 (08:12 +0000)
committermoodler <moodler>
Sat, 4 Sep 2004 08:12:23 +0000 (08:12 +0000)
mod/quiz/questiontypes/match/questiontype.php
mod/quiz/questiontypes/multichoice/questiontype.php

index 419e61224172d96c67caaa43fbcadc2a957fad64..369f350963f9200731d5c223c26538ef4615bf58 100644 (file)
@@ -168,9 +168,10 @@ class quiz_match_qtype extends quiz_default_questiontype {
             $menuname = $nameprefix.$subquestion->id;
             $response = isset($question->response[$menuname])
                         ? $question->response[$menuname] : '0';
-            if (isset($correctanswers[$menuname])
-                    && $correctanswers[$menuname]->id
-                    == $response) {
+            if ($readonly 
+                and $quiz->correctanswers 
+                and isset($correctanswers[$menuname])
+                and ($correctanswers[$menuname]->id == $response)) {
                 $class = ' class="highlight" ';
             } else {
                 $class = '';
index 06c53cb2b6e963b43cc3369696dc39d1e284d48c..c1a8a14f871ff862fdcc2560b709c1034fa60ed7 100644 (file)
@@ -210,8 +210,7 @@ class quiz_multichoice_qtype extends quiz_default_questiontype {
             echo "<input $readonly $name $checked $type  value=\"$answer->id\" />";
            
             echo "</td>";
-            if ($readonly and $quiz->correctanswers || $quiz->feedback
-                    and !empty($correctanswers[$nameprefix.$aid])) {
+            if ($readonly and $quiz->correctanswers and !empty($correctanswers[$nameprefix.$aid])) {
                 echo '<td valign="top" class="highlight">'.format_text("$qnumchar. $answer->answer").'</td>';
             } else {
                 echo '<td valign="top">'.format_text("$qnumchar. $answer->answer").'</td>';