--- loncom/interface/Attic/lonchart.pm 2002/07/09 15:43:49 1.59 +++ loncom/interface/Attic/lonchart.pm 2002/07/17 12:36:17 1.60 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonchart.pm,v 1.59 2002/07/09 15:43:49 stredwic Exp $ +# $Id: lonchart.pm,v 1.60 2002/07/17 12:36:17 stredwic Exp $ # # Copyright Michigan State University Board of Trustees # @@ -150,12 +150,13 @@ $Str: Formatted string. sub FormatStudentInformation { my ($cache,$name,$studentInformation,$spacePadding)=@_; my $Str=''; + my $data; for(my $index=0; $index<(scalar @$studentInformation); $index++) { if(!&ShouldShowColumn($cache, 'ChartHeading'.$index)) { next; } - my $data=$cache->{$name.':'.$studentInformation->[$index]}; + $data=$cache->{$name.':'.$studentInformation->[$index]}; $Str .= $data; my @dataLength=split(//,$data); @@ -211,6 +212,14 @@ sub FormatStudentData { unless(tie(%CacheData,'GDBM_File',$ChartDB,&GDBM_READER,0640)) { return ''; } + +# my $section = &Apache::loncoursedata::CheckStatus($name, \%CacheData, +# $CacheData{'form.Status'}); +# if($section eq 'not found') { +# untie(%CacheData); +# return; +# } + # Handle Student information ------------------------------------------ # Handle user data $Str=&FormatStudentInformation(\%CacheData, $name, $studentInformation, @@ -586,7 +595,7 @@ sub CreateForm { my $OpSel1=''; my $OpSel2=''; my $OpSel3=''; - my $Status = $CacheData->{'form.ChartStatus'}; + my $Status = $CacheData->{'form.Status'}; if ( $Status eq 'Any' ) { $OpSel3='selected'; } elsif ($Status eq 'Expired' ) { $OpSel2 = 'selected'; } else { $OpSel1 = 'selected'; } @@ -614,7 +623,7 @@ sub CreateForm { $Ptr .= ''; $Ptr .= ' Student Status:   '."\n". ''. - ''. ''."\n". ''."\n". ' '."\n"; @@ -723,10 +732,10 @@ sub ProcessFormData { $CacheData{'form.ChartSort'}='username'; } - if(defined($ENV{'form.ChartStatus'})) { - $CacheData{'form.ChartStatus'}=$ENV{'form.ChartStatus'}; - } elsif(!defined($CacheData{'form.ChartStatus'})) { - $CacheData{'form.ChartStatus'}='Active'; + if(defined($ENV{'form.Status'})) { + $CacheData{'form.Status'}=$ENV{'form.Status'}; + } elsif(!defined($CacheData{'form.Status'})) { + $CacheData{'form.Status'}='Active'; } # $found checks for any instances of form data in the ENV. If it is @@ -768,7 +777,7 @@ sub ProcessFormData { # on the remote was pressed and needs to reset all the selections if(defined($ENV{'form.ChartReset'}) || (!$found && !$isCached)) { $CacheData{'form.ChartReset'}='true'; - $CacheData{'form.ChartStatus'}='Active'; + $CacheData{'form.Status'}='Active'; $CacheData{'form.ChartSort'}='username'; $CacheData{'form.ChartHeadings'}='ALLHEADINGS'; $CacheData{'form.ChartSequences'}='ALLSEQUENCES'; @@ -864,7 +873,7 @@ sub SortStudents { my ($end,$start)=split(/\:/,$CacheData->{$_.':date'}); my $active=1; my $now=time; - my $Status=$CacheData->{'form.ChartStatus'}; + my $Status=$CacheData->{'form.Status'}; $Status = ($Status) ? $Status : 'Active'; if((($end) && $now > $end) && (($Status eq 'Active'))) { $active=0; @@ -1056,9 +1065,9 @@ sub BuildChart { @students=&Apache::loncoursedata::ProcessClassList(\%CacheData, - $classlist, $cid, - $CacheData{'form.ChartStatus'}, - $c); + $classlist, $cid, + $CacheData{'form.Status'}, + $c); if($c->aborted()) { untie(%CacheData);