]> git.mjollnir.org Git - moodle.git/commitdiff
Sort names by firstname, and include even columns with no answers
authormartin <martin>
Sun, 18 Aug 2002 09:47:59 +0000 (09:47 +0000)
committermartin <martin>
Sun, 18 Aug 2002 09:47:59 +0000 (09:47 +0000)
mod/choice/report.php

index 10c8b935b9c8756ea65fd522f1bfc709b6fbbdf4..1b83bc68ee2360e27becefc36e0c5645d4b24611 100644 (file)
@@ -35,7 +35,7 @@
                   <A HREF=view.php?id=$cm->id>$choice->name</A> -> $strresponses", "");
 
 
-    if (! $users = get_course_users($course->id)) {
+    if (! $users = get_course_users($course->id, "u.firstname ASC")) {
         error("No users found (very strange)");
     }
 
 
     $timenow = time();
 
+    for ($i=0; $i<=2; $i++) {    // number of choices (presently hardcoded)
+        $useranswer[$i] = array();
+    }
+
     foreach ($users as $user) {
         $answer = $answers[$user->id];
         $useranswer[(int)$answer->answer][] = $user;