'."\n";
- $Ptr .= ' {'sectionList'});
+ my @selectedSections = split(':',$cache->{'sectionsSelected'});
+ $Str .= &Apache::lonhtmlcommon::MultipleSectionSelect(\@sections,
+ \@selectedSections,
+ 'Statistics');
+ $Str .= ' ';
+ $Str .= &CreateColumnSelectionBox($doNotShow);
+ $Str .= ' '."\n";
+ $Str .= 'DISPLAYDATA FORMATTING';
$displayString .= $spacing.' '."\n";
@@ -398,41 +451,22 @@ which has a size of four.
=cut
sub CreateColumnSelectionBox {
- my ($CacheData,$headings)=@_;
-
- my $missing=0;
- my $notThere='Select column to view: ';
- my $name;
- $notThere .= '';
- $notThere .= ''."\n";
-
- for(my $index=0; $index<(scalar @$headings); $index++) {
- if(&ShouldShowColumn($CacheData, 'ChartHeading'.$index)) {
- next;
- }
- $name = $headings->[$index];
- $notThere .= '';
- $notThere .= $name.' '."\n";
- $missing++;
- }
+ my ($doNotShow)=@_;
- foreach my $sequence (split(/\:/,$CacheData->{'orderedSequences'})) {
- if(&ShouldShowColumn($CacheData, 'ChartSequence'.$sequence)) {
- next;
- }
- $name = $CacheData->{$sequence.':title'};
- $notThere .= '';
+ my $notThere = '';
+ $notThere .= '{'count'}; $index++) {
+ my $name = $doNotShow->{$index.':name'};
+ $notThere .= '';
$notThere .= $name.' '."\n";
- $missing++;
}
- if($missing) {
- $notThere .= ' ';
- } else {
- $notThere='';
- }
+ $notThere .= '';
- return $notThere.' ';
+ return $notThere;
}
=pod
@@ -462,37 +496,24 @@ for consistency of location over the col
=cut
sub CreateColumnSelectors {
- my ($headings)=@_;
-=pod
- my $found=0;
- my ($name, $length, $position);
+ my ($infoHeadings, $sequenceHeadings, $sequenceKeys)=@_;
- my $present = '';
- for(my $index=0; $index<(scalar @$headings); $index++) {
+ my $present = '';
+ for(my $index=0; $index<(scalar @$infoHeadings); $index++) {
$present .= '';
$present .= ' ';
- $present .= ' ';
- $found++;
+ $present .= 'name="HeadingColumn'.$infoHeadings->[$index].'" />';
+ $present .= ''."\n";
}
- foreach my $sequence (split(/\:/,$CacheData->{'orderedSequences'})) {
- if(!&ShouldShowColumn($CacheData, 'ChartSequence'.$sequence)) {
- next;
- }
+ for(my $index=0; $index<(scalar @$sequenceHeadings); $index++) {
$present .= '';
$present .= ' ';
- $present .= ' ';
- $found++;
+ $present .= 'name="SequenceColumn'.$sequenceKeys->[$index].'" />';
+ $present .= ''."\n";
}
- if(!$found) {
- $present = '';
- }
-
- return $present.' '."\n";;
-=cut
+ return $present;
}
#---- END Student Assessment Web Page ----------------------------------------
@@ -501,31 +522,40 @@ sub CreateColumnSelectors {
sub FindSelectedStudent {
my($cache, $selectedName, $students)=@_;
- for(my $index=0;
- ($selectedName ne 'All Students') && ($index<(scalar @$students));
- $index++) {
+
+ if($selectedName eq 'All Students' ||
+ $selectedName eq 'No Student Selected') {
+ return $selectedName;
+ }
+
+ for(my $index=0; $index<(scalar @$students); $index++) {
my $fullname = $cache->{$students->[$index].':fullname'};
if($fullname eq $selectedName) {
if($cache->{'StudentAssessmentMove'} eq 'next') {
if($index == ((scalar @$students) - 1)) {
$selectedName = $students->[0];
+ return $selectedName;
} else {
$selectedName = $students->[$index+1];
+ return $selectedName;
}
} elsif($cache->{'StudentAssessmentMove'} eq 'previous') {
if($index == 0) {
$selectedName = $students->[-1];
+ return $selectedName;
} else {
$selectedName = $students->[$index-1];
+ return $selectedName;
}
} else {
$selectedName = $students->[$index];
+ return $selectedName;
}
last;
}
}
- return $selectedName;
+ return 'No Student Selected';
}
=pod
@@ -558,26 +588,40 @@ sub ShouldShowColumns {
my @sequenceKeys=();
my @sequenceHeadings=();
+ my %doNotShow;
+
my $index;
+ my $count = 0;
+ my $check = '';
for($index=0; $index < scalar @$headings; $index++) {
- push(@infoHeadings, $headings->[$index]);
- push(@infoKeys, $cacheKey->[$index]);
+ $check = 'HeadingColumn'.$headings->[$index];
+ if($cache->{'HeadingsFound'} =~ /$check/) {
+ push(@infoHeadings, $headings->[$index]);
+ push(@infoKeys, $cacheKey->[$index]);
+ } else {
+ $doNotShow{$count.':name'} = $headings->[$index];
+ $doNotShow{$count.':id'} = 'HeadingColumn'.$headings->[$index];
+ $count++;
+ }
}
foreach my $sequence (split(/\:/,$cache->{'orderedSequences'})) {
- push(@sequenceHeadings, $cache->{$sequence.':title'});
- push(@sequenceKeys, $sequence);
+ $check = 'SequenceColumn'.$sequence;
+ if($cache->{'SequencesFound'} eq 'All Sequences' ||
+ $cache->{'SequencesFound'} =~ /$check/) {
+ push(@sequenceHeadings, $cache->{$sequence.':title'});
+ push(@sequenceKeys, $sequence);
+ } else {
+ $doNotShow{$count.':name'} = $cache->{$sequence.':title'};
+ $doNotShow{$count.':id'} = 'SequenceColumn'.$sequence;
+ $count++;
+ }
}
-# my $headings=$cache->{'form.ChartHeadings'};
-# my $sequences=$cache->{'form.ChartSequences'};
-# if($headings eq 'ALLHEADINGS' || $sequences eq 'ALLSEQUENCES' ||
-# $headings=~/$test/ || $sequences=~/$test/) {
-# return 1;
-# }
+ $doNotShow{'count'} = $count;
return (\@infoHeadings, \@infoKeys, \@sequenceHeadings,
- \@sequenceKeys);
+ \@sequenceKeys, \%doNotShow);
}
#---- END Student Assessment Worker Functions --------------------------------