]> git.mjollnir.org Git - moodle.git/commitdiff
Added journal_grades() so journals show up in the Grades page
authormoodler <moodler>
Mon, 21 Oct 2002 06:42:58 +0000 (06:42 +0000)
committermoodler <moodler>
Mon, 21 Oct 2002 06:42:58 +0000 (06:42 +0000)
mod/journal/lib.php

index f9623bb8614d231856c387f9c5a52c2969d81c8f..44d64c914d9697cbf303b6093d5fd3100454e9e2 100644 (file)
@@ -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 ///////////////////////////////////////////////////////////////////