Skip to content

Commit

Permalink
MDL-47712 qtype_multianswer: Move mathjaxloader spans to outer question
Browse files Browse the repository at this point in the history
  • Loading branch information
dthies committed Mar 14, 2015
1 parent 06122e4 commit 530a2cb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions question/type/multianswer/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,21 @@ public function formulation_and_controls(question_attempt $qa,
$question = $qa->get_question();

$output = '';
$subquestions = array();
foreach ($question->textfragments as $i => $fragment) {
if ($i > 0) {
$index = $question->places[$i];
$output .= $this->subquestion($qa, $options, $index,
$token = 'qtypemultianswer' . $i . 'marker';
$token = '<span class="nolink">' + $token + '</span>';
$output .= $token;
$subquestions[$token] = $this->subquestion($qa, $options, $index,
$question->subquestions[$index]);
}
$output .= $question->format_text($fragment, $question->questiontextformat,
$qa, 'question', 'questiontext', $question->id);
$output .= $fragment;
}
$output = $question->format_text($output, $question->questiontextformat,
$qa, 'question', 'questiontext', $question->id);
$output = str_replace(array_keys($subquestions), array_values($subquestions), $output);

if ($qa->get_state() == question_state::$invalid) {
$output .= html_writer::nonempty_tag('div',
Expand Down

0 comments on commit 530a2cb

Please sign in to comment.