MDL-55867 block_activity_results: Sort activities alphabetically.
authorStephen Bourget <steve.bourget@sau19.org>
Mon, 6 Feb 2017 01:54:01 +0000 (20:54 -0500)
committerStephen Bourget <steve.bourget@sau19.org>
Mon, 6 Feb 2017 01:54:01 +0000 (20:54 -0500)
blocks/activity_results/edit_form.php

index aa3f0b0..0342ee6 100644 (file)
@@ -52,6 +52,7 @@ class block_activity_results_edit_form extends block_edit_form {
         $sql = 'SELECT id, itemname FROM {grade_items} WHERE courseid = ? and itemtype = ? and (gradetype = ? or gradetype = ?)';
         $params = array($this->page->course->id, 'mod', GRADE_TYPE_VALUE, GRADE_TYPE_SCALE);
         $activities = $DB->get_records_sql_menu($sql, $params);
+        core_collator::asort($activities);
 
         if (empty($activities)) {
             $mform->addElement('static', 'noactivitieswarning', get_string('config_select_activity', 'block_activity_results'),