[LON-CAPA-cvs] cvs: modules /matthew/activitylog parse_activity_log.pl

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 26 Jul 2004 19:58:50 -0000


matthew		Mon Jul 26 15:58:50 2004 EDT

  Modified files:              
    /modules/matthew/activitylog	parse_activity_log.pl 
  Log:
  Cleanups and comments, nothing special.
  
  
Index: modules/matthew/activitylog/parse_activity_log.pl
diff -u modules/matthew/activitylog/parse_activity_log.pl:1.1 modules/matthew/activitylog/parse_activity_log.pl:1.2
--- modules/matthew/activitylog/parse_activity_log.pl:1.1	Mon Jul 26 15:57:39 2004
+++ modules/matthew/activitylog/parse_activity_log.pl	Mon Jul 26 15:58:50 2004
@@ -2,7 +2,7 @@
 #
 # The LearningOnline Network
 #
-# $Id: parse_activity_log.pl,v 1.1 2004/07/26 19:57:39 matthew Exp $
+# $Id: parse_activity_log.pl,v 1.2 2004/07/26 19:58:50 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -63,7 +63,8 @@
                            "drop"      => \$drop);
 if (! defined($course) || $help) {
     print<<USAGE;
-$0
+parse_activity_log.pl
+
 Process a lon-capa activity log into a database.
 Parameters:
    course             Required
@@ -106,8 +107,9 @@
 
 rename($filename,$filename.'.processing');
 
-#
-# Table definition
+##
+## Table definitions
+##
 my $prefix = $course.'_'.$domain.'_';
 my $student_table = $prefix.'students';
 my $student_table_def = 
@@ -144,7 +146,7 @@
 my $action_table_def =
 { id => $action_table,
   permanent => 'no',
-  columns => [{ name => 'act_id',
+  columns => [{ name => 'action_id',
                 type => 'MEDIUMINT UNSIGNED',
                 restrictions => 'NOT NULL',
                 auto_inc     => 'yes', },
@@ -152,7 +154,7 @@
                 type => 'VARCHAR(100)',
                 restrictions => 'NOT NULL'},
               ],
-  'PRIMARY KEY' => ['act_id',], 
+  'PRIMARY KEY' => ['action_id',], 
 };
 
 my $machine_table = $prefix.'machine_table';
@@ -187,10 +189,10 @@
               { name => 'action_id',
                 type => 'VARCHAR(100) BINARY',
                 restrictions => 'NOT NULL',},
-              { name => 'idx',
-                type => 'MEDIUMINT UNSIGNED',
-                restrictions => 'NOT NULL',
-                auto_inc     => 'yes', },
+              { name => 'idx',                # This is here in case a student
+                type => 'MEDIUMINT UNSIGNED', # has multiple submissions during
+                restrictions => 'NOT NULL',   # one second.  It happens, trust
+                auto_inc     => 'yes', },     # me.
               { name => 'machine_id',
                 type => 'VARCHAR(100) BINARY',
                 restrictions => 'NOT NULL',},
@@ -199,6 +201,9 @@
               ], 
       'PRIMARY KEY' => ['res_id','time','student_id','action_id','idx'],
 };
+##
+## End of table definitions
+##
 
 # 
 &Apache::lonmysql::set_mysql_user_and_password($perlvar{'lonSqlUser'},