MDL-14352 - General feedback for descriptions not showing up on the review page, as it should.
This commit is contained in:
@@ -12,3 +12,6 @@
|
||||
|
||||
<p>It can be used to print a descriptive text to be used by a following group of questions.</p>
|
||||
|
||||
<p>The General feedback can be used if you have some text that you want to appear on the review
|
||||
page only. The 'Question text' appears both during the attempt and on the review page.</p>
|
||||
|
||||
@@ -11,4 +11,9 @@
|
||||
<img class="qimage" src="<?php echo $image; ?>" alt="" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if ($generalfeedback) { ?>
|
||||
<div class="generalfeedback">
|
||||
<?php echo $generalfeedback ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -40,6 +40,7 @@ class description_qtype extends default_questiontype {
|
||||
|
||||
function print_question(&$question, &$state, $number, $cmoptions, $options) {
|
||||
global $CFG;
|
||||
$isfinished = question_state_is_graded($state->last_graded) || $state->event == QUESTION_EVENTCLOSE;
|
||||
|
||||
// For editing teachers print a link to an editing popup window
|
||||
$editlink = '';
|
||||
@@ -52,6 +53,12 @@ class description_qtype extends default_questiontype {
|
||||
$questiontext = $this->format_text($question->questiontext, $question->questiontextformat, $cmoptions);
|
||||
$image = get_question_image($question, $cmoptions->course);
|
||||
|
||||
$generalfeedback = '';
|
||||
if ($isfinished && $options->generalfeedback) {
|
||||
$generalfeedback = $this->format_text($question->generalfeedback,
|
||||
$question->questiontextformat, $cmoptions);
|
||||
}
|
||||
|
||||
include "$CFG->dirroot/question/type/description/question.html";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user