mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
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
This commit is contained in:
parent
8d6380f7cc
commit
089a284b88
@ -1421,7 +1421,7 @@ function quiz_print_cat_question_list($categoryid, $quizselected=true) {
|
||||
|
||||
echo '</center>';
|
||||
|
||||
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 "<p align=\"center\">";
|
||||
print_string("noquestions", "quiz");
|
||||
echo "</p>";
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user