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

WIP fix to issue #1053: strings being used to define PRT scores.

parent dd0136f4
Branches
No related tags found
No related merge requests found
......@@ -1085,6 +1085,8 @@ class qtype_stack extends question_type {
foreach ($q->prts as $index => $prt) {
foreach ($prt->get_nodes_summary() as $nodeid => $choices) {
// STACK allows variables in scores, which may not be evaluated.
if (is_numeric($choices->falsescore) && is_numeric($choices->truescore)) {
$parts[$index . '-' . $nodeid] = array(
$choices->falseanswernote => new question_possible_response(
$choices->falseanswernote, $choices->falsescore * $prt->get_value()),
......@@ -1094,6 +1096,7 @@ class qtype_stack extends question_type {
);
}
}
}
return $parts;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment