[LON-CAPA-cvs] cvs: modules /gerd/discussions eval.pl
www
lon-capa-cvs@mail.lon-capa.org
Sat, 26 Mar 2005 21:52:18 -0000
www Sat Mar 26 16:52:18 2005 EDT
Modified files:
/modules/gerd/discussions eval.pl
Log:
More eval
Index: modules/gerd/discussions/eval.pl
diff -u modules/gerd/discussions/eval.pl:1.2 modules/gerd/discussions/eval.pl:1.3
--- modules/gerd/discussions/eval.pl:1.2 Sat Mar 26 13:06:26 2005
+++ modules/gerd/discussions/eval.pl Sat Mar 26 16:52:18 2005
@@ -62,5 +62,120 @@
print ','.$disctypes{$i.$_};
}
}
+#
+# Analysis
+#
+# Difficulty versus type
+my @difficultycount=();
+my %typebydiff=();
+my %typecount=();
+my %typebytype=();
+foreach (@q) {
+ my @entries=split(/\,/,$_);
+ my $diffidx=int($entries[$diff]*10);
+ my $thistype=$entries[$type];
+ my $allcount=&allcount(@entries);
+ my $procedural=&procedural(@entries);
+ my $concept=&concept(@entries);
+ my $physics=&physics(@entries);
+ my $emotion=&emotion(@entries);
+ $difficultycount[$diffidx]+=$allcount;
+ $typebydiff{$diffidx.'_procedural'}+=$procedural;
+ $typebydiff{$diffidx.'_concept'}+=$concept;
+ $typebydiff{$diffidx.'_physics'}+=$physics;
+ $typebydiff{$diffidx.'_emotion'}+=$emotion;
+ $typecount{$thistype}+=$allcount;
+ $typebytype{$thistype.'_procedural'}+=$procedural;
+ $typebytype{$thistype.'_concept'}+=$concept;
+ $typebytype{$thistype.'_physics'}+=$physics;
+ $typebytype{$thistype.'_emotion'}+=$emotion;
+}
+
+print "\n==== Difficulty";
+for (my $i=0;$i<=9;$i++) {
+ print "\n$i,$difficultycount[$i],".
+ &twodec($typebydiff{$i.'_procedural'},$difficultycount[$i]).",".
+ &twodec($typebydiff{$i.'_concept'},$difficultycount[$i]).",".
+ &twodec($typebydiff{$i.'_physics'},$difficultycount[$i]).",".
+ &twodec($typebydiff{$i.'_emotion'},$difficultycount[$i]);
+}
+print "\n==== By Type";
+for (my $i=1;$i<=7;$i++) {
+ print "\n$i"."a,".$typecount{$i.'a'}.",".
+ &twodec($typebytype{$i.'a_procedural'},$typecount{$i.'a'}).",".
+ &twodec($typebytype{$i.'a_concept'},$typecount{$i.'a'}).",".
+ &twodec($typebytype{$i.'a_physics'},$typecount{$i.'a'}).",".
+ &twodec($typebytype{$i.'a_emotion'},$typecount{$i.'a'});
+ print "\n$i"."b,".$typecount{$i.'b'}.",".
+ &twodec($typebytype{$i.'b_procedural'},$typecount{$i.'b'}).",".
+ &twodec($typebytype{$i.'b_concept'},$typecount{$i.'b'}).",".
+ &twodec($typebytype{$i.'b_physics'},$typecount{$i.'b'}).",".
+ &twodec($typebytype{$i.'b_emotion'},$typecount{$i.'b'});
+}
+print "\n";
+
+sub twodec {
+ my ($val,$count)=@_;
+ unless ($count) { return ''; }
+ return int($val/$count*100+0.5);
+}
+
+sub allcount {
+ my @entries=@_;
+ my $sum=0;
+ for (my $i=3;$i<=34;$i++) {
+ $sum+=$entries[$i];
+ }
+ return $sum;
+}
+
+sub procedural {
+ my @entries=@_;
+ return $entries[$disc{'5a'}]
+ +$entries[$disc{'5b'}]
+ +$entries[$disc{'5c'}]
+ +$entries[$disc{'5d'}]
+ +$entries[$disc{'6a'}]
+ +$entries[$disc{'6b'}]
+ +$entries[$disc{'6c'}]
+ +$entries[$disc{'6d'}];
+}
+
+
+sub concept {
+ my @entries=@_;
+ return $entries[$disc{'7a'}]
+ +$entries[$disc{'7b'}]
+ +$entries[$disc{'7c'}]
+ +$entries[$disc{'7d'}]
+ +$entries[$disc{'8a'}]
+ +$entries[$disc{'8b'}]
+ +$entries[$disc{'8c'}]
+ +$entries[$disc{'8d'}];
+}
+
+sub physics {
+ my @entries=@_;
+ return
+ $entries[$disc{'3d'}]
+ +$entries[$disc{'4d'}]
+ +$entries[$disc{'5d'}]
+ +$entries[$disc{'6d'}]
+ +$entries[$disc{'7d'}]
+ +$entries[$disc{'8d'}];
+}
+
+sub emotion {
+ my @entries=@_;
+ return
+ $entries[$disc{'1b'}]
+ +$entries[$disc{'1c'}]
+ +$entries[$disc{'1d'}]
+ -$entries[$disc{'2b'}]
+ -$entries[$disc{'2c'}]
+ -$entries[$disc{'2d'}];
+}
+
+
+
-