'."\n";
@@ -271,6 +339,15 @@ my @OutputOptions =
show => 'all',
show_links => 'yes',
},
+ { name => 'HTML, with all links',
+ value => 'html, with all links',
+ description => 'Output HTML with each symbol linked to the problem '.
+ 'which generated it. '.
+ 'This includes links for unattempted problems.',
+ mode => 'html',
+ show => 'all',
+ show_links => 'all',
+ },
{ name => 'HTML, without links',
value => 'html, without links',
description => 'Output HTML. By not including links, the size of the'.
@@ -323,27 +400,27 @@ my @OutputOptions =
show => 'totals',
show_links => 'no',
},
- { name => 'multi-sheet Excel',
- value => 'multi-sheet excel',
- description => 'Output an Excel file (compatable with Excel 95), '.
- 'with a seperate worksheet for each sequence you have selected '.
- 'the data for each problem part '.
- '(number of tries, status, points awarded) will be listed.',
- mode => 'multi-sheet excel',
- show => 'totals',
- show_links => 'no',
- },
- { name => 'multi-sheet Excel, by section',
- value => 'multi-sheet excel, by section',
- description => 'Output an Excel file (compatable with Excel 95), '.
- 'with a seperate worksheet for each sequence you have selected '.
- 'the data for each problem part '.
- '(number of tries, status, points awarded) will be listed. '.
- 'There will be one Excel workbook for each section selected.',
- mode => 'multi-sheet excel',
- show => 'by section',
- show_links => 'no',
- },
+# { name => 'multi-sheet Excel',
+# value => 'multi-sheet excel',
+# description => 'Output an Excel file (compatable with Excel 95), '.
+# 'with a seperate worksheet for each sequence you have selected '.
+# 'the data for each problem part '.
+# '(number of tries, status, points awarded) will be listed.',
+# mode => 'multi-sheet excel',
+# show => 'totals',
+# show_links => 'no',
+# },
+# { name => 'multi-sheet Excel, by section',
+# value => 'multi-sheet excel, by section',
+# description => 'Output an Excel file (compatable with Excel 95), '.
+# 'with a seperate worksheet for each sequence you have selected '.
+# 'the data for each problem part '.
+# '(number of tries, status, points awarded) will be listed. '.
+# 'There will be one Excel workbook for each section selected.',
+# mode => 'multi-sheet excel',
+# show => 'by section',
+# show_links => 'no',
+# },
{ name => 'CSV, everything',
value => 'csv, everything',
description => '',
@@ -381,10 +458,10 @@ sub OutputDescriptions {
sub CreateAndParseOutputSelector {
my $Str = '';
- my $elementname = 'outputmode';
+ my $elementname = 'chartoutputmode';
#
# Format for output options is 'mode, restrictions';
- my $selected = 'html, with links';
+ my $selected = 'html, without links';
if (exists($ENV{'form.'.$elementname})) {
if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) {
$selected = $ENV{'form.'.$elementname}->[0];
@@ -526,7 +603,7 @@ sub html_outputstudent {
my $studentstats;
my $PerformanceStr = '';
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
- my ($performance,$score,$seq_max) =
+ my ($performance,$performance_length,$score,$seq_max) =
&StudentPerformanceOnSequence($student,\%StudentsData,
$seq,$show_links);
my $ratio = $score.'/'.$seq_max;
@@ -539,7 +616,7 @@ sub html_outputstudent {
$performance .= ' 'x($seq->{'width'}-length($performance));
} else {
# Pad with extra spaces
- $performance .= ' 'x($seq->{'width'}-$seq_max-
+ $performance .= ' 'x($seq->{'width'}-$performance_length-
length($ratio)
).$ratio;
}
@@ -583,7 +660,11 @@ sub html_finish {
} else {
$r->print("\n");
}
- $r->print(&StudentAverageTotal());
+ if ($single_student_mode) {
+ $r->print(&SingleStudentTotal());
+ } else {
+ $r->print(&StudentAverageTotal());
+ }
$r->rflush();
return;
}
@@ -596,8 +677,13 @@ sub StudentAverageTotal {
$Str .= '
'."\n";
$Str .= "
Title
Average
Maximum
\n";
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
- my $ave = int(100*($Statistics->{$seq->{'symb'}}->{'score'}/
- ($num_students-$nodata_count)))/100;
+ my $ave;
+ if ($num_students > $nodata_count) {
+ $ave = int(100*($Statistics->{$seq->{'symb'}}->{'score'}/
+ ($num_students-$nodata_count)))/100;
+ } else {
+ $ave = 0;
+ }
$total_ave += $ave;
my $max = $seq->{'num_assess_parts'};
$total_max += $max;
@@ -621,6 +707,31 @@ sub StudentAverageTotal {
return $Str;
}
+sub SingleStudentTotal {
+ my $student = &Apache::lonstatistics::current_student();
+ my $Str = "
Summary Table For ".$student->{'username'}.'@'.
+ $student->{'domain'}."
\n";
+ $Str .= '
'."\n";
+ $Str .=
+ "
Sequence or Folder
Score
Maximum
\n";
+ my $total = 0;
+ my $total_max = 0;
+ foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
+ my $value = $Statistics->{$seq->{'symb'}}->{'score'};
+ my $max = $Statistics->{$seq->{'symb'}}->{'max'};
+ $Str .= '