Permalink
Browse files

Fix display of "correct answers" during quiz review (for students and…

… teachers)
  • Loading branch information...
1 parent 91202da commit c62346d19060af32cc6b8a2918d0e3e2442c97a0 moodler committed Sep 4, 2004
@@ -168,9 +168,10 @@ function print_question_formulation_and_controls($question,
$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 = '';
@@ -210,8 +210,7 @@ function print_question_formulation_and_controls($question,
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>';

0 comments on commit c62346d

Please sign in to comment.