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

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 09 Dec 2003 21:14:23 -0000


matthew		Tue Dec  9 16:14:23 2003 EDT

  Modified files:              
    /loncom/interface	loncoursedata.pm 
    /loncom/interface/statistics	lonproblemstatistics.pm 
  Log:
  Bug 2371 is fixed!
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.108 loncom/interface/loncoursedata.pm:1.109
--- loncom/interface/loncoursedata.pm:1.108	Thu Oct 30 11:20:18 2003
+++ loncom/interface/loncoursedata.pm	Tue Dec  9 16:14:23 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.108 2003/10/30 16:20:18 matthew Exp $
+# $Id: loncoursedata.pm,v 1.109 2003/12/09 21:14:23 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -73,8 +73,6 @@
 
 =item &get_sequence_assessment_data()
 
-AT THIS TIME THE USE OF THIS FUNCTION IS *NOT* RECOMMENDED
-
 Use lonnavmaps to build a data structure describing the order and 
 assessment contents of each sequence in the current course.
 
@@ -1889,21 +1887,10 @@
     my $dbh = &Apache::lonmysql::get_dbh();
     return undef if (! defined($dbh));
     #
-    # A) Number of Students attempting problem
-    # B) Total number of tries of students attempting problem
-    # C) Mod (largest number of tries for solving the problem)
-    # D) Mean (average number of tries for solving the problem)
-    # E) Number of students to solve the problem
-    # F) Number of students to solve the problem by override
-    # G) Number of students unable to solve the problem
-    # H) Degree of difficulty : 1-(E+F)/B
-    # I) Standard deviation of number of tries
-    # J) Skew of tries: sqrt(sum(Xi-D)^3)/A
-    #
     $dbh->do('DROP TABLE '.$stats_table);  # May return an error
     my $request = 
         'CREATE TEMPORARY TABLE '.$stats_table.
-            ' SELECT student_id,solved,award,tries FROM '.$performance_table.
+            ' SELECT student_id,solved,award,awarded,tries FROM '.$performance_table.
                 ' WHERE symb_id='.$symb_id.' AND part_id='.$part_id;
     if (defined($students)) {
         $request .= ' AND ('.
@@ -1915,16 +1902,22 @@
     }
 #    &Apache::lonnet::logthis($request);
     $dbh->do($request);
+#    &Apache::lonnet::logthis('request = '.$/.$request);
+    $request = 'SELECT COUNT(*),SUM(tries),MAX(tries),AVG(tries),STD(tries) '.
+        'FROM '.$stats_table;
     my ($num,$tries,$mod,$mean,$STD) = &execute_SQL_request
-        ($dbh,
-         'SELECT COUNT(*),SUM(tries),MAX(tries),AVG(tries),STD(tries) FROM '.
-         $stats_table);
-    my ($Solved) = &execute_SQL_request($dbh,'SELECT COUNT(tries) FROM '.
-                                        $stats_table.
-         " WHERE solved='correct_by_student' OR solved='correct_by_scantron'");
-    my ($solved) = &execute_SQL_request($dbh,'SELECT COUNT(tries) FROM '.
-                                        $stats_table.
-                                        " WHERE solved='correct_by_override'");
+        ($dbh,$request);
+#    &Apache::lonnet::logthis('request = '.$/.$request);
+    $request = 'SELECT SUM(awarded) FROM '.$stats_table;
+    my ($Solved) = &execute_SQL_request($dbh,$request);
+#    &Apache::lonnet::logthis('request = '.$/.$request);
+    $request = 'SELECT SUM(awarded) FROM '.$stats_table.
+        " WHERE solved='correct_by_override'";
+#    &Apache::lonnet::logthis('request = '.$/.$request);
+    my ($solved) = &execute_SQL_request($dbh,$request);
+#    $Solved = int($Solved);
+#    $solved = int($solved);
+    #
     $num    = 0 if (! defined($num));
     $tries  = 0 if (! defined($tries));
     $mod    = 0 if (! defined($mod));
@@ -1944,7 +1937,7 @@
         $wrongpercent=int(10*100*($num-$Solved+$solved)/$num)/10;
     }
     #
-    $dbh->do('DROP TABLE '.$stats_table);  # May return an error
+#    $dbh->do('DROP TABLE '.$stats_table);  # May return an error
     #
     # Store in metadata
     #
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.62 loncom/interface/statistics/lonproblemstatistics.pm:1.63
--- loncom/interface/statistics/lonproblemstatistics.pm:1.62	Mon Dec  8 14:37:44 2003
+++ loncom/interface/statistics/lonproblemstatistics.pm	Tue Dec  9 16:14:23 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemstatistics.pm,v 1.62 2003/12/08 19:37:44 matthew Exp $
+# $Id: lonproblemstatistics.pm,v 1.63 2003/12/09 21:14:23 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -147,7 +147,7 @@
              title  => '#YES',
              align  => 'right',
              color  => '#FFDDDD',
-             format => '%d',
+             format => '%4.1f',#             format => '%d',
              sortable  => 'yes',
              graphable => 'yes',
              long_title => 'Number of Students able to Solve' },
@@ -155,7 +155,7 @@
              title  => '#yes',
              align  => 'right',
              color  => '#FFDDDD',
-             format => '%d',
+             format => '%4.1f',#             format => '%d',
              sortable  => 'yes',
              graphable => 'yes',
              long_title => 'Number of Students given Override' },