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

www lon-capa-cvs@mail.lon-capa.org
Sat, 26 Mar 2005 16:23:08 -0000


www		Sat Mar 26 11:23:08 2005 EDT

  Added files:                 
    /modules/gerd/discussions	eval.pl 

  Modified files:              
    /modules/gerd/discussions/raw	lbs271.csv 
  Log:
  Discussion analysis
  
  
Index: modules/gerd/discussions/raw/lbs271.csv
diff -u modules/gerd/discussions/raw/lbs271.csv:1.2 modules/gerd/discussions/raw/lbs271.csv:1.3
--- modules/gerd/discussions/raw/lbs271.csv:1.2	Sat Mar 26 10:40:37 2005
+++ modules/gerd/discussions/raw/lbs271.csv	Sat Mar 26 11:23:08 2005
@@ -223,7 +223,7 @@
 Sound,Horn at various speeds,11,206,976,14,1,4.7379,3.4919,184,0,22,10.6,0.81147541,0.307299843,5b,3b1b3b3b5b8d7d3b3b3b3b5d6b3b7b3b4b6b3b8d3b6d
 Sound,Horn at various speeds,13,195,434,15,1,2.2256,2.205,188,0,7,3.5,0.566820276,0.112348178,,
 Sound,Relative motion,0,203,638,11,1,3.1429,2.508,198,0,5,2.4,0.689655172,0.067725753,5a,2b2b2b7d2b3b3b4b1b3b4b7d4b
-Sound,Temperature,0,205,229,8,1,1.1171,0.5725,205,0,0,0,0.104803493,0,2a,6b1b1b2a
+Sound,Temperature,0,205,229,8,1,1.1171,0.5725,205,0,0,0,0.104803493,0,3a,6b1b1b2a
 In-Class Discussions,Sandbox 09/01/04,0,204,0,0,0,0,0,0,204,204,100,nan,0,,
 In-Class Discussions,Ball 09/08/04,0,209,0,0,0,0,0,0,209,209,100,nan,0,,
 In-Class Discussions,Position versus Time 09/10/04,0,181,0,0,0,0,0,0,181,181,100,nan,0,,

Index: modules/gerd/discussions/eval.pl
+++ modules/gerd/discussions/eval.pl
use strict;
my @q=();
# index into the array
my $course=0;
my $type=1;
my $diff=2;
my %disc=();
for (my $i=1; $i<=8; $i++) {
    $disc{$i.'a'}=2+$i;
    $disc{$i.'b'}=10+$i;
    $disc{$i.'c'}=18+$i;
    $disc{$i.'d'}=26+$i;
}
# read file
foreach my $class ('lbs271') {
    print "\nReading $class";
    open(IN,'raw/'.$class.'.csv');
    my $num=0;
    while (my $line=<IN>) {
	$line=~s/\s+$//;
        my @entries=split(/\,/,$line);
        if ($entries[15]!~/^\d[a-d]$/) { next; }
        if ($entries[16]) {
	    unless ($entries[16]=~/^(\d[a-d])+$/) {
                print "\nError $class: $entries[16]\n";
	    }
	}
        $num++;
        my @newentry=($class,$entries[15],$entries[13]);
        for (my $i=3;$i<=34;$i++) { $newentry[$i]=0; }
        for (my $i=0;$i<length($entries[16]);$i+=2) {
	    $newentry[$disc{substr($entries[16],$i,2)}]++;
	}
        push @q,join(',',@newentry);
        print "\n$q[$#q]";
    }
    close(IN);
    print "\n$class: $num entries\n";
}