From: moodler Date: Mon, 21 Oct 2002 06:42:58 +0000 (+0000) Subject: Added journal_grades() so journals show up in the Grades page X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=629e9373529a5d6fca794331e623b838fad8cbc9;p=moodle.git Added journal_grades() so journals show up in the Grades page --- 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 ///////////////////////////////////////////////////////////////////