]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes in display of standard user_complete and user_outline functions
authormartin <martin>
Sun, 4 Aug 2002 17:13:49 +0000 (17:13 +0000)
committermartin <martin>
Sun, 4 Aug 2002 17:13:49 +0000 (17:13 +0000)
for journal, forum and assignments

lang/en/assignment.php
lang/en/journal.php
mod/assignment/lib.php
mod/forum/lib.php
mod/journal/lib.php

index bc2bfa9b9a984fde1cade3234cb36f3b01b512b8..d553cb9628b0f9c73e2aec3b6f966ab4955ce40c 100644 (file)
@@ -9,13 +9,14 @@ $string[modulenameplural] = "Assignments";
 $string[assignmentdetails] = "Assignment details";
 $string[duedate] = "Assignment due";
 $string[early] = "\$a early";
+$string[failedupdatefeedback] = "Failed to update submission feedback for user \$a";
+$string[feedbackupdated] = "Submissions feedback updated for \$a people";
 $string[late] = "\$a late";
 $string[notsubmittedyet] = "Not submitted yet";
 $string[overwritewarning] = "Warning: uploading again will REPLACE your current submission";
 $string[submissionfeedback] = "Submission feedback";
 $string[submissions] = "Submissions";
-$string[failedupdatefeedback] = "Failed to update submission feedback for user \$a";
-$string[feedbackupdated] = "Submissions feedback updated for \$a people";
+$string[uploadedfiles] = "uploaded files";
 $string[viewsubmissions] = "View \$a submitted assignments";
 $string[yoursubmission] = "Your submission";
 
index dc0e7ca00c87c710e63b682a4a7d5e87927f5f37..f4a86af23fc8a44f0937df5ece251c7c3240e001 100644 (file)
@@ -5,4 +5,7 @@ $string[modulename] = "Journal";
 $string[modulenameplural] = "Journals";
 #------------------------------------------------------------
 
+
+$string[noentry] = "No entry";
+
 ?>
index e5e23c9f27fac03606389d8bb0eaf1da57b8d3ce..c76198b464e2fd69e3bb44407b67789f1d9b016d 100644 (file)
@@ -55,6 +55,55 @@ function assignment_delete_instance($id) {
     return $result;
 }
 
+function assignment_user_outline($course, $user, $mod, $assignment) {
+    if ($submission = assignment_get_submission($assignment, $user)) {
+        if ($basedir = assignment_file_area($assignment, $user)) {
+            if ($files = get_directory_list($basedir)) {
+                $countfiles = count($files)." ".get_string("uploadedfiles", "assignment");
+                foreach ($files as $file) {
+                    $countfiles .= "; $file";
+                }
+            }
+        }
+        $result->info = $countfiles;
+        $result->time = $submission->timemodified;
+        return $result;
+    }
+    return NULL;
+}
+
+function assignment_user_complete($course, $user, $mod, $assignment) {
+    if ($submission = assignment_get_submission($assignment, $user)) {
+        if ($basedir = assignment_file_area($assignment, $user)) {
+            if ($files = get_directory_list($basedir)) {
+                $countfiles = count($files)." ".get_string("uploadedfiles", "assignment");
+                foreach ($files as $file) {
+                    $countfiles .= "; $file";
+                }
+            }
+        }
+
+        print_simple_box_start();
+        echo "<P><FONT SIZE=1>";
+        echo get_string("lastmodified").": ";
+        echo userdate($submission->timemodified);
+        echo assignment_print_difference($assignment->timedue - $submission->timemodified);
+        echo "</FONT></P>";
+
+        assignment_print_user_files($assignment, $user);
+
+        echo "<BR>";
+
+        assignment_print_feedback($course, $submission);
+
+        print_simple_box_end();
+
+    } else {
+        print_string("notsubmittedyet", "assignment");
+    }
+}
+
+
 function assignment_cron () {
 // Function to be run periodically according to the moodle cron
 // Finds all assignment notifications that have yet to be mailed out, and mails them
index f18c16d15ab025bf6a9ce4b57500c04035adf1ac..2c873f4e115d6ecf817c12e37a75fbe24a0e51ac 100644 (file)
@@ -494,7 +494,7 @@ function forum_user_complete($course, $user, $mod, $forum) {
                 $footer = "";
             }
 
-            print_post($post, $course->id, $ownpost=false, $reply=false, $link=false, $rate=false, $footer);
+            forum_print_post($post, $course->id, $ownpost=false, $reply=false, $link=false, $rate=false, $footer);
         }
 
     } else {
index b866262904ddff7b719cc69521c4f74ccf759054..13755b7b514310d86e26c14ce769dd044bbfcbb8 100644 (file)
@@ -25,7 +25,6 @@ function journal_user_outline($course, $user, $mod, $journal) {
 
 
 function journal_user_complete($course, $user, $mod, $journal) {
-    global $CFG, $THEME;
 
     if ($entry = get_record_sql("SELECT * FROM journal_entries 
                              WHERE user='$user->id' AND journal='$journal->id'")) {
@@ -38,34 +37,12 @@ function journal_user_complete($course, $user, $mod, $journal) {
             echo text_to_html($entry->text);
         }
         if ($entry->teacher) {
-            $teacher = get_record("user", "id", $entry->teacher);
-    
-            echo "\n<BR CLEAR=ALL>";
-            echo "<TABLE><TR>";
-            echo "<TD WIDTH=35 VALIGN=TOP>";
-            print_user_picture($entry->teacher, $course->id, $teacher->picture);
-            echo "<TD BGCOLOR=\"$THEME->cellheading\">".$RATING[$entry->rating];
-            if ($entry->timemarked) {
-                echo "&nbsp;&nbsp;<FONT SIZE=1>".userdate($entry->timemarked)."</FONT>";
-            }
-            echo "<P ALIGN=RIGHT><FONT SIZE=-1><I>";
-            if ($RATING[$entry->rating]) {
-                echo "Overall rating: ";
-                echo $RATING[$entry->rating];
-            } else {
-                echo "No rating given";
-            }
-            echo "</I></FONT></P>";
-
-            echo "<BR><FONT COLOR=#000055>";
-            echo text_to_html($entry->comment);
-            echo "</FONT><BR>";
-            echo "</TD></TR></TABLE>";
+            journal_print_feedback($course, $entry);
         }
         print_simple_box_end();
 
     } else {
-        echo "No entry";
+        print_string("noentry", "journal");
     }
 }