MDL-47494 ddimageortext: NOBUG if any choice is 'infinite' return null for random guess score

This commit is contained in:
Jamie Pratt
2011-11-23 12:50:29 +07:00
parent 615888af8e
commit 172d6dfd12
@@ -133,6 +133,11 @@ class qtype_ddtoimage_question_base extends qtype_gapselect_question_base {
$accum = 0;
foreach ($this->places as $place) {
foreach ($this->choices[$place->group] as $choice) {
if ($choice->infinite) {
return null;
}
}
$accum += 1 / count($this->choices[$place->group]);
}