diff --git a/mod/quiz/editlib.php b/mod/quiz/editlib.php index 920d0993a35..608e38e1027 100644 --- a/mod/quiz/editlib.php +++ b/mod/quiz/editlib.php @@ -1106,6 +1106,10 @@ class quiz_question_bank_view extends question_bank_view { 'editaction', 'previewaction'); } + protected function default_sort() { + return array('qtype' => 1, 'questionnametext' => 1); + } + /** * Let the question bank display know whether the quiz has been attempted, * hence whether some bits of UI, like the add this question to the quiz icon, diff --git a/question/editlib.php b/question/editlib.php index cfff83f4547..0501a9aa231 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -965,7 +965,7 @@ class question_bank_view { } /** - * Deal with a sort name of the forum columnname, or colname_subsort by + * Deal with a sort name of the form columnname, or colname_subsort by * breaking it up, validating the bits that are presend, and returning them. * If there is no subsort, then $subsort is returned as ''. * @return array array($colname, $subsort). @@ -1102,7 +1102,7 @@ class question_bank_view { $sorts = array(); foreach ($this->sort as $sort => $order) { list($colname, $subsort) = $this->parse_subsort($sort); - $sorts[] = $this->knowncolumntypes[$colname]->sort_expression($order < 0, $subsort); + $sorts[] = $this->requiredcolumns[$colname]->sort_expression($order < 0, $subsort); } /// Build the where clause.