]> git.mjollnir.org Git - moodle.git/commitdiff
SOme improvements to logging
authormoodler <moodler>
Mon, 16 Feb 2004 12:20:40 +0000 (12:20 +0000)
committermoodler <moodler>
Mon, 16 Feb 2004 12:20:40 +0000 (12:20 +0000)
mod/lesson/db/mysql.php
mod/lesson/db/mysql.sql
mod/lesson/version.php
mod/lesson/view.php

index b3bfa4dd348ebe4bf9c9014cacd9bdbde6a5a4f6..f30670b3a99ad93ddc85cb64f37fb699332cc89e 100644 (file)
@@ -6,9 +6,13 @@ function lesson_upgrade($oldversion) {
 
     global $CFG;
 
-    if ($oldversion < 2004012400) {
+    if ($oldversion < 2004021600) {
 
-       # Do something ...
+       delete_records("log_display", "module", "lesson");
+
+       modify_database ("", "INSERT INTO prefix_log_display VALUES ('lesson', 'start', 'lesson', 'name');");
+       modify_database ("", "INSERT INTO prefix_log_display VALUES ('lesson', 'end', 'lesson', 'name');");
+       modify_database ("", "INSERT INTO prefix_log_display VALUES ('lesson', 'view', 'lesson_pages', 'title');");
 
     }
 
index 9707544d150d7fe0881f33008e0048bea0b39bce..b18f7e2879570350a0ff3394c48d11b9cd6e19cc 100644 (file)
@@ -69,4 +69,6 @@ CREATE TABLE `prefix_lesson_grades` (
 # --------------------------------------------------------
 
 
-INSERT INTO prefix_log_display VALUES ('lesson', 'view', 'lesson', 'name');
+INSERT INTO prefix_log_display VALUES ('lesson', 'start', 'lesson', 'name');
+INSERT INTO prefix_log_display VALUES ('lesson', 'end', 'lesson', 'name');
+INSERT INTO prefix_log_display VALUES ('lesson', 'view', 'lesson_pages', 'title');
index 0e30fdd94f5aa30d4caf1a832dcff41312a3ab98..f6b7892fea011dfb58e7f6abd02037b17cf48389 100644 (file)
@@ -5,7 +5,7 @@
 ///  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 /////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2004021400;  // The current module version (Date: YYYYMMDDXX)
+$module->version  = 2004021600;  // The current module version (Date: YYYYMMDDXX)
 $module->requires = 2004013101;  // Requires this Moodle version
 $module->cron     = 0;           // Period for cron to check this module (secs)
 
index 73c555078700980ea73d6fadc519caac2556e65b..59c90f94b8a9a1612e2afbb17b95276d590593f9 100644 (file)
 
     require_login($course->id);
 
-    add_to_log($course->id, "lesson", "view", "view.php?id=$cm->id", "$lesson->id", $cm->id);
 
 /// Print the page header
 
     if ($course->category) {
-        $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
+        $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
     }
 
     $strlessons = get_string("modulenameplural", "lesson");
@@ -61,6 +60,7 @@
         // if pageid is EOL then the end of the lesson has been reached
         print_heading($lesson->name);
                if (empty($_GET['pageid'])) {
+            add_to_log($course->id, "lesson", "start", "view.php?id=$cm->id", "$lesson->id", $cm->id);
             // if no pageid given see if the lesson has been started
             if ($grades = get_records_select("lesson_grades", "lessonid = $lesson->id AND userid = $USER->id",
                         "grade DESC")) {
             $pageid = $_GET['pageid'];
         }
         if ($pageid != EOL) {
+            add_to_log($course->id, "lesson", "view", "view.php?id=$cm->id&action=navigation&pageid=$pageid", "$pageid", $cm->id);
             if (!$page = get_record("lesson_pages", "id", $pageid)) {
                 error("Navigation: the page record not found");
             }
             echo "</table>\n";
         } else {
             // end of lesson reached work out grade
+            add_to_log($course->id, "lesson", "end", "view.php?id=$cm->id", "$lesson->id", $cm->id);
             print_heading(get_string("congratulations", "lesson"));
             print_simple_box_start("center");
             $ntries = count_records("lesson_grades", "lessonid", $lesson->id, "userid", $USER->id);