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

www lon-capa-cvs@mail.lon-capa.org
Wed, 25 Jun 2003 19:25:54 -0000


www		Wed Jun 25 15:25:54 2003 EDT

  Modified files:              
    /loncom/interface	loncoursedata.pm 
  Log:
  Bug 1638: Problem statistics stored in metadata again.
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.79 loncom/interface/loncoursedata.pm:1.80
--- loncom/interface/loncoursedata.pm:1.79	Thu Jun 19 08:45:54 2003
+++ loncom/interface/loncoursedata.pm	Wed Jun 25 15:25:54 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.79 2003/06/19 12:45:54 matthew Exp $
+# $Id: loncoursedata.pm,v 1.80 2003/06/25 19:25:54 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1371,6 +1371,25 @@
     }
     #
     $dbh->do('DROP TABLE '.$stats_table);  # May return an error
+#
+# Store in metadata
+#
+    if ($num) {
+	my %storestats=();
+
+        my $urlres=(split(/\_\_\_/,$symb))[2];
+
+	$storestats{$courseid.'___'.$urlres.'___timestamp'}=time;       
+	$storestats{$courseid.'___'.$urlres.'___stdno'}=$num;
+	$storestats{$courseid.'___'.$urlres.'___avetries'}=$mean;	   
+	$storestats{$courseid.'___'.$urlres.'___difficulty'}=$DegOfDiff;
+
+	$urlres=~/^(\w+)\/(\w+)/; 
+	&Apache::lonnet::put('nohist_resevaldata',\%storestats,$1,$2); 
+    }
+#
+# Return result
+#
     return { num_students => $num,
              tries        => $tries,
              max_tries    => $mod,