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 13:44:15 +07:00
parent 5b7d9decd9
commit a187ada8cf
@@ -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]);
}