--- loncom/interface/statistics/lonproblemstatistics.pm 2003/06/10 19:19:57 1.52
+++ loncom/interface/statistics/lonproblemstatistics.pm 2003/08/27 21:33:33 1.56
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemstatistics.pm,v 1.52 2003/06/10 19:19:57 matthew Exp $
+# $Id: lonproblemstatistics.pm,v 1.56 2003/08/27 21:33:33 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -75,7 +75,8 @@ my @Fields = (
{ name => 'part',
title => 'Part',
align => 'left',
- color => '#FFFFE6' },
+ color => '#FFFFE6',
+ },
{ name => 'num_students',
title => '#Stdnts',
align => 'right',
@@ -131,7 +132,8 @@ my @Fields = (
format => '%5.2f',
sortable => 'yes',
graphable => 'yes',
- long_title => 'Degree of Difficulty' },
+ long_title => 'Degree of Difficulty'.
+ '[ 1 - ((#YES+#yes) / Tries) ]'},
{ name => 'num_solved',
title => '#YES',
align => 'right',
@@ -155,7 +157,7 @@ my @Fields = (
format => '%4.1f',
sortable => 'yes',
graphable => 'yes',
- long_title => 'Percent Wrong' },
+ long_title => 'Percent of students whose final answer is wrong' },
);
###############################################
@@ -203,6 +205,9 @@ sub CreateInterface {
$Str .= ''."\n";
$Str .= ''."\n";
$Str .= '';
+ $Str .= ' 'x5;
+ $Str .= '';
+ $Str .= ' 'x5;
return $Str;
}
@@ -305,44 +310,6 @@ sub CreateAndParseOutputSelector {
=pod
-=item &Gather_Student_Data()
-
-Ensures all student data is up to date.
-
-=cut
-
-###############################################
-###############################################
-sub Gather_Student_Data {
- my ($r) = @_;
- my $c = $r->connection();
- #
- my @Sequences = &Apache::lonstatistics::Sequences_with_Assess();
- #
- my @Students = @Apache::lonstatistics::Students;
- #
- # Open the progress window
- my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin
- ($r,'Statistics Compilation Status',
- 'Statistics Compilation Progress', scalar(@Students));
- #
- while (my $student = shift @Students) {
- return if ($c->aborted());
- my ($status,undef) = &Apache::loncoursedata::ensure_current_data
- ($student->{'username'},$student->{'domain'},
- $ENV{'request.course.id'});
- &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
- 'last student');
- }
- &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
- $r->rflush();
-}
-
-###############################################
-###############################################
-
-=pod
-
=item &BuildProblemStatisticsPage()
Main interface to problem statistics.
@@ -366,7 +333,7 @@ sub BuildProblemStatisticsPage {
return;
}
#
- &Gather_Student_Data($r);
+ &Apache::lonstatistics::Gather_Student_Data($r);
#
#
if ($output_mode eq 'html') {
@@ -642,7 +609,19 @@ sub output_excel {
$rows_output++;
$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) {
next if ($field->{'name'} eq 'problem_num');
$excel_sheet->write($rows_output,$cols_output++,$field->{'title'});
@@ -707,8 +686,7 @@ sub statistics_html_table_data {
}
$row .= '>';
if (exists($field->{'special'}) && $field->{'special'} eq 'link') {
- $row .= '';
+ $row .= '';
}
if (exists($field->{'format'})) {
$row .= sprintf($field->{'format'},$data->{$field->{'name'}});
@@ -882,7 +860,8 @@ sub get_statistics {
$data->{'problem_num'} = $problem_num;
$data->{'container'} = $sequence->{'title'};
$data->{'title'} = $resource->{'title'};
- $data->{'title.link'} = $resource->{'src'};
+ $data->{'title.link'} = $resource->{'src'}.'?symb='.
+ &Apache::lonnet::escape($resource->{'symb'});
#
return $data;
}