From 4b3f09c081dd1f5d493a12a429598a9f4a253896 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Sat, 6 Feb 2016 14:17:13 +0000 Subject: [PATCH] MDL-52814 questions: Show extra info in the outcomes area not info Currently the only use is the quiz Redo question button, and that would be much better placed in the feedback area, not least for langages where the button label needs to be longer. --- question/engine/lib.php | 8 +++++--- question/engine/renderer.php | 3 ++- question/engine/upgrade.txt | 7 +++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/question/engine/lib.php b/question/engine/lib.php index 1e9305dfd04..2d5fa317bd7 100644 --- a/question/engine/lib.php +++ b/question/engine/lib.php @@ -595,9 +595,11 @@ class question_display_options { /** * @since 2.9 - * @var string extra HTML to include in the info box of the question display. - * This is normally shown after the information about the question, and before - * any controls like the flag or the edit icon. + * @var string extra HTML to include at the end of the outcome (feedback) box + * of the question display. + * + * This field is now badly named. The place it included is was changed + * (for the better) but the name was left unchanged for backwards compatibility. */ public $extrainfocontent = ''; diff --git a/question/engine/renderer.php b/question/engine/renderer.php index 87162d6b18f..a70ea04c863 100644 --- a/question/engine/renderer.php +++ b/question/engine/renderer.php @@ -144,7 +144,6 @@ class core_question_renderer extends plugin_renderer_base { $output .= $this->number($number); $output .= $this->status($qa, $behaviouroutput, $options); $output .= $this->mark_summary($qa, $behaviouroutput, $options); - $output .= $options->extrainfocontent; $output .= $this->question_flag($qa, $options->flags); $output .= $this->edit_question_link($qa, $options); return $output; @@ -412,6 +411,8 @@ class core_question_renderer extends plugin_renderer_base { $qtoutput->feedback($qa, $options), array('class' => 'feedback')); $output .= html_writer::nonempty_tag('div', $behaviouroutput->feedback($qa, $options), array('class' => 'im-feedback')); + $output .= html_writer::nonempty_tag('div', + $options->extrainfocontent, array('class' => 'extra-feedback')); return $output; } diff --git a/question/engine/upgrade.txt b/question/engine/upgrade.txt index 09c9d790000..65378001928 100644 --- a/question/engine/upgrade.txt +++ b/question/engine/upgrade.txt @@ -1,5 +1,12 @@ This files describes API changes for the core question engine. +=== 3.1, 3.0.3, 2.9.5 === + +1) The field question_display_options::$extrainfocontent is now displayed in the + outcomes (yellow) div by default. It used to be in the info div. If you have + overriden the question renderer, you may need to make a corresponding change. + + === 3.0, 2.9.2, 2.8.8 === 1) The extra internal PARAM constant question_attempt::PARAM_MARK should no