Diff for /loncom/interface/statistics/lonstudentassessment.pm between versions 1.49 and 1.52

version 1.49, 2003/05/29 21:38:32 version 1.52, 2003/06/05 19:21:22
Line 461  sub CreateAndParseOutputSelector { Line 461  sub CreateAndParseOutputSelector {
     my $elementname = 'chartoutputmode';      my $elementname = 'chartoutputmode';
     #      #
     # Format for output options is 'mode, restrictions';      # Format for output options is 'mode, restrictions';
     my $selected = 'html, with links';      my $selected = 'html, without links';
     if (exists($ENV{'form.'.$elementname})) {      if (exists($ENV{'form.'.$elementname})) {
         if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) {          if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) {
             $selected = $ENV{'form.'.$elementname}->[0];              $selected = $ENV{'form.'.$elementname}->[0];
Line 603  sub html_outputstudent { Line 603  sub html_outputstudent {
     my $studentstats;      my $studentstats;
     my $PerformanceStr = '';      my $PerformanceStr = '';
     foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {      foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
         my ($performance,$score,$seq_max) =          my ($performance,$performance_length,$score,$seq_max) =
             &StudentPerformanceOnSequence($student,\%StudentsData,              &StudentPerformanceOnSequence($student,\%StudentsData,
                                           $seq,$show_links);                                            $seq,$show_links);
         my $ratio = $score.'/'.$seq_max;          my $ratio = $score.'/'.$seq_max;
Line 616  sub html_outputstudent { Line 616  sub html_outputstudent {
             $performance .= ' 'x($seq->{'width'}-length($performance));              $performance .= ' 'x($seq->{'width'}-length($performance));
         } else {          } else {
             # Pad with extra spaces              # Pad with extra spaces
             $performance .= ' 'x($seq->{'width'}-$seq_max-              $performance .= ' 'x($seq->{'width'}-$performance_length-
                                  length($ratio)                                   length($ratio)
                                  ).$ratio;                                   ).$ratio;
         }          }
Line 709  sub StudentAverageTotal { Line 709  sub StudentAverageTotal {
   
 sub SingleStudentTotal {  sub SingleStudentTotal {
     my $student = &Apache::lonstatistics::current_student();      my $student = &Apache::lonstatistics::current_student();
     my $Str = "<h3>Summary Table For ".$student->{'username'}.'@'.      my $Str = "<h3>Summary table for ".$student->{'fullname'}." ".
         $student->{'domain'}."</h3>\n";          $student->{'username'}.'@'.$student->{'domain'}."</h3>\n";
     $Str .= '<table border=2 cellspacing="1">'."\n";      $Str .= '<table border=2 cellspacing="1">'."\n";
     $Str .=       $Str .= 
         "<tr><th>Sequence or Folder</th><th>Score</th><th>Maximum</th></tr>\n";          "<tr><th>Sequence or Folder</th><th>Score</th><th>Maximum</th></tr>\n";
Line 987  sub excel_outputstudent { Line 987  sub excel_outputstudent {
     #      #
     # Write out sequence scores and totals data      # Write out sequence scores and totals data
     foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {      foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
         my ($performance,$score,$seq_max) =          my ($performance,$performance_length,$score,$seq_max) =
             &StudentPerformanceOnSequence($student,\%StudentsData,              &StudentPerformanceOnSequence($student,\%StudentsData,
                                           $seq,'no');                                            $seq,'no');
         if ($show eq 'totals' || $show eq 'scores') {          if ($show eq 'totals' || $show eq 'scores') {
Line 1147  sub csv_outputstudent { Line 1147  sub csv_outputstudent {
     #      #
     # Output performance data      # Output performance data
     foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {      foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
         my ($performance,$score,$seq_max) =          my ($performance,$performance_length,$score,$seq_max) =
             &StudentPerformanceOnSequence($student,\%StudentsData,              &StudentPerformanceOnSequence($student,\%StudentsData,
                                           $seq,'no');                                            $seq,'no');
         if ($show eq 'scores') {          if ($show eq 'scores') {
Line 1219  sub StudentPerformanceOnSequence { Line 1219  sub StudentPerformanceOnSequence {
     $links = 'no' if (! defined($links));      $links = 'no' if (! defined($links));
     my $Str = '';      my $Str = '';
     my ($sum,$max) = (0,0);      my ($sum,$max) = (0,0);
       my $performance_length = 0;
     foreach my $resource (@{$seq->{'contents'}}) {      foreach my $resource (@{$seq->{'contents'}}) {
         next if ($resource->{'type'} ne 'assessment');          next if ($resource->{'type'} ne 'assessment');
         my $resource_data = $studentdata->{$resource->{'symb'}};          my $resource_data = $studentdata->{$resource->{'symb'}};
         my $value = '';          my $value = '';
         foreach my $partnum (@{$resource->{'parts'}}) {          foreach my $partnum (@{$resource->{'parts'}}) {
             $max++;              $max++;
               $performance_length++;
             my $symbol = ' '; # default to space              my $symbol = ' '; # default to space
             #              #
             if (exists($resource_data->{'resource.'.$partnum.'.solved'})) {              if (exists($resource_data->{'resource.'.$partnum.'.solved'})) {
Line 1266  sub StudentPerformanceOnSequence { Line 1268  sub StudentPerformanceOnSequence {
                     $symbol = ' ';                      $symbol = ' ';
                 }                  }
             }              }
   #            if ($symbol ne ' ') {
   #                $attempted_sum++;
   #            }
             #              #
             if ( ($links eq 'yes' && $symbol ne ' ') ||              if ( ($links eq 'yes' && $symbol ne ' ') ||
                  ($links eq 'all')) {                   ($links eq 'all')) {
Line 1282  sub StudentPerformanceOnSequence { Line 1287  sub StudentPerformanceOnSequence {
         }          }
         $Str .= $value;          $Str .= $value;
     }      }
     return ($Str,$sum,$max);      if ($seq->{'randompick'}) {
           $max = $seq->{'randompick'};
       }
       return ($Str,$performance_length,$sum,$max);
 }  }
   
 #######################################################  #######################################################

Removed from v.1.49  
changed lines
  Added in v.1.52


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