From 38c3492038a900f3d4b331275165965fafa59280 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 2 Jul 2013 08:21:42 +0100 Subject: [PATCH] MDL-40434 calculatedmulti multiple-response questions not randomised --- question/type/calculatedmulti/question.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/question/type/calculatedmulti/question.php b/question/type/calculatedmulti/question.php index a6ff02abcaf..f93b0f2f658 100644 --- a/question/type/calculatedmulti/question.php +++ b/question/type/calculatedmulti/question.php @@ -65,7 +65,6 @@ class qtype_calculatedmulti_single_question extends qtype_multichoice_single_que qtype_calculatedmulti_calculate_helper::calculate_all_expressions($this); } - public function get_num_variants() { return $this->datasetloader->get_number_of_items(); } @@ -115,6 +114,19 @@ class qtype_calculatedmulti_multi_question extends qtype_multichoice_multi_quest public function calculate_all_expressions() { qtype_calculatedmulti_calculate_helper::calculate_all_expressions($this); } + + public function get_num_variants() { + return $this->datasetloader->get_number_of_items(); + } + + public function get_variants_selection_seed() { + if (!empty($this->synchronised) && + $this->datasetloader->datasets_are_synchronised($this->category)) { + return 'category' . $this->category; + } else { + return parent::get_variants_selection_seed(); + } + } } -- 2.17.1