diff --git a/report/questioninstances/index.php b/report/questioninstances/index.php index 719b867b357..2d549d8482e 100644 --- a/report/questioninstances/index.php +++ b/report/questioninstances/index.php @@ -45,6 +45,9 @@ foreach ($qtypes as $qtype) { $qtypechoices[$qtype->name()] = $qtype->local_name(); } +// Sort by label. +core_collator::asort($qtypechoices); + // Print the settings form. echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter centerpara'); echo '
'; diff --git a/report/questioninstances/tests/behat/question_reports.feature b/report/questioninstances/tests/behat/question_reports.feature index 4c7e57e7724..5823b498986 100644 --- a/report/questioninstances/tests/behat/question_reports.feature +++ b/report/questioninstances/tests/behat/question_reports.feature @@ -35,6 +35,8 @@ Feature: A Teacher can generate question instance reports Scenario: Generate general and specific report Given I am on the "C1" "Course" page logged in as "admin" And I navigate to "Reports > Question instances" in site administration + # Checks the dropdown list is in alphabetical order + And "Matching" "option" should appear before "Select missing words" "option" in the "Question type" "select" When I press "Get the report" Then "Course: Course 1" row "Total" column of "generaltable" table should contain "2" And "Course: Course 1" row "Visible" column of "generaltable" table should contain "2"