Permalink
Browse files

MDL-28653 question output. Add a class to the main div based on quest…

…ion state.

This makes it possible themes do cool things. For example change more of the display depending on whether the answer was correct or not.
  • Loading branch information...
1 parent 80eb52c commit dc4bff71a21182799ff2556d8a92ec883a7e34db @timhunt timhunt committed Aug 9, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 question/engine/renderer.php
@@ -62,8 +62,12 @@ public function question(question_attempt $qa, qbehaviour_renderer $behaviourout
$output = '';
$output .= html_writer::start_tag('div', array(
'id' => 'q' . $qa->get_slot(),
- 'class' => 'que ' . $qa->get_question()->qtype->name() . ' ' .
- $qa->get_behaviour_name(),
+ 'class' => implode(' ', array(
+ 'que',
+ $qa->get_question()->qtype->name(),
+ $qa->get_behaviour_name(),
+ $qa->get_state_class($options->correctness && $qa->has_marks()),
+ ))
));
$output .= html_writer::tag('div',

0 comments on commit dc4bff7

Please sign in to comment.