--- loncom/interface/Attic/lonchart.pm 2002/07/02 15:13:06 1.50
+++ loncom/interface/Attic/lonchart.pm 2002/07/02 21:34:40 1.51
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# (Publication Handler
#
-# $Id: lonchart.pm,v 1.50 2002/07/02 15:13:06 stredwic Exp $
+# $Id: lonchart.pm,v 1.51 2002/07/02 21:34:40 stredwic Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -46,6 +46,10 @@
#
###
+=pod
+
+=cut
+
package Apache::lonchart;
use strict;
@@ -55,15 +59,15 @@ use Apache::loncommon();
use HTML::TokeParser;
use GDBM_File;
-my $jr;
+#my $jr;
# ----- FORMAT PRINT DATA ----------------------------------------------
sub FormatStudentInformation {
- my ($cache,$name,$studentInformation,$reselected,$spacePadding)=@_;
+ my ($cache,$name,$studentInformation,$spacePadding)=@_;
my $Str='';
for(my $index=0; $index<(scalar @$studentInformation); $index++) {
- if(!&ShouldShowColumn($reselected, 'heading', $index)) {
+ if(!&ShouldShowColumn($cache, 'heading'.$index)) {
next;
}
my $data=$cache->{$name.':'.$studentInformation->[$index]};
@@ -80,7 +84,7 @@ sub FormatStudentInformation {
}
sub FormatStudentData {
- my ($reselected,$name,$coid,$studentInformation,$spacePadding,$ChartDB)=@_;
+ my ($name,$coid,$studentInformation,$spacePadding,$ChartDB)=@_;
my ($sname,$sdom) = split(/\:/,$name);
my $Str;
my %CacheData;
@@ -91,7 +95,7 @@ sub FormatStudentData {
# Handle Student information ------------------------------------------
# Handle user data
$Str=&FormatStudentInformation(\%CacheData, $name, $studentInformation,
- $reselected, $spacePadding);
+ $spacePadding);
# Handle errors
if($CacheData{$name.':error'} =~ /environment/) {
@@ -113,7 +117,7 @@ sub FormatStudentData {
my $problemsSolved = 0;
my $numberOfParts = 0;
foreach my $sequence (split(/\:/,$CacheData{'orderedSequences'})) {
- if(!&ShouldShowColumn($reselected, 'sequence', $sequence)) {
+ if(!&ShouldShowColumn(\%CacheData, 'sequence'.$sequence)) {
next;
}
@@ -208,19 +212,21 @@ sub FormatStudentData {
$Str .= $spacePadding;
}
- $Str .= ''.$problemsSolved.
- ' / '.$totalProblems.'
';
+ my $outputProblemsSolved = sprintf( "%4d", $problemsSolved );
+ my $outputTotalProblems = sprintf( "%4d", $totalProblems );
+ $Str .= ''.$outputProblemsSolved.
+ ' / '.$outputTotalProblems.'
';
untie(%CacheData);
return $Str;
}
sub CreateTableHeadings {
- my ($CacheData,$studentInformation,$headings,$reselected,$spacePadding)=@_;
+ my ($CacheData,$studentInformation,$headings,$spacePadding)=@_;
my $Str='
';
for(my $index=0; $index<(scalar @$headings); $index++) {
- if(!&ShouldShowColumn($reselected, 'heading', $index)) {
+ if(!&ShouldShowColumn($CacheData, 'heading'.$index)) {
next;
}
@@ -235,7 +241,7 @@ sub CreateTableHeadings {
}
foreach my $sequence (split(/\:/,$CacheData->{'orderedSequences'})) {
- if(!&ShouldShowColumn($reselected, 'sequence', $sequence)) {
+ if(!&ShouldShowColumn($CacheData, 'sequence'.$sequence)) {
next;
}
@@ -255,7 +261,7 @@ sub CreateTableHeadings {
}
sub CreateColumnSelectionBox {
- my ($CacheData,$studentInformation,$headings,$reselected,$spacePadding)=@_;
+ my ($CacheData,$studentInformation,$headings,$spacePadding)=@_;
my $missing=0;
my $notThere='Select column to view:';
@@ -264,7 +270,7 @@ sub CreateColumnSelectionBox {
$notThere .= ' |