Skip to content

Commit

Permalink
More cleanups for teacher view in particular
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Aug 27, 2003
1 parent d1582a1 commit 949cf86
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
14 changes: 12 additions & 2 deletions mod/journal/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,21 @@ function journal_user_complete($course, $user, $mod, $journal) {
}

function journal_user_complete_index($course, $user, $journal, $journalopen, $heading) {
/// Prints a journal, entry and feedback ... used on the journal index page.

if (isteacher($course->id)) {
$entrycount = count_records("journal_entries", "journal", $journal->id);
$entryinfo = "&nbsp;(<a href=\"report.php?id=$journal->coursemodule\">".get_string("viewallentries","journal", $entrycount)."</a>)";
} else {
$entryinfo = "";
}

$journal->name = "<a href=\"view.php?id=$journal->coursemodule\">$journal->name</a>";

if ($heading) {
echo "<h3>$heading - $journal->name</h3>";
echo "<h3>$heading - $journal->name$entryinfo</h3>";
} else {
echo "<h3>$journal->name</h3>";
echo "<h3>$journal->name$entryinfo</h3>";
}

print_simple_box_start("left", "90%");
Expand Down
12 changes: 4 additions & 8 deletions mod/journal/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,17 @@
update_module_button($cm->id, $course->id, $strjournal), navmenu($course, $cm));

if (isteacher($course->id)) {
if ($allentries = get_records("journal_entries", "journal", $journal->id)) {
$entrycount = count($allentries);
} else {
$entrycount = 0;
}
echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".get_string("viewallentries","journal", $entrycount)."</A></P>";
$entrycount = count_records("journal_entries", "journal", $journal->id);
echo "<p align=right><a href=\"report.php?id=$cm->id\">".get_string("viewallentries","journal", $entrycount)."</a></p>";
} else if (!$cm->visible) {
notice(get_string("activityiscurrentlyhidden"));
}

echo "<CENTER>\n";
echo "<center>\n";

print_simple_box( text_to_html($journal->intro) , "center");

echo "<BR>";
echo "<br \>";

$timenow = time();

Expand Down

0 comments on commit 949cf86

Please sign in to comment.