Skip to content
Snippets Groups Projects
Commit 41eed821 authored by Chris Sangwin's avatar Chris Sangwin
Browse files

Partial fix for issue #132.

parent e3b3e723
No related branches found
No related tags found
No related merge requests found
......@@ -38,10 +38,6 @@ class qtype_stack_renderer extends qtype_renderer {
$response = $qa->get_last_qt_data();
$questiontext = $question->questiontextinstantiated;
$questiontext = $question->format_text(
stack_maths::process_display_castext($questiontext, $this),
$question->questiontextformat,
$qa, 'question', 'questiontext', $question->id);
// Replace inputs.
$inputstovaldiate = array();
......@@ -63,12 +59,6 @@ class qtype_stack_renderer extends qtype_renderer {
}
}
// Initialise automatic validation, if enabled.
if ($qaid && stack_utils::get_config()->ajaxvalidation) {
$this->page->requires->yui_module('moodle-qtype_stack-input',
'M.qtype_stack.init_inputs', array($inputstovaldiate, $qaid, $qa->get_field_prefix()));
}
// Replace PRTs.
foreach ($question->prts as $index => $prt) {
$feedback = '';
......@@ -86,6 +76,18 @@ class qtype_stack_renderer extends qtype_renderer {
$questiontext = str_replace("[[feedback:{$index}]]", $feedback, $questiontext);
}
// Now format the questiontext. This should be done after the subsitutions of inputs and PRTs.
$questiontext = $question->format_text(
stack_maths::process_display_castext($questiontext, $this),
$question->questiontextformat,
$qa, 'question', 'questiontext', $question->id);
// Initialise automatic validation, if enabled.
if ($qaid && stack_utils::get_config()->ajaxvalidation) {
$this->page->requires->yui_module('moodle-qtype_stack-input',
'M.qtype_stack.init_inputs', array($inputstovaldiate, $qaid, $qa->get_field_prefix()));
}
$result = '';
$result .= $this->question_tests_link($question, $options) . $questiontext;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment