MDL-81383 questions: get_filtered_questions order should be predictable

This method supports $limit and $offset paramters. The query must have
a predictable ORDER BY for that to make sense.
This commit is contained in:
Tim Hunt
2024-04-11 10:27:41 +01:00
parent c9fe574fdd
commit 6edfe1b415
@@ -512,7 +512,8 @@ 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 {