Skip to content

Commit

Permalink
Bug fix: use of a sandbox-language preprocessor (i.e. not Twig) was n…
Browse files Browse the repository at this point in the history
…ot respecting any specific sandbox parameters set within the question.
  • Loading branch information
trampgeek committed Nov 18, 2024
1 parent 81cbe94 commit 158d124
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion question.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,9 @@ private function evaluate_template_params_on_jobe($templateparams, $lang, $seed)
$value = preg_replace("/[^A-Za-z0-9]/", '', $this->student->$key);
$runargs[] = "$key=" . $value;
}
$sandboxparams = ["runargs" => $runargs, "cputime" => 10];
$sandboxparams = $this->get_sandbox_params();
$sandboxparams["runargs"] = $runargs;
$sandboxparams["cputime"] = $sandboxparams["cputime"] ?? 10; // Default to 10 secs execution time.
$sandbox = $this->get_sandbox();
$run = $sandbox->execute($templateparams, $lang, $input, $files, $sandboxparams);
if ($run->error === qtype_coderunner_sandbox::SERVER_OVERLOAD) {
Expand Down

0 comments on commit 158d124

Please sign in to comment.