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

Ensure a null seed is given a specific value.

parent 9d7e1110
Branches
No related tags found
No related merge requests found
...@@ -287,12 +287,10 @@ if (!(empty($question->deployedseeds)) && $canedit) { ...@@ -287,12 +287,10 @@ if (!(empty($question->deployedseeds)) && $canedit) {
echo html_writer::end_tag('form'); echo html_writer::end_tag('form');
} }
// Display the controls to add another question test. if ($seed === null) {
$s = $seed; $seed = 0;
if ($s === null) {
$s = 0;
} }
echo $OUTPUT->heading(stack_string('questiontestsfor', $s), 2); echo $OUTPUT->heading(stack_string('questiontestsfor', $seed), 2);
\core\session\manager::write_close(); \core\session\manager::write_close();
...@@ -303,9 +301,9 @@ foreach ($testscases as $key => $testcase) { ...@@ -303,9 +301,9 @@ foreach ($testscases as $key => $testcase) {
// Create a completely clean version of the question usage we will use. // Create a completely clean version of the question usage we will use.
// Evaluated state is stored in question variables etc. // Evaluated state is stored in question variables etc.
$question = question_bank::load_question($questionid); $question = question_bank::load_question($questionid);
$question->seed = $seed;
$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');
$question->seed = $seed;
$slot = $quba->add_question($question, $question->defaultmark); $slot = $quba->add_question($question, $question->defaultmark);
$quba->start_question($slot); $quba->start_question($slot);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment