Skip to content

Commit

Permalink
MDL-52814 questions: Show extra info in the outcomes area not info
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
timhunt committed Feb 10, 2016
1 parent 80b0902 commit 8d07129
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 5 additions & 3 deletions question/engine/lib.php
Expand Up @@ -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 = '';

Expand Down
3 changes: 2 additions & 1 deletion question/engine/renderer.php
Expand Up @@ -144,7 +144,6 @@ protected function info(question_attempt $qa, qbehaviour_renderer $behaviouroutp
$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;
Expand Down Expand Up @@ -412,6 +411,8 @@ protected function outcome(question_attempt $qa, qbehaviour_renderer $behaviouro
$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;
}

Expand Down
7 changes: 7 additions & 0 deletions 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
Expand Down

0 comments on commit 8d07129

Please sign in to comment.