Skip to content

Commit

Permalink
Fix display of "correct answers" during quiz review (for students and…
Browse files Browse the repository at this point in the history
… teachers)
  • Loading branch information
moodler committed Sep 4, 2004
1 parent 91202da commit c62346d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions mod/quiz/questiontypes/match/questiontype.php
Expand Up @@ -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 = '';
Expand Down
3 changes: 1 addition & 2 deletions mod/quiz/questiontypes/multichoice/questiontype.php
Expand Up @@ -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>';
Expand Down

0 comments on commit c62346d

Please sign in to comment.