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

www www at source.lon-capa.org
Mon Sep 17 13:59:18 EDT 2012


www		Mon Sep 17 17:59:18 2012 EDT

  Modified files:              
    /modules/gerd/harvesting	dodiff.pl 
  Log:
  Seems to work
  
  
Index: modules/gerd/harvesting/dodiff.pl
diff -u modules/gerd/harvesting/dodiff.pl:1.2 modules/gerd/harvesting/dodiff.pl:1.3
--- modules/gerd/harvesting/dodiff.pl:1.2	Mon Sep 17 14:09:27 2012
+++ modules/gerd/harvesting/dodiff.pl	Mon Sep 17 17:59:18 2012
@@ -23,6 +23,8 @@
 my %problem_correct=();
 my %is_student_in_folder=();
 my %student_folder_score=();
+my %number_problems_folder=();
+
 # my $i=0;
 open(IN,'graphtrans.dat');
 while (my $line=<IN>) {
@@ -38,6 +40,9 @@
    my $problemid=$folderid.':'.$id.':'.$url.':'.$part;
    my $studentproblemid=$problemid.':'.$uname.':'.$udom;
    my $studentfolderid=$folderid.':'.$uname.':'.$udom;
+   unless ($is_folder{$problemid}) {
+      $number_problems_folder{$folderid}++;
+   }
    $is_folder{$problemid}=$folder;
    $is_folderid{$problemid}=$folderid;
    $is_id{$problemid}=$id;
@@ -56,9 +61,6 @@
    if ($state=~/scantron/) {
       $is_exam{$problemid}=1;
    }
-   if ($resids{$url}) {
- #     $count{$folderid}=1;
-   }
 }
 close(IN);
 # Who all worked on a folder?
@@ -86,16 +88,43 @@
 #         "\n".$bottom{$key}."\n";
 }
 
-exit;
 
-print "URL\tPart\tCourse\tFolder\tID\tExam?\tNumber tried folder\tNumber tried problem\tNumber problem correct\tTotal tries till problem correct\n";
+print "URL\tPart\tCourse\tFolder\tID\tExam?\tNumber problems in folder\tNumber students tried folder\tNumber students tried problem\tNumber students problem correct\tTotal tries till problem correct\tDoDiff\tTop Sum\tBottom Sum\tDoDisc\n";
 foreach my $key (keys(%num_tried)) {
+   unless ($resids{$is_url{$key}}) { next; }
+   my $topsum=0;
+   foreach my $student (split(/\,/,$top{$is_folderid{$key}})) {
+      my $studentproblemid=$key.':'.$student;
+      if ($problem_correct{$studentproblemid}) { $topsum++; }
+   }
+   my $bottomsum=0;
+   foreach my $student (split(/\,/,$bottom{$is_folderid{$key}})) {
+      my $studentproblemid=$key.':'.$student;
+      if ($problem_correct{$studentproblemid}) { $bottomsum++; }
+   }
+   my $dodiff='';
+   if ($sum_cor_tries{$key}>0) {
+      $dodiff=1.-$num_correct{$key}/$sum_cor_tries{$key};
+   }
+   my $dodisc='';
+   if ($folder_totals{$is_folderid{$key}}>0) {
+      $dodisc=4.*($topsum-$bottomsum)/$folder_totals{$is_folderid{$key}};
+   }
    print $is_url{$key}."\t".
          $is_part{$key}."\t".
          $is_course{$key}."\t".
          $is_folder{$key}."\t".
          $is_id{$key}."\t".
          ($is_exam{$key}?'exam':'hwk')."\t".
+         $number_problems_folder{$is_folderid{$key}}."\t".
          $folder_totals{$is_folderid{$key}}."\t".
-         $num_tried{$key}."\t".$num_correct{$key}."\t".$sum_cor_tries{$key}."\n";
+         $num_tried{$key}."\t".$num_correct{$key}."\t".$sum_cor_tries{$key}."\t".
+         $dodiff."\t".$topsum."\t".$bottomsum."\t".$dodisc."\n";
+   if (($dodisc>1) || ($dodisc<-1)) {
+      print "\nEmergency stop discrimination: $dodisc $topsum $bottomsum\n";
+      exit;
+   }
+   if ($dodiff<0) {
+      print "\nEmergency stop difficulty: $dodiff\n";
+   }
 }




More information about the LON-CAPA-cvs mailing list