mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Better dividers in the table
This commit is contained in:
parent
a1a6750357
commit
858c8a05e8
3 changed files with 37 additions and 19 deletions
|
@ -45,6 +45,8 @@
|
||||||
$table->align = array ("left", "left", "left");
|
$table->align = array ("left", "left", "left");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$currentsection = "";
|
||||||
|
|
||||||
foreach ($assignments as $assignment) {
|
foreach ($assignments as $assignment) {
|
||||||
if (isteacher($course->id)) {
|
if (isteacher($course->id)) {
|
||||||
if ($assignment->type == OFFLINE) {
|
if ($assignment->type == OFFLINE) {
|
||||||
|
@ -53,13 +55,13 @@
|
||||||
} else {
|
} else {
|
||||||
$count = count_records_select("assignment_submissions",
|
$count = count_records_select("assignment_submissions",
|
||||||
"assignment = '$assignment->id' AND timemodified > 0");
|
"assignment = '$assignment->id' AND timemodified > 0");
|
||||||
$submitted = "<A HREF=\"submissions.php?id=$assignment->id\">" .
|
$submitted = "<a href=\"submissions.php?id=$assignment->id\">" .
|
||||||
get_string("viewsubmissions", "assignment", $count) . "</A>";
|
get_string("viewsubmissions", "assignment", $count) . "</A>";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($submission = assignment_get_submission($assignment, $USER)) {
|
if ($submission = assignment_get_submission($assignment, $USER)) {
|
||||||
if ($submission->timemodified <= $assignment->timedue) {
|
if ($submission->timemodified <= $assignment->timedue) {
|
||||||
$submitted = userdate($submission->timemodified);
|
$submitted = userdate($submission->timemodified);
|
||||||
} else {
|
} else {
|
||||||
$submitted = "<font color=red>".userdate($submission->timemodified)."</font>";
|
$submitted = "<font color=red>".userdate($submission->timemodified)."</font>";
|
||||||
}
|
}
|
||||||
|
@ -71,19 +73,25 @@
|
||||||
$due = userdate($assignment->timedue);
|
$due = userdate($assignment->timedue);
|
||||||
if (!$assignment->visible) {
|
if (!$assignment->visible) {
|
||||||
//Show dimmed if the mod is hidden
|
//Show dimmed if the mod is hidden
|
||||||
$link = "<A class=\"dimmed\" HREF=\"view.php?id=$assignment->coursemodule\">$assignment->name</A>";
|
$link = "<a class=\"dimmed\" href=\"view.php?id=$assignment->coursemodule\">$assignment->name</a>";
|
||||||
} else {
|
} else {
|
||||||
//Show normal if the mod is visible
|
//Show normal if the mod is visible
|
||||||
$link = "<A HREF=\"view.php?id=$assignment->coursemodule\">$assignment->name</A>";
|
$link = "<a href=\"view.php?id=$assignment->coursemodule\">$assignment->name</a>";
|
||||||
}
|
}
|
||||||
if ($assignment->section) {
|
|
||||||
$section = "$assignment->section";
|
$printsection = "";
|
||||||
} else {
|
if ($assignment->section !== $currentsection) {
|
||||||
$section = "";
|
if ($assignment->section) {
|
||||||
|
$printsection = $assignment->section;
|
||||||
|
}
|
||||||
|
if ($currentsection !== "") {
|
||||||
|
$table->data[] = 'hr';
|
||||||
|
}
|
||||||
|
$currentsection = $assignment->section;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($course->format == "weeks" or $course->format == "topics") {
|
if ($course->format == "weeks" or $course->format == "topics") {
|
||||||
$table->data[] = array ($section, $link, $due, $submitted);
|
$table->data[] = array ($printsection, $link, $due, $submitted);
|
||||||
} else {
|
} else {
|
||||||
$table->data[] = array ($link, $due, $submitted);
|
$table->data[] = array ($link, $due, $submitted);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,8 @@
|
||||||
$table->size = array ("*", "*", "*");
|
$table->size = array ("*", "*", "*");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$currentsection = "";
|
||||||
|
|
||||||
foreach ($quizzes as $quiz) {
|
foreach ($quizzes as $quiz) {
|
||||||
if (!$quiz->visible) {
|
if (!$quiz->visible) {
|
||||||
//Show dimmed if the mod is hidden
|
//Show dimmed if the mod is hidden
|
||||||
|
@ -86,10 +88,15 @@
|
||||||
|
|
||||||
$bestgrade = quiz_get_best_grade($quiz->id, $USER->id);
|
$bestgrade = quiz_get_best_grade($quiz->id, $USER->id);
|
||||||
|
|
||||||
if ($quiz->section) {
|
$printsection = "";
|
||||||
$section = "$quiz->section";
|
if ($quiz->section !== $currentsection) {
|
||||||
} else {
|
if ($quiz->section) {
|
||||||
$section = "";
|
$printsection = $quiz->section;
|
||||||
|
}
|
||||||
|
if ($currentsection !== "") {
|
||||||
|
$table->data[] = 'hr';
|
||||||
|
}
|
||||||
|
$currentsection = $quiz->section;
|
||||||
}
|
}
|
||||||
|
|
||||||
$closequiz = userdate($quiz->timeclose);
|
$closequiz = userdate($quiz->timeclose);
|
||||||
|
@ -113,7 +120,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($course->format == "weeks" or $course->format == "topics") {
|
if ($course->format == "weeks" or $course->format == "topics") {
|
||||||
$table->data[] = array ($section, $link, $closequiz, $gradecol);
|
$table->data[] = array ($printsection, $link, $closequiz, $gradecol);
|
||||||
} else {
|
} else {
|
||||||
$table->data[] = array ($link, $closequiz, $gradecol);
|
$table->data[] = array ($link, $closequiz, $gradecol);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,12 +45,15 @@
|
||||||
$currentsection = "";
|
$currentsection = "";
|
||||||
foreach ($resources as $resource) {
|
foreach ($resources as $resource) {
|
||||||
if ($course->format == "weeks" or $course->format == "topics") {
|
if ($course->format == "weeks" or $course->format == "topics") {
|
||||||
if ($resource->section != $currentsection and $resource->section) {
|
$printsection = "";
|
||||||
$printsection = $resource->section;
|
if ($resource->section !== $currentsection) {
|
||||||
|
if ($resource->section) {
|
||||||
|
$printsection = $resource->section;
|
||||||
|
}
|
||||||
|
if ($currentsection !== "") {
|
||||||
|
$table->data[] = 'hr';
|
||||||
|
}
|
||||||
$currentsection = $resource->section;
|
$currentsection = $resource->section;
|
||||||
$table->data[] = 'hr';
|
|
||||||
} else {
|
|
||||||
$printsection = "";
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$printsection = '<span class="smallinfo">'.userdate($resource->timemodified)."</span>";
|
$printsection = '<span class="smallinfo">'.userdate($resource->timemodified)."</span>";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue