From: martin Date: Sun, 18 Aug 2002 09:47:59 +0000 (+0000) Subject: Sort names by firstname, and include even columns with no answers X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=66062dd31098630fe4bfcd04f96d326bc4b33730;p=moodle.git Sort names by firstname, and include even columns with no answers --- diff --git a/mod/choice/report.php b/mod/choice/report.php index 10c8b935b9..1b83bc68ee 100644 --- a/mod/choice/report.php +++ b/mod/choice/report.php @@ -35,7 +35,7 @@ id>$choice->name -> $strresponses", ""); - if (! $users = get_course_users($course->id)) { + if (! $users = get_course_users($course->id, "u.firstname ASC")) { error("No users found (very strange)"); } @@ -50,6 +50,10 @@ $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;