Skip to content

Commit

Permalink
Enabling $options->correct_responses for multianswer questions. I.e. …
Browse files Browse the repository at this point in the history
…highlighting of correct answers can now be turned off.
  • Loading branch information
mindforge committed Aug 15, 2005
1 parent d3a126d commit cf03711
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mod/quiz/questiontypes/multianswer/questiontype.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ function print_question_formulation_and_controls(&$question, &$state, $quiz,
}

/// Determine style
if (!empty($chosenanswer)) {
if (!empty($chosenanswer) && $options->correct_responses) {
if (!isset($chosenanswer->fraction)
|| $chosenanswer->fraction <= 0.0) {
// The response must have been totally wrong:
$style = ' style="background-color:red" ';
$style = 'style="background-color:red"';

} else if ($chosenanswer->fraction >= 1.0) {
// The response was correct!!
Expand All @@ -274,8 +274,9 @@ function print_question_formulation_and_controls(&$question, &$state, $quiz,
// This response did at least give some credit:
$style = 'style="background-color:yellow"';
}
} else {
$style = '';
}

}

// Print the input control
Expand Down

0 comments on commit cf03711

Please sign in to comment.