Diff for /loncom/interface/statistics/lonproblemanalysis.pm between versions 1.11 and 1.14

version 1.11, 2002/11/22 03:46:57 version 1.14, 2002/11/25 18:02:49
Line 90  sub BuildAnalyzePage { Line 90  sub BuildAnalyzePage {
   
     # Remove students who don't have the proper section.      # Remove students who don't have the proper section.
     my @sectionsSelected = split(':',$cache{'sectionsSelected'});      my @sectionsSelected = split(':',$cache{'sectionsSelected'});
     for(my $studentIndex=((scalar @$students)-1); $studentIndex>=0;  
       my $studentCount = scalar @$students;
       for(my $studentIndex=$studentCount-1; $studentIndex>=0;
         $studentIndex--) {          $studentIndex--) {
         my $value = $cache{$students->[$studentIndex].':section'};          my $value = $cache{$students->[$studentIndex].':section'};
         my $found = 0;          my $found = 0;
Line 115  sub BuildAnalyzePage { Line 117  sub BuildAnalyzePage {
         $r->print('Can not untie hash.');          $r->print('Can not untie hash.');
         $r->rflush();          $r->rflush();
     }      }
       #if($status eq 'true')
       { &Apache::lonhtmlcommon::Close_PrgWin($r); }
   
     my $error =  
         &Apache::loncoursedata::DownloadStudentCourseDataSeparate($students,  #    my $error =
                                                                   'true',  #        &Apache::loncoursedata::DownloadStudentCourseDataSeparate($students,
                                                                   $cacheDB,  #                                                                  'true',
                                                                   'true',  #                                                                  $cacheDB,
                                                                   'true',  #                                                                  'true',
                                                                   $courseID,  #                                                                  'true',
                                                                   $r, $c);  #                                                                  $courseID,
     if($error ne 'OK') {  #                                                                  $r, $c);
         $r->print($error.'<br>Error downloading course data<br>');  #    if($error ne 'OK') {
         return;  #        $r->print($error.'<br>Error downloading course data<br>');
     }  #        return;
   #    }
   
   
     unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {      unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
Line 142  sub BuildAnalyzePage { Line 147  sub BuildAnalyzePage {
     my $title    = $cache{$problemId.':title'};      my $title    = $cache{$problemId.':title'};
     my $interval = $cache{'Interval'};      my $interval = $cache{'Interval'};
   
   #    my $title = 'LON-CAPA Statistics';
       my $heading = 'Restore this particular Option Response Problem '.
                     'Results, Please wait...';
   
     my %ConceptData;      my %ConceptData;
     $ConceptData{"Interval"} = $interval;      $ConceptData{"Interval"} = $interval;
   
Line 169  sub BuildAnalyzePage { Line 178  sub BuildAnalyzePage {
     $Str = '';      $Str = '';
     if($c->aborted()) {  untie(%cache); return; }      if($c->aborted()) {  untie(%cache); return; }
   
       &Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading);
   
       my $count=0;
     #Java script Progress window      #Java script Progress window
     for(my $index=0; $index<(scalar @$students); $index++) {      for(my $index=0; $index<(scalar @$students); $index++) {
         if($c->aborted()) {  untie(%cache); return; }          if($c->aborted()) {  untie(%cache); return; }
           $count++;
           my $displayString = $count.'/'.$studentCount.': '.$_;
           &Apache::lonhtmlcommon::Update_PrgWin($displayString, $r);
  &OpStatus($problemId, $students->[$index], \%ConceptData,   &OpStatus($problemId, $students->[$index], \%ConceptData,
                   $analyzeData->{'foil_to_concept'}, $analyzeData,                     $analyzeData->{'foil_to_concept'}, $analyzeData,
   \%cache, $courseID);    \%cache, $courseID);
     }      }
       &Apache::lonhtmlcommon::Close_PrgWin($r);
   
     $Str .= '<br>';      $Str .= '<br>';
     for (my $k=0; $k<$interval; $k++ ) {      for (my $k=0; $k<$interval; $k++ ) {
Line 348  sub OpStatus { Line 364  sub OpStatus {
   
     foreach my $id (@$ids) {      foreach my $id (@$ids) {
  my ($part, $response) = split(/\./, $id);   my ($part, $response) = split(/\./, $id);
 =pod  #=pod
     my %reshash=&Apache::lonnet::restore($symb,$courseID,$udom,$uname);      my %reshash=&Apache::lonnet::restore($symb,$courseID,$udom,$uname);
     if ($reshash{'version'}) {      if ($reshash{'version'}) {
         my $tries=0;          my $tries=0;
Line 370  sub OpStatus { Line 386  sub OpStatus {
     my %submission=&Apache::lonnet::str2hash($Resp);      my %submission=&Apache::lonnet::str2hash($Resp);
     foreach (keys %submission) {      foreach (keys %submission) {
  my $Ansr = $analyzeData->{"$Id1.$Id2.foil.value.$_"};   my $Ansr = $analyzeData->{"$Id1.$Id2.foil.value.$_"};
  if ($submission{$_}) {                      if($submission{$_} eq $Ansr) {
     if ($submission{$_} eq $Ansr) {                          &Decide("true", $foil_to_concept->{$_},
  &Decide("true",$_,$time );                                  $time, $ConceptData);
     }                      } else {
     else {&Decide("false",$_,$time );}                          &Decide("false", $foil_to_concept->{$_},
  }   $time, $ConceptData);
                       }
     }      }
         }          }
     }      }
         }          }
     }      }
 =cut  #=cut
   =pod
         my $time=$cache->{$student.':'.$problemID.':'.$part.':timestamp'};          my $time=$cache->{$student.':'.$problemID.':'.$part.':timestamp'};
  my @submissions = split(':::', $cache->{$student.':'.$problemID.':'.   my @submissions = split(':::', $cache->{$student.':'.$problemID.':'.
                                                $part.':'.$response.                                                 $part.':'.$response.
Line 402  sub OpStatus { Line 419  sub OpStatus {
                 }                  }
             }              }
         }          }
   =cut
   
     }      }
   
     return;      return;

Removed from v.1.11  
changed lines
  Added in v.1.14


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