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

www www at source.lon-capa.org
Mon Sep 17 10:09:27 EDT 2012


www		Mon Sep 17 14:09:27 2012 EDT

  Modified files:              
    /modules/gerd/harvesting	dodiff.pl 
  Log:
  Find upper and lower quartile for a folder
  
  
Index: modules/gerd/harvesting/dodiff.pl
diff -u modules/gerd/harvesting/dodiff.pl:1.1 modules/gerd/harvesting/dodiff.pl:1.2
--- modules/gerd/harvesting/dodiff.pl:1.1	Sun Sep 16 21:00:14 2012
+++ modules/gerd/harvesting/dodiff.pl	Mon Sep 17 14:09:27 2012
@@ -61,12 +61,33 @@
    }
 }
 close(IN);
+# Who all worked on a folder?
 my %folder_totals=();
 my %students_who_did_folder=();
 foreach my $key (keys(%worked_folder)) {
    $folder_totals{$worked_folder{$key}}++;
    $students_who_did_folder{$worked_folder{$key}}.=','.$is_student_in_folder{$key};
 }
+# Find best and worst scoring students
+my %top=();
+my %bottom=();
+foreach my $key (keys(%students_who_did_folder)) {
+   if ($folder_totals{$key}<4) { next; }
+   $students_who_did_folder{$key}=~s/^\,//;
+   my @entries=split(/\,/,$students_who_did_folder{$key});
+   my @sorted=sort{ $student_folder_score{$key.':'.$a} <=> $student_folder_score{$key.':'.$b} } @entries;
+   my $quartile=int(($#sorted+1.)/4.);
+   $top{$key}=join(',', at sorted[$#sorted-$quartile+1..$#sorted]);
+   $bottom{$key}=join(',', at sorted[0..$quartile-1]);
+
+#   print "\n-------> ".$#sorted." -->".$quartile.
+#         "\n->".join(',', at sorted).
+#         "\n".$top{$key}.
+#         "\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";
 foreach my $key (keys(%num_tried)) {
    print $is_url{$key}."\t".




More information about the LON-CAPA-cvs mailing list