[LON-CAPA-cvs] cvs: modules /gerd evaluate.pl

www lon-capa-cvs@mail.lon-capa.org
Tue, 11 Apr 2006 01:12:40 -0000


www		Mon Apr 10 21:12:40 2006 EDT

  Modified files:              
    /modules/gerd	evaluate.pl 
  Log:
  Different rounding
  
  
Index: modules/gerd/evaluate.pl
diff -u modules/gerd/evaluate.pl:1.8 modules/gerd/evaluate.pl:1.9
--- modules/gerd/evaluate.pl:1.8	Sun Apr  2 20:56:35 2006
+++ modules/gerd/evaluate.pl	Mon Apr 10 21:12:39 2006
@@ -200,33 +200,33 @@
     $mpexave[$number]=int(100*$mpexave[$number]+0.5)/100;
 }
 
-print "\nGrade/Solution: ".&hashcorrelate(\%grade,'',\%solution,'',\@userkeys,'',0.01);
-print "\nGrade/Math: ".&hashcorrelate(\%grade,'',\%math,'',\@userkeys,'',0.01);
-print "\nGrade/Physics: ".&hashcorrelate(\%grade,'',\%physics,'',\@userkeys,'',0.01);
-print "\nGrade/Surface: ".&hashcorrelate(\%grade,'',\%surface,'',\@userkeys,'',0.01);
-print "\nGrade/Procedural: ".&hashcorrelate(\%grade,'',\%procedural,'',\@userkeys,'',0.01);
-print "\nGrade/Conceptual: ".&hashcorrelate(\%grade,'',\%conceptual,'',\@userkeys,'',0.01);
-
-print "\nFCIFinal/Solution: ".&hashcorrelate(\%fcipost,'',\%solution,'',\@userkeys,'',0.01);
-print "\nFCIFinal/Math: ".&hashcorrelate(\%fcipost,'',\%math,'',\@userkeys,'',0.01);
-print "\nFCIFinal/Physics: ".&hashcorrelate(\%fcipost,'',\%physics,'',\@userkeys,'',0.01);
-print "\nFCIFinal/Surface: ".&hashcorrelate(\%fcipost,'',\%surface,'',\@userkeys,'',0.01);
-print "\nFCIFinal/Procedural: ".&hashcorrelate(\%fcipost,'',\%procedural,'',\@userkeys,'',0.01);
-print "\nFCIFinal/Conceptual: ".&hashcorrelate(\%fcipost,'',\%conceptual,'',\@userkeys,'',0.01);
-
-print "\nFCIg/Solution: ".&hashcorrelate(\%fcigain,'',\%solution,'',\@userkeys,'',0.01);
-print "\nFCIg/Math: ".&hashcorrelate(\%fcigain,'',\%math,'',\@userkeys,'',0.01);
-print "\nFCIg/Physics: ".&hashcorrelate(\%fcigain,'',\%physics,'',\@userkeys,'',0.01);
-print "\nFCIg/Surface: ".&hashcorrelate(\%fcigain,'',\%surface,'',\@userkeys,'',0.01);
-print "\nFCIg/Procedural: ".&hashcorrelate(\%fcigain,'',\%procedural,'',\@userkeys,'',0.01);
-print "\nFCIg/Conceptual: ".&hashcorrelate(\%fcigain,'',\%conceptual,'',\@userkeys,'',0.01);
+print "\nGrade/Solution: ".&hashcorrelate(\%grade,'',\%solution,'',\@userkeys,'',0.01,100);
+print "\nGrade/Math: ".&hashcorrelate(\%grade,'',\%math,'',\@userkeys,'',0.01,100);
+print "\nGrade/Physics: ".&hashcorrelate(\%grade,'',\%physics,'',\@userkeys,'',0.01,100);
+print "\nGrade/Surface: ".&hashcorrelate(\%grade,'',\%surface,'',\@userkeys,'',0.01,100);
+print "\nGrade/Procedural: ".&hashcorrelate(\%grade,'',\%procedural,'',\@userkeys,'',0.01,100);
+print "\nGrade/Conceptual: ".&hashcorrelate(\%grade,'',\%conceptual,'',\@userkeys,'',0.01,100);
+
+print "\nFCIFinal/Solution: ".&hashcorrelate(\%fcipost,'',\%solution,'',\@userkeys,'',0.01,100);
+print "\nFCIFinal/Math: ".&hashcorrelate(\%fcipost,'',\%math,'',\@userkeys,'',0.01,100);
+print "\nFCIFinal/Physics: ".&hashcorrelate(\%fcipost,'',\%physics,'',\@userkeys,'',0.01,100);
+print "\nFCIFinal/Surface: ".&hashcorrelate(\%fcipost,'',\%surface,'',\@userkeys,'',0.01,100);
+print "\nFCIFinal/Procedural: ".&hashcorrelate(\%fcipost,'',\%procedural,'',\@userkeys,'',0.01,100);
+print "\nFCIFinal/Conceptual: ".&hashcorrelate(\%fcipost,'',\%conceptual,'',\@userkeys,'',0.01,100);
+
+print "\nFCIg/Solution: ".&hashcorrelate(\%fcigain,'',\%solution,'',\@userkeys,'',0.01,100);
+print "\nFCIg/Math: ".&hashcorrelate(\%fcigain,'',\%math,'',\@userkeys,'',0.01,100);
+print "\nFCIg/Physics: ".&hashcorrelate(\%fcigain,'',\%physics,'',\@userkeys,'',0.01,100);
+print "\nFCIg/Surface: ".&hashcorrelate(\%fcigain,'',\%surface,'',\@userkeys,'',0.01,100);
+print "\nFCIg/Procedural: ".&hashcorrelate(\%fcigain,'',\%procedural,'',\@userkeys,'',0.01,100);
+print "\nFCIg/Conceptual: ".&hashcorrelate(\%fcigain,'',\%conceptual,'',\@userkeys,'',0.01,100);
 
 foreach my $number (1..8) {
     foreach my $char ('a'..'d') {
 	print "\n$number$char: ".
-	    &hashcorrelate(\%grade,'',\%discussion,$number.$char,\@userkeys,'Grade',0.01).
-	    &hashcorrelate(\%fcipost,'',\%discussion,$number.$char,\@userkeys,'FCIFinal',0.01).
-	    &hashcorrelate(\%fcigain,'',\%discussion,$number.$char,\@userkeys,'FCIg',0.01);
+	    &hashcorrelate(\%grade,'',\%discussion,$number.$char,\@userkeys,'Grade',0.01,100).
+	    &hashcorrelate(\%fcipost,'',\%discussion,$number.$char,\@userkeys,'FCIFinal',0.01,100).
+	    &hashcorrelate(\%fcigain,'',\%discussion,$number.$char,\@userkeys,'FCIg',0.01,100);
     }
 }
 
@@ -276,14 +276,15 @@
 # Calculate correlation between two hashes
 #
 sub hashcorrelate {
-   my ($array1,$arrayidx1,$array2,$arrayidx2,$userkeys,$label,$threshold)=@_;
-   unless ($threshold) { $threshold=0.29; }
+   my ($array1,$arrayidx1,$array2,$arrayidx2,$userkeys,$label,$threshold,$round)=@_;
+   unless ($round) { $round=10; }
+   unless ($threshold) { $threshold=0.25; }
    my ($c,$n)=&correlation(&buildarrays($array1,$arrayidx1,$array2,$arrayidx2,$userkeys));
    unless (abs($c)>$threshold) { return ('',''); }
    if ($c>0) {
-      $c=int($c*100+0.5)/100;
+      $c=int($c*$round+0.5)/$round;
    } else {
-      $c=int($c*100-0.5)/100;
+      $c=int($c*$round-0.5)/$round;
    }
    return " $label: $c ($n)";
 }