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

WIP: question testing page does not display images in general feedback (?).

parent d89543d9
No related branches found
No related tags found
No related merge requests found
...@@ -86,6 +86,7 @@ $exportquestionlink->param('sesskey', sesskey()); ...@@ -86,6 +86,7 @@ $exportquestionlink->param('sesskey', sesskey());
// Create the question usage we will use. // Create the question usage we will use.
$quba = question_engine::make_questions_usage_by_activity('qtype_stack', $context); $quba = question_engine::make_questions_usage_by_activity('qtype_stack', $context);
$quba->set_preferred_behaviour('adaptive'); $quba->set_preferred_behaviour('adaptive');
if (!is_null($seed)) { if (!is_null($seed)) {
// This is a bit of a hack to force the question to use a particular seed, // This is a bit of a hack to force the question to use a particular seed,
// even if it is not one of the deployed seeds. // even if it is not one of the deployed seeds.
...@@ -107,15 +108,17 @@ $renderer = $PAGE->get_renderer('qtype_stack'); ...@@ -107,15 +108,17 @@ $renderer = $PAGE->get_renderer('qtype_stack');
echo $OUTPUT->heading($question->name, 2); echo $OUTPUT->heading($question->name, 2);
flush(); flush();
$question->castextprocessor = new castext2_qa_processor($quba->get_question_attempt($slot));
$generalfeedback = $question->get_generalfeedback_castext();
$rendergeneralfeedback = $renderer->general_feedback($quba->get_question_attempt($slot));
$generalfeedbackerr = $generalfeedback->get_errors();
// Store a rendered version of the blank question here. // Store a rendered version of the blank question here.
// Runtime errors generated by test cases might change rendering later. // Runtime errors generated by test cases might change rendering later.
$renderquestion = $quba->render_question($slot, $options); $renderquestion = $quba->render_question($slot, $options);
// Make sure the seed is available for later use. // Make sure the seed is available for later use.
$seed = $question->seed; $seed = $question->seed;
$questionvariablevalues = $question->get_question_session_keyval_representation(); $questionvariablevalues = $question->get_question_session_keyval_representation();
$generalfeedback = $question->get_generalfeedback_castext();
$generalfeedback->get_rendered();
$generalfeedbackerr = $generalfeedback->get_errors();
// Load the list of test cases. // Load the list of test cases.
$testscases = question_bank::get_qtype('stack')->load_question_tests($question->id); $testscases = question_bank::get_qtype('stack')->load_question_tests($question->id);
...@@ -535,8 +538,7 @@ echo html_writer::tag('p', stack_ouput_castext($question->get_question_summary() ...@@ -535,8 +538,7 @@ echo html_writer::tag('p', stack_ouput_castext($question->get_question_summary()
// Display the general feedback, aka "Worked solution". // Display the general feedback, aka "Worked solution".
echo $OUTPUT->heading(stack_string('generalfeedback'), 3); echo $OUTPUT->heading(stack_string('generalfeedback'), 3);
echo html_writer::tag('div', html_writer::tag('div', $renderer->general_feedback( echo html_writer::tag('div', html_writer::tag('div', $rendergeneralfeedback,
$quba->get_question_attempt($slot)),
array('class' => 'outcome generalfeedback')), array('class' => 'que')); array('class' => 'outcome generalfeedback')), array('class' => 'que'));
// Add a link to the cas chat to facilitate editing the general feedback. // Add a link to the cas chat to facilitate editing the general feedback.
......
...@@ -101,9 +101,6 @@ class stack_cas_castext2_special_rewrite_pluginfile_urls extends stack_cas_caste ...@@ -101,9 +101,6 @@ class stack_cas_castext2_special_rewrite_pluginfile_urls extends stack_cas_caste
// Then do the rewrite. Note we expect the processor used to have access to the relevant details. // Then do the rewrite. Note we expect the processor used to have access to the relevant details.
// You will need a parametric processor to do this. // You will need a parametric processor to do this.
if ($processor === null or !property_exists($processor, 'qa')) {
return $content;
}
$content = $processor->qa->rewrite_pluginfile_urls($content, $params[1], $params[2], $params[3]); $content = $processor->qa->rewrite_pluginfile_urls($content, $params[1], $params[2], $params[3]);
return $content; return $content;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment