Skip to content

Commit

Permalink
MDL-35858 question: Fixed display of feedback in cloze questions
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Oct 9, 2012
1 parent ccd90e7 commit 588d1b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion question/type/multianswer/module.js
Expand Up @@ -27,7 +27,7 @@ M.qtype_multianswer = M.qtype_multianswer || {};


M.qtype_multianswer.init = function (Y, questiondiv) {
Y.one(questiondiv).all('label.subq').each(function(subqspan, i) {
Y.one(questiondiv).all('span.subquestion').each(function(subqspan, i) {
var feedbackspan = subqspan.one('.feedbackspan');
if (!feedbackspan) {
return;
Expand Down
6 changes: 4 additions & 2 deletions question/type/multianswer/renderer.php
Expand Up @@ -227,12 +227,13 @@ public function subquestion(question_attempt $qa, question_display_options $opti
$qa, 'question', 'answerfeedback', $matchinganswer->id),
s($correctanswer->answer), $options);

$output = '';
$output = html_writer::start_tag('span', array('class' => 'subquestion'));
$output .= html_writer::tag('label', get_string('answer'),
array('class' => 'subq accesshide', 'for' => $inputattributes['id']));
$output .= html_writer::empty_tag('input', $inputattributes);
$output .= $feedbackimg;
$output .= $feedbackpopup;
$output .= html_writer::end_tag('span');

return $output;
}
Expand Down Expand Up @@ -294,12 +295,13 @@ public function subquestion(question_attempt $qa, question_display_options $opti
$subq->format_text($rightanswer->answer, $rightanswer->answerformat,
$qa, 'question', 'answer', $rightanswer->id), $options);

$output = '';
$output = html_writer::start_tag('span', array('class' => 'subquestion'));
$output .= html_writer::tag('label', get_string('answer'),
array('class' => 'subq accesshide', 'for' => $inputattributes['id']));
$output .= $select;
$output .= $feedbackimg;
$output .= $feedbackpopup;
$output .= html_writer::end_tag('span');

return $output;
}
Expand Down

0 comments on commit 588d1b5

Please sign in to comment.