From 629e9373529a5d6fca794331e623b838fad8cbc9 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 21 Oct 2002 06:42:58 +0000 Subject: [PATCH] Added journal_grades() so journals show up in the Grades page --- mod/journal/lib.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mod/journal/lib.php b/mod/journal/lib.php index f9623bb861..44d64c914d 100644 --- a/mod/journal/lib.php +++ b/mod/journal/lib.php @@ -161,6 +161,22 @@ function journal_print_recent_activity(&$logs, $isteacher=false) { return $content; } +function journal_grades($journalid) { +/// Must return an array of grades, indexed by user, and a max grade. + global $JOURNAL_RATING; + + $return->grades = get_records_sql_menu("SELECT user,rating FROM journal_entries WHERE journal = '$journalid'"); + foreach ($return->grades as $key => $value) { + if ($value) { + $return->grades[$key] = $JOURNAL_RATING[$value]; + } else { + $return->grades[$key] = "-"; + } + } + $return->maxgrade = ""; + return $return; +} + // OTHER JOURNAL FUNCTIONS /////////////////////////////////////////////////////////////////// -- 2.39.5