Skip to content

Commit

Permalink
Bug fix: bulk tester question preview didn't recognise 'answer_language'
Browse files Browse the repository at this point in the history
template parameter.
  • Loading branch information
trampgeek committed Nov 19, 2019
1 parent be41c06 commit 5218aca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion questiontestrun.php
Expand Up @@ -96,7 +96,12 @@

// Test the question with its sample answer.
$answer = $question->answer;
$quba->process_action($slot, array('-submit' => 'Submit', 'answer' => $answer));
$run_params = array('-submit' => 'Submit', 'answer' => $answer);
$templateparams = isset($question->templateparams) ? json_decode($question->templateparams, true) : array();
if (isset($templateparams['answer_language'])) {
$run_params['language'] = $templateparams['answer_language'];
}
$quba->process_action($slot, $run_params);

// Start output.
echo $OUTPUT->header();
Expand Down

0 comments on commit 5218aca

Please sign in to comment.