--- loncom/interface/statistics/lonproblemstatistics.pm 2003/04/01 17:00:24 1.49
+++ loncom/interface/statistics/lonproblemstatistics.pm 2003/10/28 20:08:23 1.55.2.1
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemstatistics.pm,v 1.49 2003/04/01 17:00:24 matthew Exp $
+# $Id: lonproblemstatistics.pm,v 1.55.2.1 2003/10/28 20:08:23 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -62,7 +62,7 @@ my @Fields = (
align => 'right',
color => '#FFFFE6' },
{ name => 'container',
- title => 'Container',
+ title => 'Sequence or Folder',
align => 'left',
color => '#FFFFE6',
sortable => 'yes' },
@@ -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' },
);
###############################################
@@ -177,6 +179,7 @@ sub CreateInterface {
$Str .= '
'."\n";
$Str .= '';
$Str .= 'Sections | ';
+ $Str .= 'Enrollment Status | ';
$Str .= 'Sequences and Folders | ';
$Str .= 'Output | ';
$Str .= '
'."\n";
@@ -184,6 +187,8 @@ sub CreateInterface {
$Str .= ''."\n";
$Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);
$Str .= ' | ';
+ $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);
+ $Str .= ' | ';
#
my $only_seq_with_assessments = sub {
my $s=shift;
@@ -199,6 +204,10 @@ sub CreateInterface {
$Str .= &CreateAndParseOutputSelector();
$Str .= ' |
'."\n";
$Str .= '
'."\n";
+ $Str .= '';
+ $Str .= ' 'x5;
+ $Str .= '';
+ $Str .= ' 'x5;
return $Str;
}
@@ -359,14 +368,6 @@ sub BuildProblemStatisticsPage {
'" />');
$r->print('');
if (! exists($ENV{'form.statsfirstcall'})) {
- $r->print(<
-
-Please make your selections in the boxes above and hit
-the button marked "Update Display".
-
-
-ENDMSG
return;
}
#
@@ -646,7 +647,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'});
@@ -711,8 +724,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'}});
@@ -783,7 +795,6 @@ sub plot_statistics {
}
}
return if (! defined($sortfield) || $sortfield eq '');
- &Apache::lonnet::logthis('data field = '.$datafield);
#
my $Max = 0;
my $problem_num = 0;
@@ -858,6 +869,9 @@ sub DrawGraph {
$title = '' if (! defined($title));
$xaxis = '' if (! defined($xaxis));
$yaxis = '' if (! defined($yaxis));
+ $title = &Apache::lonnet::escape($title);
+ $xaxis = &Apache::lonnet::escape($xaxis);
+ $yaxis = &Apache::lonnet::escape($yaxis);
#
my $sendValues = join(',', @$values);
my $sendCount = scalar(@$values);
@@ -887,7 +901,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;
}