]> git.mjollnir.org Git - moodle.git/commitdiff
Added dividers
authormoodler <moodler>
Mon, 26 Jan 2004 12:29:02 +0000 (12:29 +0000)
committermoodler <moodler>
Mon, 26 Jan 2004 12:29:02 +0000 (12:29 +0000)
mod/survey/index.php

index 41249f766281dd6a6fa360e984348b985a64f23d..7f56297b2d5750bb933551b209ce30d0a017c2bc 100644 (file)
         $table->align = array ("LEFT", "LEFT");
     }
 
+    $currentsection = '';
+
     foreach ($surveys as $survey) {
         if (survey_already_done($survey->id, $USER->id)) {
             $ss = $strdone;
         } else {
             $ss = $strnotdone;
         }
-        if ($survey->section) {
-            $section = "$survey->section";
-        } else {
-            $section = "";
+        $printsection = "";
+        if ($survey->section !== $currentsection) {
+            if ($survey->section) {
+                $printsection = $survey->section;
+            }
+            if ($currentsection !== "") {
+                $table->data[] = 'hr';
+            }
+            $currentsection = $survey->section;
         }
         //Calculate the href
         if (!$survey->visible) {
@@ -64,7 +71,7 @@
         }
 
         if ($course->format == "weeks" or $course->format == "topics") {
-            $table->data[] = array ($section, $tt_href, "<A HREF=\"view.php?id=$survey->coursemodule\">$ss</A>");
+            $table->data[] = array ($printsection, $tt_href, "<A HREF=\"view.php?id=$survey->coursemodule\">$ss</A>");
         } else {
             $table->data[] = array ($tt_href, "<A HREF=\"view.php?id=$survey->coursemodule\">$ss</A>");
         }