From dc4bff71a21182799ff2556d8a92ec883a7e34db Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 9 Aug 2011 11:28:15 +0100 Subject: [PATCH] MDL-28653 question output. Add a class to the main div based on question 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. --- question/engine/renderer.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/question/engine/renderer.php b/question/engine/renderer.php index 910bda96585..9a0d08b90a0 100644 --- a/question/engine/renderer.php +++ b/question/engine/renderer.php @@ -62,8 +62,12 @@ class core_question_renderer extends plugin_renderer_base { $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',