diff --git a/mod/assignment/index.php b/mod/assignment/index.php
index b071b423ca807..21dc1acbc932d 100644
--- a/mod/assignment/index.php
+++ b/mod/assignment/index.php
@@ -45,6 +45,8 @@
$table->align = array ("left", "left", "left");
}
+ $currentsection = "";
+
foreach ($assignments as $assignment) {
if (isteacher($course->id)) {
if ($assignment->type == OFFLINE) {
@@ -53,13 +55,13 @@
} else {
$count = count_records_select("assignment_submissions",
"assignment = '$assignment->id' AND timemodified > 0");
- $submitted = "id\">" .
+ $submitted = "id\">" .
get_string("viewsubmissions", "assignment", $count) . "";
}
} else {
if ($submission = assignment_get_submission($assignment, $USER)) {
if ($submission->timemodified <= $assignment->timedue) {
- $submitted = userdate($submission->timemodified);
+ $submitted = userdate($submission->timemodified);
} else {
$submitted = "".userdate($submission->timemodified)."";
}
@@ -71,19 +73,25 @@
$due = userdate($assignment->timedue);
if (!$assignment->visible) {
//Show dimmed if the mod is hidden
- $link = "coursemodule\">$assignment->name";
+ $link = "coursemodule\">$assignment->name";
} else {
//Show normal if the mod is visible
- $link = "coursemodule\">$assignment->name";
+ $link = "coursemodule\">$assignment->name";
}
- if ($assignment->section) {
- $section = "$assignment->section";
- } else {
- $section = "";
+
+ $printsection = "";
+ if ($assignment->section !== $currentsection) {
+ if ($assignment->section) {
+ $printsection = $assignment->section;
+ }
+ if ($currentsection !== "") {
+ $table->data[] = 'hr';
+ }
+ $currentsection = $assignment->section;
}
if ($course->format == "weeks" or $course->format == "topics") {
- $table->data[] = array ($section, $link, $due, $submitted);
+ $table->data[] = array ($printsection, $link, $due, $submitted);
} else {
$table->data[] = array ($link, $due, $submitted);
}
diff --git a/mod/quiz/index.php b/mod/quiz/index.php
index 80f9558e6d807..c6b18eacd53b9 100644
--- a/mod/quiz/index.php
+++ b/mod/quiz/index.php
@@ -75,6 +75,8 @@
$table->size = array ("*", "*", "*");
}
+ $currentsection = "";
+
foreach ($quizzes as $quiz) {
if (!$quiz->visible) {
//Show dimmed if the mod is hidden
@@ -86,10 +88,15 @@
$bestgrade = quiz_get_best_grade($quiz->id, $USER->id);
- if ($quiz->section) {
- $section = "$quiz->section";
- } else {
- $section = "";
+ $printsection = "";
+ if ($quiz->section !== $currentsection) {
+ if ($quiz->section) {
+ $printsection = $quiz->section;
+ }
+ if ($currentsection !== "") {
+ $table->data[] = 'hr';
+ }
+ $currentsection = $quiz->section;
}
$closequiz = userdate($quiz->timeclose);
@@ -113,7 +120,7 @@
}
if ($course->format == "weeks" or $course->format == "topics") {
- $table->data[] = array ($section, $link, $closequiz, $gradecol);
+ $table->data[] = array ($printsection, $link, $closequiz, $gradecol);
} else {
$table->data[] = array ($link, $closequiz, $gradecol);
}
diff --git a/mod/resource/index.php b/mod/resource/index.php
index b1eacb7cfae29..416165a06d43b 100644
--- a/mod/resource/index.php
+++ b/mod/resource/index.php
@@ -45,12 +45,15 @@
$currentsection = "";
foreach ($resources as $resource) {
if ($course->format == "weeks" or $course->format == "topics") {
- if ($resource->section != $currentsection and $resource->section) {
- $printsection = $resource->section;
+ $printsection = "";
+ if ($resource->section !== $currentsection) {
+ if ($resource->section) {
+ $printsection = $resource->section;
+ }
+ if ($currentsection !== "") {
+ $table->data[] = 'hr';
+ }
$currentsection = $resource->section;
- $table->data[] = 'hr';
- } else {
- $printsection = "";
}
} else {
$printsection = ''.userdate($resource->timemodified)."";