Diff for /loncom/interface/statistics/lonproblemstatistics.pm between versions 1.107 and 1.113

version 1.107, 2006/05/01 19:29:13 version 1.113, 2008/09/11 14:47:22
Line 60  use Apache::lonlocal; Line 60  use Apache::lonlocal;
 use Spreadsheet::WriteExcel;  use Spreadsheet::WriteExcel;
 use Apache::lonstathelpers();  use Apache::lonstathelpers();
 use Time::HiRes;  use Time::HiRes;
   use LONCAPA;
    
   
 my @StatsArray;  my @StatsArray;
 my %SeqStat;    # keys are symbs, values are hash refs  my %SeqStat;    # keys are symbs, values are hash refs
Line 613  sub CreateInterface { Line 615  sub CreateInterface {
     $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>';
     $Str .= '<td align="center"><b>'.&mt('Enrollment Status').'</b></td>';      $Str .= '<td align="center"><b>'.&mt('Groups').'</b></td>';
       $Str .= '<td align="center"><b>'.&mt('Access Status').'</b></td>';
     $Str .= '<td align="center"><b>'.&mt('Sequences and Folders').'</b></td>';      $Str .= '<td align="center"><b>'.&mt('Sequences and Folders').'</b></td>';
     $Str .= '<td align="center"><b>'.&mt('Statistics').'</b></td>';      $Str .= '<td align="center"><b>'.&mt('Statistics').'</b></td>';
     $Str .= '<td rowspan="2">'.      $Str .= '<td rowspan="2">'.
Line 623  sub CreateInterface { Line 626  sub CreateInterface {
     $Str .= '<tr><td align="center">'."\n";      $Str .= '<tr><td align="center">'."\n";
     $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);      $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);
     $Str .= '</td><td align="center">';      $Str .= '</td><td align="center">';
       $Str .= &Apache::lonstatistics::GroupSelect('Group','multiple',5);
       $Str .= '</td><td align="center">';
     $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);      $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);
     $Str .= '</td><td align="center">';      $Str .= '</td><td align="center">';
     #      #
Line 674  sub BuildProblemStatisticsPage { Line 679  sub BuildProblemStatisticsPage {
     my %Saveable_Parameters = ('Status' => 'scalar',      my %Saveable_Parameters = ('Status' => 'scalar',
                                'statsoutputmode' => 'scalar',                                 'statsoutputmode' => 'scalar',
                                'Section' => 'array',                                 'Section' => 'array',
                                  'Groups' => 'array',
                                'StudentData' => 'array',                                 'StudentData' => 'array',
                                'Maps' => 'array',                                 'Maps' => 'array',
                                'fieldselections'=> 'array');                                 'fieldselections'=> 'array');
Line 708  sub BuildProblemStatisticsPage { Line 714  sub BuildProblemStatisticsPage {
                   '</h3><p>'.                    '</h3><p>'.
                   &mt('It may take some time to update the student data '.                    &mt('It may take some time to update the student data '.
                       'for the first analysis.  Future analysis this session '.                        'for the first analysis.  Future analysis this session '.
                       ' will not have this delay.').                        'will not have this delay.').
                   '</p>');                    '</p>');
  &clean_up();   &clean_up();
         return;          return;
Line 722  sub BuildProblemStatisticsPage { Line 728  sub BuildProblemStatisticsPage {
     ($navmap,@sequences) =       ($navmap,@sequences) = 
         &Apache::lonstatistics::selected_sequences_with_assessments();          &Apache::lonstatistics::selected_sequences_with_assessments();
     if (! ref($navmap)) {      if (! ref($navmap)) {
         $r->print('<h1>'.&mt('A course-wide error occured.').'</h1>'.          $r->print('<h1>'.&mt('A course-wide error occurred.').'</h1>'.
                   '<h3>'.$navmap.'</h3>');                    '<h3>'.$navmap.'</h3>');
  &clean_up();   &clean_up();
         return;          return;
Line 1310  sub Excel_output { Line 1316  sub Excel_output {
                         &Apache::lonstatistics::section_and_enrollment_description('plaintext'),                          &Apache::lonstatistics::section_and_enrollment_description('plaintext'),
                         $format->{'h3'});                          $format->{'h3'});
     $cols_output += scalar(&Apache::lonstatistics::get_selected_sections());      $cols_output += scalar(&Apache::lonstatistics::get_selected_sections());
       $cols_output += scalar(&Apache::lonstatistics::get_selected_groups());
     #      #
     # Time restrictions      # Time restrictions
     my $time_string;      my $time_string;
Line 1551  sub get_statistics { Line 1558  sub get_statistics {
     #      #
     my $data = &Apache::loncoursedata::get_problem_statistics      my $data = &Apache::loncoursedata::get_problem_statistics
                         ([&Apache::lonstatistics::get_selected_sections()],                          ([&Apache::lonstatistics::get_selected_sections()],
                            [&Apache::lonstatistics::get_selected_groups()],
                          $Apache::lonstatistics::enrollment_status,                           $Apache::lonstatistics::enrollment_status,
                          $symb,$part,$courseid,$starttime,$endtime);                           $symb,$part,$courseid,$starttime,$endtime);
     $data->{'symb'}        = $symb;      $data->{'symb'}        = $symb;
Line 1559  sub get_statistics { Line 1567  sub get_statistics {
     $data->{'container'}   = $sequence->compTitle;      $data->{'container'}   = $sequence->compTitle;
     $data->{'title'}       = $resource->compTitle;      $data->{'title'}       = $resource->compTitle;
     $data->{'title.link'}  = $resource->src.'?symb='.      $data->{'title.link'}  = $resource->src.'?symb='.
         &Apache::lonnet::escape($resource->symb);          &escape($resource->symb);
     #      #
     if ($SelectedFields{'deg_of_disc'}) {      if ($SelectedFields{'deg_of_disc'}) {
         $data->{'deg_of_disc'} =           $data->{'deg_of_disc'} = 
Line 1577  sub get_statistics { Line 1585  sub get_statistics {
         $data->{'urlres'}=$urlres;          $data->{'urlres'}=$urlres;
         my %storestats =           my %storestats = 
             &LONCAPA::lonmetadata::dynamic_metadata_storage($data);              &LONCAPA::lonmetadata::dynamic_metadata_storage($data);
         my ($dom,$user) = $urlres=~/^(\w+)\/(\w+)/;           my ($dom,$user) = ($urlres=~m{^($LONCAPA::domain_re)/($LONCAPA::username_re)}); 
         &Apache::lonnet::put('nohist_resevaldata',\%storestats,$dom,$user);          &Apache::lonnet::put('nohist_resevaldata',\%storestats,$dom,$user);
     }      }
     #      #
Line 1585  sub get_statistics { Line 1593  sub get_statistics {
         ($data->{'num_solved'}+0.1);          ($data->{'num_solved'}+0.1);
     #      #
     # Get the due date for research purposes (commented out most of the time)      # Get the due date for research purposes (commented out most of the time)
 #    $data->{'duedate'} =   #    my $duedate = &Apache::lonnet::EXT('resource.'.$part.'.duedate',$symb);;
 #        &Apache::lonnet::EXT('resource.'.$part.'.duedate',$symb);  #    my $opendate = &Apache::lonnet::EXT('resource.'.$part.'.opendate',$symb);
 #    $data->{'opendate'} =   #    my $maxtries = &Apache::lonnet::EXT('resource.'.$part.'.maxtries',$symb);
 #        &Apache::lonnet::EXT('resource.'.$part.'.opendate',$symb);  #    my $hinttries = &Apache::lonnet::EXT('resource.'.$part.'.hinttries',$symb);
 #    $data->{'maxtries'} =       my $weight = &Apache::lonnet::EXT('resource.'.$part.'.weight',$symb);
 #        &Apache::lonnet::EXT('resource.'.$part.'.maxtries',$symb);      $data->{'weight'} = $weight;
 #    $data->{'hinttries'} =  #    $data->{'duedate'} = $duedate; 
 #        &Apache::lonnet::EXT('resource.'.$part.'.hinttries',$symb);  #    $data->{'opendate'} = $opendate;
     $data->{'weight'} =  #    $data->{'maxtries'} = $maxtries;
         &Apache::lonnet::EXT('resource.'.$part.'.weight',$symb);  #    $data->{'hinttries'} = $hinttries;
 #    $data->{'resptypes'} = join(',',@{$resource->{'partdata'}->{$part}->{'ResponseTypes'}});  #    $data->{'resptypes'} = join(',',@{$resource->{'partdata'}->{$part}->{'ResponseTypes'}});
     return $data;      return $data;
 }  }
Line 1629  sub compute_discrimination_factor { Line 1637  sub compute_discrimination_factor {
         &Apache::loncoursedata::rank_students_by_scores_on_resources          &Apache::loncoursedata::rank_students_by_scores_on_resources
         (\@Resources,          (\@Resources,
          [&Apache::lonstatistics::get_selected_sections()],           [&Apache::lonstatistics::get_selected_sections()],
            [&Apache::lonstatistics::get_selected_groups()],
          $Apache::lonstatistics::enrollment_status,undef,           $Apache::lonstatistics::enrollment_status,undef,
          $starttime,$endtime, $symb);           $starttime,$endtime, $symb);
     #      #
Line 1694  sub compute_sequence_statistics { Line 1703  sub compute_sequence_statistics {
     my ($smin,$smax,$sMean,$sSTD,$scount,$sMAX) =       my ($smin,$smax,$sMean,$sSTD,$scount,$sMAX) = 
         &Apache::loncoursedata::score_stats          &Apache::loncoursedata::score_stats
                     ([&Apache::lonstatistics::get_selected_sections()],                      ([&Apache::lonstatistics::get_selected_sections()],
                        [&Apache::lonstatistics::get_selected_groups()],
                      $Apache::lonstatistics::enrollment_status,                       $Apache::lonstatistics::enrollment_status,
                      \@Resources,$starttime,$endtime,undef);                       \@Resources,$starttime,$endtime,undef);
     $SeqStat{$symb}->{'title'}  = $seq->compTitle;      $SeqStat{$symb}->{'title'}  = $seq->compTitle;
Line 1709  sub compute_sequence_statistics { Line 1719  sub compute_sequence_statistics {
     my ($cmin,$cmax,$cMean,$cSTD,$ccount)=      my ($cmin,$cmax,$cMean,$cSTD,$ccount)=
         &Apache::loncoursedata::count_stats          &Apache::loncoursedata::count_stats
         ([&Apache::lonstatistics::get_selected_sections()],          ([&Apache::lonstatistics::get_selected_sections()],
            [&Apache::lonstatistics::get_selected_groups()],
          $Apache::lonstatistics::enrollment_status,           $Apache::lonstatistics::enrollment_status,
          \@Resources,$starttime,$endtime,undef);           \@Resources,$starttime,$endtime,undef);
     my $K = $part_count;      my $K = $part_count;

Removed from v.1.107  
changed lines
  Added in v.1.113


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