From 089a284b885d4390dbc85751cad2ee2c74e866be Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Wed, 29 Dec 2004 07:19:54 +0000 Subject: [PATCH] sort category question list by type then name as suggested in http://moodle.org/bugs/bug.php?op=show&bugid=2045 Also removed a PHP notice --- mod/quiz/lib.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index 929b4db032..b8cbd867af 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -1421,7 +1421,7 @@ function quiz_print_cat_question_list($categoryid, $quizselected=true) { echo ''; - if (!$questions = get_records("quiz_questions", "category", $category->id, "qtype ASC")) { + if (!$questions = get_records("quiz_questions", "category", $category->id, "qtype ASC, name ASC")) { echo "

"; print_string("noquestions", "quiz"); echo "

"; @@ -1925,12 +1925,13 @@ function get_questions_category( $category ) { $qresults = array(); // get the list of questions for the category - $questions = get_records("quiz_questions","category",$category->id); + if ($questions = get_records("quiz_questions","category",$category->id)) { - // iterate through questions, getting stuff we need - foreach($questions as $question) { - $new_question = get_question_data( $question ); - $qresults[] = $new_question; + // iterate through questions, getting stuff we need + foreach($questions as $question) { + $new_question = get_question_data( $question ); + $qresults[] = $new_question; + } } return $qresults; -- 2.39.5