MDL-85492 report_questioninstances: sort qtypes in alphabetical order

This commit is contained in:
Kristiina.Bax
2025-07-08 17:00:56 +01:00
parent a6b17d8f6b
commit ebfc7ac005
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -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 '<form method="get" action="." id="settingsform"><div>';
@@ -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 "Quiz: Test quiz Q001" row "Total" column of "generaltable" table should contain "2"
And "Quiz: Test quiz Q001" row "Visible" column of "generaltable" table should contain "2"