Permalink
Browse files

Enabling $options->correct_responses for multianswer questions. I.e. …

…highlighting of correct answers can now be turned off.
  • Loading branch information...
1 parent d3a126d commit cf0371143cbc9685e67d0d1d28fff60cf65dbdac mindforge committed Aug 15, 2005
Showing with 4 additions and 3 deletions.
  1. +4 −3 mod/quiz/questiontypes/multianswer/questiontype.php
@@ -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!!
@@ -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

0 comments on commit cf03711

Please sign in to comment.