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

Use default penalty in automatic test case generation, rather than fixing it.

parent 797954fb
No related branches found
No related tags found
No related merge requests found
......@@ -105,9 +105,15 @@ class qtype_stack_question_test_form extends moodleform {
foreach ($question->prts as $prtname => $prt) {
$result = $question->get_prt_result($prtname, $response, false);
$answernotes = $result->get_answernotes();
// In automatic test case generation set penalties as the default unless they differ.
// If they are the same as the detault, and you want this, you can change it later.
$prtpenalty = $result->get_penalty();
if ($prtpenalty == $question->penalty) {
$prtpenalty = '';
}
$mform->getElement($prtname . 'group')->setValue(array(
$prtname . 'score' => $result->get_score(),
$prtname . 'penalty' => $result->get_penalty(),
$prtname . 'penalty' => $prtpenalty,
$prtname . 'answernote' => end($answernotes)));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment