Diff for /loncom/interface/statistics/lonproblemanalysis.pm between versions 1.121 and 1.126

version 1.121, 2005/04/19 13:59:34 version 1.126, 2006/05/30 12:46:49
Line 38  use Apache::lonstudentsubmissions(); Line 38  use Apache::lonstudentsubmissions();
 use HTML::Entities();  use HTML::Entities();
 use Time::Local();  use Time::Local();
 use capa;  use capa;
   use lib '/home/httpd/lib/perl/';
   use LONCAPA;
     
   
 my $plotcolors = ['#33ff00',   my $plotcolors = ['#33ff00', 
                   '#0033cc', '#990000', '#aaaa66', '#663399', '#ff9933',                    '#0033cc', '#990000', '#aaaa66', '#663399', '#ff9933',
Line 97  sub BuildProblemAnalysisPage { Line 100  sub BuildProblemAnalysisPage {
             $r->print($html.(' 'x5));              $r->print($html.(' 'x5));
         }          }
         #          #
         $r->print(&Apache::lonstathelpers::submission_report_form  
                                                       ('problem_analysis'));          # This is commented out pending actual implementation of 
           # CSV and Excel output.
           #$r->print(&Apache::lonstathelpers::submission_report_form
           #                                              ('problem_analysis'));
         #          #
         $r->print('<hr />');          $r->print('<hr />');
         $r->rflush();          $r->rflush();
Line 341  sub numerical_plot_percent { Line 347  sub numerical_plot_percent {
     while (my ($ans,$submissions) = each(%$responses)) {      while (my ($ans,$submissions) = each(%$responses)) {
         while (my ($submission,$counts) = each(%$submissions)) {          while (my ($submission,$counts) = each(%$submissions)) {
             my ($correct_count,$incorrect_count) = @$counts;              my ($correct_count,$incorrect_count) = @$counts;
             my $scaled_value = 100*($submission-$ans)/abs($ans);      my $scaled_value = 
    ($ans) ? 100*($submission-$ans)/abs($ans)
          : 0;
             if ($scaled_value < $bins[0]) {              if ($scaled_value < $bins[0]) {
                 $bins[0]=$scaled_value -1;                  $bins[0]=$scaled_value -1;
             }              }
Line 396  sub numerical_plot_differences { Line 404  sub numerical_plot_differences {
     } elsif ($low_bin < 0 && $high_bin < -$low_bin) {      } elsif ($low_bin < 0 && $high_bin < -$low_bin) {
         $high_bin = -$low_bin;          $high_bin = -$low_bin;
     }      }
     if (($high_bin -$low_bin)/$min_bin_size * 2 > $max_bins) {      if (!$min_bin_size ||
           ($high_bin -$low_bin)/$min_bin_size * 2 > $max_bins) {
         $min_bin_size = abs($high_bin - $low_bin) / $max_bins * 2;          $min_bin_size = abs($high_bin - $low_bin) / $max_bins * 2;
     }      }
     my @bins;      my @bins;
Line 788  sub radio_response_analysis { Line 797  sub radio_response_analysis {
             my ($idx,@remainder) = split('&',$student->{'answer'});              my ($idx,@remainder) = split('&',$student->{'answer'});
             my ($answer) = ($remainder[$idx]=~/^(.*)=([^=]*)$/);              my ($answer) = ($remainder[$idx]=~/^(.*)=([^=]*)$/);
             $correct->{$student->{'username'}.':'.$student->{'domain'}}=              $correct->{$student->{'username'}.':'.$student->{'domain'}}=
                 &Apache::lonnet::unescape($answer);                  &unescape($answer);
         }          }
     } else {      } else {
         foreach my $foil (keys(%$foildata)) {          foreach my $foil (keys(%$foildata)) {
Line 1817  sub CreateInterface { Line 1826  sub CreateInterface {
     ##      ##
     ## Build the menu      ## Build the menu
     my $Str = '';      my $Str = '';
     $Str .= &Apache::lonhtmlcommon::breadcrumbs      $Str .= &Apache::lonhtmlcommon::breadcrumbs('Detailed Problem Analysis');
         (undef,'Detailed Problem Analysis');  
     $Str .= '<table cellspacing="5">'."\n";      $Str .= '<table cellspacing="5">'."\n";
     $Str .= '<tr>';      $Str .= '<tr>';
     $Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>';      $Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>';
Line 1923  sub hashify_attempt { Line 1931  sub hashify_attempt {
     my %attempt;      my %attempt;
     $attempt{'student'}    = $row->[&Apache::loncoursedata::RD_sname()];      $attempt{'student'}    = $row->[&Apache::loncoursedata::RD_sname()];
     $attempt{'tries'}      = $row->[&Apache::loncoursedata::RD_tries()];      $attempt{'tries'}      = $row->[&Apache::loncoursedata::RD_tries()];
     $attempt{'submission'} = &Apache::lonnet::unescape($row->[&Apache::loncoursedata::RD_submission()]);      $attempt{'submission'} = &unescape($row->[&Apache::loncoursedata::RD_submission()]);
     $attempt{'award'}      = $row->[&Apache::loncoursedata::RD_awarddetail()];      $attempt{'award'}      = $row->[&Apache::loncoursedata::RD_awarddetail()];
     $attempt{'timestamp'}  = $row->[&Apache::loncoursedata::RD_timestamp()];      $attempt{'timestamp'}  = $row->[&Apache::loncoursedata::RD_timestamp()];
     return %attempt;      return %attempt;
Line 1947  sub Process_OR_Row { Line 1955  sub Process_OR_Row {
     my @Foilsubs   = split('&',$submission);      my @Foilsubs   = split('&',$submission);
     for (my $j=0;$j<=$#Foilgrades;$j++) {      for (my $j=0;$j<=$#Foilgrades;$j++) {
         my ($foilid,$correct)  = split('=',$Foilgrades[$j]);          my ($foilid,$correct)  = split('=',$Foilgrades[$j]);
         $foilid = &Apache::lonnet::unescape($foilid);          $foilid = &unescape($foilid);
         my (undef,$submission) = split('=',$Foilsubs[$j]);          my (undef,$submission) = split('=',$Foilsubs[$j]);
         if ($correct) {          if ($correct) {
             $RowData{$foilid}->{'_correct'}++;              $RowData{$foilid}->{'_correct'}++;
         } else {          } else {
             $submission = &Apache::lonnet::unescape($submission);              $submission = &unescape($submission);
             $RowData{$foilid}->{$submission}++;              $RowData{$foilid}->{$submission}++;
         }          }
         $RowData{$foilid}->{'_total'}++;          $RowData{$foilid}->{'_total'}++;

Removed from v.1.121  
changed lines
  Added in v.1.126


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>