SHow number of journal entries in the teacher link to report

This commit is contained in:
martin 2002-09-22 03:16:40 +00:00
parent 3bf90da5f6
commit 03af47eee3
2 changed files with 11 additions and 2 deletions

View file

@ -24,6 +24,6 @@ $string['noratinggiven'] = "No rating given";
$string['overallrating'] = "Overall rating";
$string['rate'] = "Rate";
$string['startoredit'] = "Start or edit my journal entry";
$string['viewallentries'] = "View all journal entries";
$string['viewallentries'] = "View \$a journal entries";
?>

View file

@ -37,8 +37,17 @@
update_module_icon($cm->id, $course->id));
if (isteacher($course->id)) {
echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".get_string("viewallentries","journal")."</A></P>";
}
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>";
}
print_simple_box( text_to_html($choice->text) , "center");
echo "<CENTER>\n";