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

www lon-capa-cvs@mail.lon-capa.org
Thu, 31 Mar 2005 18:50:04 -0000


www		Thu Mar 31 13:50:04 2005 EDT

  Modified files:              
    /modules/gerd/discussions	eval.pl 
  Log:
  Control for "chat"
  
  
Index: modules/gerd/discussions/eval.pl
diff -u modules/gerd/discussions/eval.pl:1.9 modules/gerd/discussions/eval.pl:1.10
--- modules/gerd/discussions/eval.pl:1.9	Thu Mar 31 12:50:56 2005
+++ modules/gerd/discussions/eval.pl	Thu Mar 31 13:50:03 2005
@@ -121,6 +121,7 @@
 	my $diffidx=int($entries[$diff]*10+0.5);
 	&callsums('emotion&diff'.$diffidx,$error,@entries);
 	&callsums('procedural&diff'.$diffidx,$error,@entries);
+	&callsums('solution&diff'.$diffidx,$error,@entries);
 	&callsums('physics&diff'.$diffidx,$error,@entries);
 	&callsums('conceptual&diff'.$diffidx,$error,@entries);
 # question type
@@ -158,18 +159,19 @@
 # Output
 #
 print "\n\n==== Difficulty\n".&padded();
-foreach ('emot','','proc','','phys','','conc','') {
+foreach ('emot','','','','proc','','','','solu','','','','phys','','','','conc','','','') {
     print ','.&padded($_);
 }
 for (my $i=0;$i<=10;$i++) {
     print "\n".&padded($i).','.
                       &reportout('emotion&diff'.$i).',',
                       &reportout('procedural&diff'.$i).',',
+                      &reportout('solution&diff'.$i).',',
                       &reportout('physics&diff'.$i).',',
                       &reportout('conceptual&diff'.$i);
 }
 print "\n\n==== Questiontype\n".&padded();
-foreach ('emot','','proc','','solu','','math','','phys','','conc','') {
+foreach ('emot','','','','proc','','','','solu','','','','math','','','','phys','','','','conc','','','') {
     print ','.&padded($_);
 }
 for (my $i=1;$i<=7;$i++) {
@@ -193,7 +195,7 @@
 }
 
 print "\n\n==== Course\n".&padded();
-foreach ('emot','','chat','','proc','','solu','','math','','phys','','conc','') {
+foreach ('emot','','','','chat','','','','proc','','','','solu','','','','math','','','','phys','','','','conc','','','') {
     print ','.&padded($_);
 }
 foreach my $i ('phy231','lbs271','lbs272') {
@@ -231,6 +233,10 @@
    my $num=&$routine(@entries);
    use strict 'refs';
    $statsum{$which}+=$num/$entries[$sumall];
+   if ($entries[$sumall]-&chat(@entries)) {
+       $statn{$which.'&nochat'}++;
+       $statsum{$which.'&nochat'}+=$num/($entries[$sumall]-&chat(@entries));
+   }
 }
 
 sub meansumsquared {
@@ -242,10 +248,18 @@
    my $num=&$routine(@entries);
    use strict 'refs';
    $statsumsquare{$which}+=($num/$entries[$sumall]-$statsum{$which}/$statn{$which})**2;
+   if ($entries[$sumall]-&chat(@entries)) {
+       $statsumsquare{$which.'&nochat'}+=($num/($entries[$sumall]-&chat(@entries))-$statsum{$which.'&nochat'}/$statn{$which.'&nochat'})**2;
+   }
 }
 
 sub reportout {
    my $which=shift;
+   return &reportoutinner($which).','.&reportoutinner($which.'&nochat');
+}
+
+sub reportoutinner {
+   my $which=shift;
    my $value='';
    if ($statn{$which}>0) {
        $value=&percent($statsum{$which}/$statn{$which});