]> git.mjollnir.org Git - moodle.git/commitdiff
Some fixes for display of survey reports
authormoodler <moodler>
Sat, 13 Mar 2004 13:33:20 +0000 (13:33 +0000)
committermoodler <moodler>
Sat, 13 Mar 2004 13:33:20 +0000 (13:33 +0000)
mod/survey/lib.php
mod/survey/report.php

index 5f35efee798e94ff974ed35daa74e1d3dbf11a02..64ad234cd6d8e55fff1949e23a73f34f048d0836 100644 (file)
@@ -195,7 +195,6 @@ function survey_get_responses($surveyid, $groupid) {
     }
 
     return get_records_sql("SELECT MAX(a.time) as time, 
-                                   count(*) as numanswers, 
                                    u.id, u.firstname, u.lastname, u.picture
                               FROM {$CFG->prefix}survey_answers AS a, 
                                    {$CFG->prefix}user AS u,
@@ -282,14 +281,14 @@ function survey_count_responses($surveyid, $groupid) {
 function survey_print_all_responses($cmid, $results, $courseid) {
     global $THEME;
 
-    $table->head  = array ("", get_string("name"),  get_string("time"), get_string("answers", "survey"));
-    $table->align = array ("", "left", "left", "right");
-    $table->size = array (35, "", "", "");
+    $table->head  = array ("", get_string("name"),  get_string("time"));
+    $table->align = array ("", "left", "left");
+    $table->size = array (35, "", "" );
 
     foreach ($results as $a) {
         $table->data[] = array(print_user_picture($a->id, $courseid, $a->picture, false, true, false),
                "<a href=\"report.php?action=student&student=$a->id&id=$cmid\">".fullname($a)."</a>", 
-               userdate($a->time), $a->numanswers);
+               userdate($a->time));
     }
 
     print_table($table);
index 4da44c863bc9697448bc63a3c7d9a8b482af0708..0420f6e23d8c7bf05d27b98e15f1a818129a88c9 100644 (file)
@@ -65,8 +65,9 @@
 
 /// Check to see if groups are being used in this survey
     if ($groupmode = groupmode($course, $cm)) {   // Groups are being used
+        $menuaction = $action == "student" ? "students" : $action;
         $currentgroup = setup_and_print_groups($course, $groupmode, 
-                                       "report.php?id=$cm->id&action=$action&qid=$qid");
+                                       "report.php?id=$cm->id&action=$menuaction&qid=$qid");
     } else {
         $currentgroup = 0;
     }