From 4899c66789272c58332b588604e03ca8804da1c7 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 17 Feb 2004 12:25:01 +0000 Subject: [PATCH] FIxed up logging when viewing submissions (database truncation in logs) Thanks Eloy! --- mod/assignment/db/mysql.php | 3 +++ mod/assignment/db/mysql.sql | 2 +- mod/assignment/db/postgres7.php | 3 +++ mod/assignment/db/postgres7.sql | 2 +- mod/assignment/submissions.php | 2 +- mod/assignment/version.php | 2 +- 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mod/assignment/db/mysql.php b/mod/assignment/db/mysql.php index 62267350f2e..f05f00edf5c 100644 --- a/mod/assignment/db/mysql.php +++ b/mod/assignment/db/mysql.php @@ -91,6 +91,9 @@ function assignment_upgrade($oldversion) { if ($oldversion < 2002122300) { execute_sql("ALTER TABLE `assignment_submissions` CHANGE `user` `userid` INT(10) UNSIGNED DEFAULT '0' NOT NULL "); } + if ($oldversion < 2004021700) { + set_field("log_display", "action", "view submission", "module", "assignment", "action", "view submissions"); + } return true; } diff --git a/mod/assignment/db/mysql.sql b/mod/assignment/db/mysql.sql index c4f431cf613..a8d75e08f13 100644 --- a/mod/assignment/db/mysql.sql +++ b/mod/assignment/db/mysql.sql @@ -42,6 +42,6 @@ CREATE TABLE `prefix_assignment_submissions` ( INSERT INTO prefix_log_display VALUES ('assignment', 'view', 'assignment', 'name'); INSERT INTO prefix_log_display VALUES ('assignment', 'add', 'assignment', 'name'); INSERT INTO prefix_log_display VALUES ('assignment', 'update', 'assignment', 'name'); -INSERT INTO prefix_log_display VALUES ('assignment', 'view submissions', 'assignment', 'name'); +INSERT INTO prefix_log_display VALUES ('assignment', 'view submission', 'assignment', 'name'); INSERT INTO prefix_log_display VALUES ('assignment', 'upload', 'assignment', 'name'); diff --git a/mod/assignment/db/postgres7.php b/mod/assignment/db/postgres7.php index b8b25556cc0..9f945e0dc41 100644 --- a/mod/assignment/db/postgres7.php +++ b/mod/assignment/db/postgres7.php @@ -88,6 +88,9 @@ function assignment_upgrade($oldversion) { table_column("assignment", "", "resubmit", "integer", "2", "unsigned", "0", "", "format"); } + if ($oldversion < 2004021700) { + set_field("log_display", "action", "view submission", "module", "assignment", "action", "view submissions"); + } return true; } diff --git a/mod/assignment/db/postgres7.sql b/mod/assignment/db/postgres7.sql index a9589d27f22..3738bbccb74 100644 --- a/mod/assignment/db/postgres7.sql +++ b/mod/assignment/db/postgres7.sql @@ -40,6 +40,6 @@ CREATE TABLE prefix_assignment_submissions ( INSERT INTO prefix_log_display VALUES ('assignment', 'view', 'assignment', 'name'); INSERT INTO prefix_log_display VALUES ('assignment', 'add', 'assignment', 'name'); INSERT INTO prefix_log_display VALUES ('assignment', 'update', 'assignment', 'name'); -INSERT INTO prefix_log_display VALUES ('assignment', 'view submissions', 'assignment', 'name'); +INSERT INTO prefix_log_display VALUES ('assignment', 'view submission', 'assignment', 'name'); INSERT INTO prefix_log_display VALUES ('assignment', 'upload', 'assignment', 'name'); diff --git a/mod/assignment/submissions.php b/mod/assignment/submissions.php index 02a5151543a..4974ad4d815 100644 --- a/mod/assignment/submissions.php +++ b/mod/assignment/submissions.php @@ -136,7 +136,7 @@ add_to_log($course->id, "assignment", "update grades", "submissions.php?id=$assignment->id", "$count users", $cm->id); notify(get_string("feedbackupdated", "assignment", $count)); } else { - add_to_log($course->id, "assignment", "view submissions", "submissions.php?id=$assignment->id", "$assignment->id", $cm->id); + add_to_log($course->id, "assignment", "view submission", "submissions.php?id=$assignment->id", "$assignment->id", $cm->id); } // Submission sorting diff --git a/mod/assignment/version.php b/mod/assignment/version.php index b36114e5975..366ca5c2da1 100644 --- a/mod/assignment/version.php +++ b/mod/assignment/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2004020500; +$module->version = 2004021700; $module->requires = 2004013101; // Requires this Moodle version $module->cron = 60;