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

www www at source.lon-capa.org
Sun Sep 16 17:00:14 EDT 2012


www		Sun Sep 16 21:00:14 2012 EDT

  Added files:                 
    /modules/gerd/harvesting	dodiff.pl 
  Log:
  Difficulty and Discrimination from Processed Activity Logs
  
  

Index: modules/gerd/harvesting/dodiff.pl
+++ modules/gerd/harvesting/dodiff.pl
use strict;
my %resids=();
open(IN,'graphproblems.dat');
while (my $line=<IN>) {
   chomp($line);
   $line=~s/\s+$//gs;
   $line=~s/^\s+//gs;
   $resids{$line}=1;
}
close(IN);
my %is_url=();
my %is_course=();
my %is_folder=();
my %is_id=();
my %is_part=();
my %is_exam=();
my %is_folderid=();
my %num_tried=();
my %instance=();
my %num_correct=();
my %sum_cor_tries=();
my %worked_folder=();
my %problem_correct=();
my %is_student_in_folder=();
my %student_folder_score=();
# my $i=0;
open(IN,'graphtrans.dat');
while (my $line=<IN>) {
#   $i++;
#   if ($i>3000) { last; }
   chomp($line);
   my ($uname,$udom,
       $cnum,$cdom,
       $url,$part,$inst,
       $tries,$state,$timestamp)=split(/\t/,$line);
   my ($folder,$id)=($inst=~/^(.+)\_\_\_(.+)$/);
   my $folderid=$cnum.':'.$cdom.':'.$folder;
   my $problemid=$folderid.':'.$id.':'.$url.':'.$part;
   my $studentproblemid=$problemid.':'.$uname.':'.$udom;
   my $studentfolderid=$folderid.':'.$uname.':'.$udom;
   $is_folder{$problemid}=$folder;
   $is_folderid{$problemid}=$folderid;
   $is_id{$problemid}=$id;
   $is_url{$problemid}=$url;
   $is_part{$problemid}=$part;
   $is_course{$problemid}=$cnum.':'.$cdom;
   $num_tried{$problemid}++;
   $worked_folder{$studentfolderid}=$folderid;
   $is_student_in_folder{$studentfolderid}=$uname.':'.$udom;
   if ($state=~/^correct/i) {
      $num_correct{$problemid}++;
      $sum_cor_tries{$problemid}+=$tries;
      $student_folder_score{$studentfolderid}++;
      $problem_correct{$studentproblemid}=1;
   }
   if ($state=~/scantron/) {
      $is_exam{$problemid}=1;
   }
   if ($resids{$url}) {
 #     $count{$folderid}=1;
   }
}
close(IN);
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};
}
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".
         $is_part{$key}."\t".
         $is_course{$key}."\t".
         $is_folder{$key}."\t".
         $is_id{$key}."\t".
         ($is_exam{$key}?'exam':'hwk')."\t".
         $folder_totals{$is_folderid{$key}}."\t".
         $num_tried{$key}."\t".$num_correct{$key}."\t".$sum_cor_tries{$key}."\n";
}




More information about the LON-CAPA-cvs mailing list