MDL-28982 fix DML use
authorPetr Skoda <commits@skodak.org>
Sun, 21 Aug 2011 13:38:46 +0000 (15:38 +0200)
committerPetr Skoda <commits@skodak.org>
Sun, 21 Aug 2011 13:38:46 +0000 (15:38 +0200)
mod/quiz/report/grading/report.php

index 44c420f..81628dd 100644 (file)
@@ -520,7 +520,7 @@ class quiz_grading_report extends quiz_default_report {
      */
     protected function get_usage_ids_where_question_in_state($summarystate, $slot,
             $questionid = null, $orderby = 'random', $page = 0, $pagesize = null) {
-        global $CFG;
+        global $CFG, $DB;
         $dm = new question_engine_data_mapper();
 
         if ($pagesize && $orderby != 'random') {
@@ -544,7 +544,7 @@ class quiz_grading_report extends quiz_default_report {
         } else if ($orderby == 'student' || $orderby == 'idnumber') {
             $qubaids->from .= " JOIN {user} u ON quiza.userid = u.id ";
             if ($orderby == 'student') {
-                $orderby = sql_fullname('u.firstname', 'u.lastname');
+                $orderby = $DB->sql_fullname('u.firstname', 'u.lastname');
             }
         }