Diff for /loncom/interface/statistics/lonproblemstatistics.pm between versions 1.50 and 1.55

version 1.50, 2003/05/12 22:07:17 version 1.55, 2003/07/28 15:30:46
Line 62  my @Fields = ( Line 62  my @Fields = (
              align => 'right',               align => 'right',
              color => '#FFFFE6' },               color => '#FFFFE6' },
            { name   => 'container',             { name   => 'container',
              title  => 'Container',               title  => 'Sequence or Folder',
              align  => 'left',               align  => 'left',
              color  => '#FFFFE6',               color  => '#FFFFE6',
              sortable => 'yes' },               sortable => 'yes' },
Line 75  my @Fields = ( Line 75  my @Fields = (
            { name   => 'part',              { name   => 'part', 
              title  => 'Part',               title  => 'Part',
              align  => 'left',               align  => 'left',
              color  => '#FFFFE6' },               color  => '#FFFFE6',
                },
            { name   => 'num_students',             { name   => 'num_students',
              title  => '#Stdnts',               title  => '#Stdnts',
              align  => 'right',               align  => 'right',
Line 131  my @Fields = ( Line 132  my @Fields = (
              format => '%5.2f',               format => '%5.2f',
              sortable  => 'yes',               sortable  => 'yes',
              graphable => 'yes',               graphable => 'yes',
              long_title => 'Degree of Difficulty' },               long_title => 'Degree of Difficulty'.
                              '[ 1 - ((#YES+#yes) / Tries) ]'},
            { name   => 'num_solved',             { name   => 'num_solved',
              title  => '#YES',               title  => '#YES',
              align  => 'right',               align  => 'right',
Line 155  my @Fields = ( Line 157  my @Fields = (
              format => '%4.1f',               format => '%4.1f',
              sortable  => 'yes',               sortable  => 'yes',
              graphable => 'yes',               graphable => 'yes',
              long_title => 'Percent Wrong' },               long_title => 'Percent of students whose final answer is wrong' },
 );  );
   
 ###############################################  ###############################################
Line 202  sub CreateInterface { Line 204  sub CreateInterface {
     $Str .= &CreateAndParseOutputSelector();      $Str .= &CreateAndParseOutputSelector();
     $Str .= '</td></tr>'."\n";      $Str .= '</td></tr>'."\n";
     $Str .= '</table>'."\n";      $Str .= '</table>'."\n";
       $Str .= '<input type="submit" value="Generate Statistics" />';
       $Str .= '&nbsp;'x5;
       $Str .= '<input type="submit" name="ClearCache" value="Clear Caches" />';
       $Str .= '&nbsp;'x5;
     return $Str;      return $Str;
 }  }
   
Line 362  sub BuildProblemStatisticsPage { Line 368  sub BuildProblemStatisticsPage {
               '" />');                '" />');
     $r->print('<input type="hidden" name="plot" value="" />');      $r->print('<input type="hidden" name="plot" value="" />');
     if (! exists($ENV{'form.statsfirstcall'})) {      if (! exists($ENV{'form.statsfirstcall'})) {
         $r->print(<<ENDMSG);  
 <p>  
 <font size="+1">  
 Please make your selections in the boxes above and hit   
 the button marked &quot;Update&nbsp;Display&quot;.  
 </font>  
 </p>  
 ENDMSG  
         return;          return;
     }      }
     #      #
Line 649  sub output_excel { Line 647  sub output_excel {
     $rows_output++;       $rows_output++; 
     $cols_output=0;      $cols_output=0;
     #      #
     # Add the headers      # Long Headersheaders
       foreach my $field (@Fields) {
           next if ($field->{'name'} eq 'problem_num');
           if (exists($field->{'long_title'})) {
               $excel_sheet->write($rows_output,$cols_output++,
                                   $field->{'long_title'});
           } else {
               $excel_sheet->write($rows_output,$cols_output++,'');
           }
       }
       $rows_output++;
       $cols_output=0;
       # Brief headers
     foreach my $field (@Fields) {      foreach my $field (@Fields) {
         next if ($field->{'name'} eq 'problem_num');          next if ($field->{'name'} eq 'problem_num');
         $excel_sheet->write($rows_output,$cols_output++,$field->{'title'});          $excel_sheet->write($rows_output,$cols_output++,$field->{'title'});
Line 714  sub statistics_html_table_data { Line 724  sub statistics_html_table_data {
             }              }
         $row .= '>';          $row .= '>';
         if (exists($field->{'special'}) && $field->{'special'} eq 'link') {          if (exists($field->{'special'}) && $field->{'special'} eq 'link') {
             $row .= '<a href="'.$data->{$field->{'name'}.'.link'}.              $row .= '<a href="'.$data->{$field->{'name'}.'.link'}.'">';
                 ' target="_blank">';  
         }          }
         if (exists($field->{'format'})) {          if (exists($field->{'format'})) {
             $row .= sprintf($field->{'format'},$data->{$field->{'name'}});              $row .= sprintf($field->{'format'},$data->{$field->{'name'}});
Line 786  sub plot_statistics { Line 795  sub plot_statistics {
         }          }
     }      }
     return if (! defined($sortfield) || $sortfield eq '');      return if (! defined($sortfield) || $sortfield eq '');
     &Apache::lonnet::logthis('data field = '.$datafield);  
     #      #
     my $Max = 0;      my $Max = 0;
     my $problem_num = 0;      my $problem_num = 0;
Line 890  sub get_statistics { Line 898  sub get_statistics {
     $data->{'problem_num'} = $problem_num;      $data->{'problem_num'} = $problem_num;
     $data->{'container'}   = $sequence->{'title'};      $data->{'container'}   = $sequence->{'title'};
     $data->{'title'}       = $resource->{'title'};      $data->{'title'}       = $resource->{'title'};
     $data->{'title.link'}  = $resource->{'src'};      $data->{'title.link'}  = $resource->{'src'}.'?symb='.
           &Apache::lonnet::escape($resource->{'symb'});
     #      #
     return $data;      return $data;
 }  }

Removed from v.1.50  
changed lines
  Added in v.1.55


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