[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 27 Mar 2003 19:29:36 -0000


matthew		Thu Mar 27 14:29:36 2003 EDT

  Modified files:              
    /loncom/interface	loncoursedata.pm 
  Log:
  Removed 'weight' from local caching.  If you have looked at the chart or
  stats you will need to run 
  
  /home/httpd/perl/cleanup_database.pl --killtime 0 
  
  to clean out your old caches.
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.62 loncom/interface/loncoursedata.pm:1.63
--- loncom/interface/loncoursedata.pm:1.62	Wed Mar 26 11:25:06 2003
+++ loncom/interface/loncoursedata.pm	Thu Mar 27 14:29:36 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.62 2003/03/26 16:25:06 matthew Exp $
+# $Id: loncoursedata.pm,v 1.63 2003/03/27 19:29:36 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -506,8 +506,6 @@
                       type => 'TINYTEXT' },
                     { name => 'timestamp',
                       type => 'INT UNSIGNED'},
-                    { name => 'weight',
-                      type => 'INT UNSIGNED'},
                     ],
         'PRIMARY KEY' => ['symb_id','student_id','part_id'],
         'KEY' => [{ columns=>['student_id'] },
@@ -859,10 +857,9 @@
         my $symb_id = &get_symb_id($current_symb);
         #
         # Load data into the tables
-        foreach my $parameter (keys(%$param_hash)) {
-            my $value = $param_hash->{$parameter};
+        while (my ($parameter,$value) = each(%$param_hash)) {
             my $newstring;
-            if ($parameter !~ /(timestamp|resource\.(.*)\.(solved|tries|awarded|award|awarddetail|previous|weight))/) {
+            if ($parameter !~ /(timestamp|resource\.(.*)\.(solved|tries|awarded|award|awarddetail|previous))/) {
                 $newstring = "('".join("','",
                                        $symb_id,$student_id,
                                        $parameter,$value)."'),\n";
@@ -883,11 +880,6 @@
             my $award   = $param_hash->{'resource.'.$part.'.award'};
             my $awarddetail = $param_hash->{'resource.'.$part.'.awarddetail'};
             my $timestamp = $param_hash->{'timestamp'};
-            # use EXT to get the weight
-            my $weight  = &Apache::lonnet::EXT('resource.'.$part.'.weight',
-                                               $current_symb,$sdom,$sname);
-            # Give the weight back to the user
-            $param_hash->{'resource.'.$part.'.weight'}=$weight;
             #
             $solved      = '' if (! defined($awarded));
             $tries       = '' if (! defined($tries));
@@ -896,7 +888,7 @@
             $awarddetail = '' if (! defined($awarddetail));
             $newstring = "('".join("','",$symb_id,$student_id,$part_id,
                                    $solved,$tries,$awarded,$award,
-                                   $awarddetail,$timestamp,$weight)."'),\n";
+                                   $awarddetail,$timestamp)."'),\n";
             $store_performance_command .= $newstring;
             $rows_stored++;
         }
@@ -1039,7 +1031,7 @@
     my $dbh = &Apache::lonmysql::get_dbh();
     my $request = "SELECT ".
         "d.symb,c.part,a.solved,a.tries,a.awarded,a.award,a.awarddetail,".
-            "a.timestamp,a.weight ";
+            "a.timestamp ";
     if (defined($student)) {
         $request .= "FROM $student_table AS b ".
             "LEFT JOIN $performance_table AS a ON b.student_id=a.student_id ".
@@ -1068,7 +1060,7 @@
     }
     foreach my $row (@{$sth->fetchall_arrayref}) {
         $rows_retrieved++;
-        my ($symb,$part,$solved,$tries,$awarded,$award,$awarddetail,$time,$weight) = 
+        my ($symb,$part,$solved,$tries,$awarded,$award,$awarddetail,$time) = 
             (@$row);
         my $base = 'resource.'.$part;
         $studentdata->{$symb}->{$base.'.solved'}  = $solved;
@@ -1077,7 +1069,6 @@
         $studentdata->{$symb}->{$base.'.award'}   = $award;
         $studentdata->{$symb}->{$base.'.awarddetail'} = $awarddetail;
         $studentdata->{$symb}->{'timestamp'} = $time if (defined($time) && $time ne '');
-        $studentdata->{$symb}->{'resource.'.$part.'.weight'}=$weight;
     }
     return $studentdata;
 }