From a187ada8cf0a434cc6da449f69d767f87a1bb67f Mon Sep 17 00:00:00 2001 From: Jamie Pratt Date: Wed, 23 Nov 2011 12:50:29 +0700 Subject: [PATCH] MDL-47494 ddimageortext: NOBUG if any choice is 'infinite' return null for random guess score --- question/type/ddimageortext/questionbase.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/question/type/ddimageortext/questionbase.php b/question/type/ddimageortext/questionbase.php index 3f594355ba7..4ad33327f25 100644 --- a/question/type/ddimageortext/questionbase.php +++ b/question/type/ddimageortext/questionbase.php @@ -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]); }