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

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 05 Oct 2004 14:03:46 -0000


matthew		Tue Oct  5 10:03:46 2004 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemanalysis.pm 
  Log:
  Fix bug wherein option response tries analysis always showed the same
  concept graph.
  
  
Index: loncom/interface/statistics/lonproblemanalysis.pm
diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.92 loncom/interface/statistics/lonproblemanalysis.pm:1.93
--- loncom/interface/statistics/lonproblemanalysis.pm:1.92	Mon Oct  4 15:49:41 2004
+++ loncom/interface/statistics/lonproblemanalysis.pm	Tue Oct  5 10:03:45 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemanalysis.pm,v 1.92 2004/10/04 19:49:41 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.93 2004/10/05 14:03:45 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -619,9 +619,9 @@
         foreach my $foilid (@{$concept->{'foils'}}) {
             for (my $try=$mintries;$try<=$maxtries;$try++) {
                 # concept analysis data
-                $concept_data[$j]->{'_correct'} +=
+                $concept_data[$j]->[$try]->{'_correct'} +=
                     $response_data{$foilid}->[$try]->{'_correct'};
-                $concept_data[$j]->{'_total'} +=
+                $concept_data[$j]->[$try]->{'_total'} +=
                     $response_data{$foilid}->[$try]->{'_total'};
                 #
                 # foil analysis data
@@ -681,13 +681,14 @@
             # Create concept plot
             my @concept_plot_data;
             for (my $j=0;$j<=$#concept_data;$j++) {
-                my $total = $concept_data[$j]->{'_total'};
+                my $total = $concept_data[$j]->[$try]->{'_total'};
                 if ($total == 0) {
                     $concept_plot_data[$j] = 0;
                 } else {
                     $concept_plot_data[$j] = 100 * 
                         sprintf('%0.3f',
-                                $concept_data[$j]->{'_correct'} / $total);
+                                $concept_data[$j]->[$try]->{'_correct'} / 
+                                $total);
                 }
             }
             #