From: moodler Date: Sat, 4 Sep 2004 08:12:23 +0000 (+0000) Subject: Merged fixes for display of correctanswers from stable X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=20229ca24662cf5bc49bddf75adc531cf1be26cb;p=moodle.git Merged fixes for display of correctanswers from stable --- diff --git a/mod/quiz/questiontypes/match/questiontype.php b/mod/quiz/questiontypes/match/questiontype.php index 419e612241..369f350963 100644 --- a/mod/quiz/questiontypes/match/questiontype.php +++ b/mod/quiz/questiontypes/match/questiontype.php @@ -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 = ''; diff --git a/mod/quiz/questiontypes/multichoice/questiontype.php b/mod/quiz/questiontypes/multichoice/questiontype.php index 06c53cb2b6..c1a8a14f87 100644 --- a/mod/quiz/questiontypes/multichoice/questiontype.php +++ b/mod/quiz/questiontypes/multichoice/questiontype.php @@ -210,8 +210,7 @@ class quiz_multichoice_qtype extends quiz_default_questiontype { echo "id\" />"; echo ""; - if ($readonly and $quiz->correctanswers || $quiz->feedback - and !empty($correctanswers[$nameprefix.$aid])) { + if ($readonly and $quiz->correctanswers and !empty($correctanswers[$nameprefix.$aid])) { echo ''.format_text("$qnumchar. $answer->answer").''; } else { echo ''.format_text("$qnumchar. $answer->answer").'';