From c83345aa11460647badeed26e176a7d80d60297b Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Tue, 26 Jul 2022 16:50:44 +0100 Subject: [PATCH] MDL-75312 question: predictable ordering of available questions. This solves sporadic test failure that tried to assert their order. --- .../classes/local/bank/random_question_loader.php | 2 +- question/tests/externallib_test.php | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/question/classes/local/bank/random_question_loader.php b/question/classes/local/bank/random_question_loader.php index f26fa5d774b..5497b624133 100644 --- a/question/classes/local/bank/random_question_loader.php +++ b/question/classes/local/bank/random_question_loader.php @@ -303,7 +303,7 @@ class random_question_loader { FROM {question} q JOIN {question_versions} qv ON qv.questionid = q.id JOIN {question_bank_entries} qbe ON qbe.id = qv.questionbankentryid - {$condition}) q"; + {$condition}) q ORDER BY q.id"; return $DB->get_records_sql($sql, $param, $offset, $limit); } else { diff --git a/question/tests/externallib_test.php b/question/tests/externallib_test.php index 71a597e3091..f81f2d18504 100644 --- a/question/tests/externallib_test.php +++ b/question/tests/externallib_test.php @@ -14,16 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -/** - * Question external functions tests. - * - * @package core_question - * @category external - * @copyright 2016 Pau Ferrer - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @since Moodle 3.1 - */ - namespace core_question; use core_question_external; @@ -40,6 +30,7 @@ require_once($CFG->dirroot . '/question/engine/tests/helpers.php'); * Question external functions tests * * @package core_question + * @covers \core_question_external * @category external * @copyright 2016 Pau Ferrer * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later