From abcc3a17b9d3e6e5c079b4c772b23c8c77a54c96 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 17 Feb 2004 14:39:15 +0000 Subject: [PATCH] Fixed up some logging --- mod/choice/db/mysql.php | 4 ++++ mod/choice/db/mysql.sql | 4 ++-- mod/choice/db/postgres7.php | 4 ++++ mod/choice/db/postgres7.sql | 5 ++--- mod/choice/version.php | 2 +- mod/choice/view.php | 4 ++-- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/mod/choice/db/mysql.php b/mod/choice/db/mysql.php index abf13bf7e5..f3313ed5fa 100644 --- a/mod/choice/db/mysql.php +++ b/mod/choice/db/mysql.php @@ -25,6 +25,10 @@ function choice_upgrade($oldversion) { if ($oldversion < 2004010100) { table_column("choice", "", "showunanswered", "integer", "4", "unsigned", "0", "", "publish"); } + if ($oldversion < 2004021700) { + modify_database("", "INSERT INTO prefix_log_display VALUES ('choice', 'choose', 'choice', 'name');"); + modify_database("", "INSERT INTO prefix_log_display VALUES ('choice', 'choose again', 'choice', 'name');"); + } return true; } diff --git a/mod/choice/db/mysql.sql b/mod/choice/db/mysql.sql index c513fcbf15..c43cd39974 100755 --- a/mod/choice/db/mysql.sql +++ b/mod/choice/db/mysql.sql @@ -58,7 +58,7 @@ INSERT INTO prefix_log_display VALUES ('choice', 'view', 'choice', 'name'); INSERT INTO prefix_log_display VALUES ('choice', 'update', 'choice', 'name'); INSERT INTO prefix_log_display VALUES ('choice', 'add', 'choice', 'name'); INSERT INTO prefix_log_display VALUES ('choice', 'report', 'choice', 'name'); - - +INSERT INTO prefix_log_display VALUES ('choice', 'choose', 'choice', 'name'); +INSERT INTO prefix_log_display VALUES ('choice', 'choose again', 'choice', 'name'); diff --git a/mod/choice/db/postgres7.php b/mod/choice/db/postgres7.php index 66f37a7e9f..04fc87a8d3 100644 --- a/mod/choice/db/postgres7.php +++ b/mod/choice/db/postgres7.php @@ -11,6 +11,10 @@ function choice_upgrade($oldversion) { if ($oldversion < 2004010100) { table_column("choice", "", "showunanswered", "integer", "4", "unsigned", "0", "", "publish"); } + if ($oldversion < 2004021700) { + modify_database("", "INSERT INTO prefix_log_display VALUES ('choice', 'choose', 'choice', 'name');"); + modify_database("", "INSERT INTO prefix_log_display VALUES ('choice', 'choose again', 'choice', 'name');"); + } return true; } diff --git a/mod/choice/db/postgres7.sql b/mod/choice/db/postgres7.sql index 3fcc386d96..ec08c37e38 100755 --- a/mod/choice/db/postgres7.sql +++ b/mod/choice/db/postgres7.sql @@ -54,7 +54,6 @@ INSERT INTO prefix_log_display VALUES ('choice', 'view', 'choice', 'name'); INSERT INTO prefix_log_display VALUES ('choice', 'update', 'choice', 'name'); INSERT INTO prefix_log_display VALUES ('choice', 'add', 'choice', 'name'); INSERT INTO prefix_log_display VALUES ('choice', 'report', 'choice', 'name'); - - - +INSERT INTO prefix_log_display VALUES ('choice', 'choose', 'choice', 'name'); +INSERT INTO prefix_log_display VALUES ('choice', 'choose again', 'choice', 'name'); diff --git a/mod/choice/version.php b/mod/choice/version.php index cf8e3400d0..08aa622b24 100644 --- a/mod/choice/version.php +++ b/mod/choice/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2004013101; +$module->version = 2004021700; $module->requires = 2004013101; // Requires this Moodle version $module->cron = 0; diff --git a/mod/choice/view.php b/mod/choice/view.php index 7eb2a8ffd4..d854cb9aa4 100644 --- a/mod/choice/view.php +++ b/mod/choice/view.php @@ -40,7 +40,7 @@ if (! update_record("choice_answers", $newanswer)) { error("Could not update your choice"); } - add_to_log($course->id, "choice", "update", "view.php?id=$cm->id", $choice->id, $cm->id); + add_to_log($course->id, "choice", "choose again", "view.php?id=$cm->id", $choice->id, $cm->id); } else { $newanswer->choice = $choice->id; $newanswer->userid = $USER->id; @@ -49,7 +49,7 @@ if (! insert_record("choice_answers", $newanswer)) { error("Could not save your choice"); } - add_to_log($course->id, "choice", "add", "view.php?id=$cm->id", $choice->id, $cm->id); + add_to_log($course->id, "choice", "choose", "view.php?id=$cm->id", $choice->id, $cm->id); } } redirect("$CFG->wwwroot/course/view.php?id=$course->id"); -- 2.39.5