version 1.2, 2002/07/25 21:23:51
|
version 1.3, 2002/07/26 16:22:09
|
Line 51 sub BuildStudentAssessmentPage {
|
Line 51 sub BuildStudentAssessmentPage {
|
$r->print('<html><body>Unable to tie database.</body></html>'); |
$r->print('<html><body>Unable to tie database.</body></html>'); |
return; |
return; |
} |
} |
|
|
|
# Remove students who don't have the proper section. |
|
my @sectionsSelected = split(':',$cache{'sectionsSelected'}); |
|
for(my $studentIndex=((scalar @$students)-1); $studentIndex>=0; |
|
$studentIndex--) { |
|
my $value = $cache{$students->[$studentIndex].':section'}; |
|
my $found = 0; |
|
foreach (@sectionsSelected) { |
|
if($_ eq 'none') { |
|
if($value eq '' || !defined($value) || $value eq ' ') { |
|
$found = 1; |
|
last; |
|
} |
|
} else { |
|
if($value eq $_) { |
|
$found = 1; |
|
last; |
|
} |
|
} |
|
} |
|
if($found == 0) { |
|
splice(@$students, $studentIndex, 1); |
|
} |
|
} |
|
|
my $selectedName = &FindSelectedStudent(\%cache, |
my $selectedName = &FindSelectedStudent(\%cache, |
$cache{'StudentAssessmentStudent'}, |
$cache{'StudentAssessmentStudent'}, |
$students); |
$students); |
Line 83 sub BuildStudentAssessmentPage {
|
Line 108 sub BuildStudentAssessmentPage {
|
untie(%cache); |
untie(%cache); |
$courseData = |
$courseData = |
&Apache::loncoursedata::DownloadCourseInformation($_, |
&Apache::loncoursedata::DownloadCourseInformation($_, |
$courseID); |
$courseID); |
if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT,0640)) { |
if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT,0640)) { |
&Apache::loncoursedata::ProcessStudentData(\%cache, |
&Apache::loncoursedata::ProcessStudentData(\%cache, |
$courseData, $_); |
$courseData, $_); |
untie(%cache); |
untie(%cache); |
} else { |
} else { |
last if($c->aborted()); |
last if($c->aborted()); |
Line 142 sub CreateInterface {
|
Line 167 sub CreateInterface {
|
$Ptr .= '<input type="submit" name="NextStudent" '; |
$Ptr .= '<input type="submit" name="NextStudent" '; |
$Ptr .= 'value="Next Student" />'."\n"; |
$Ptr .= 'value="Next Student" />'."\n"; |
$Ptr .= '</td></tr></table>'."\n"; |
$Ptr .= '</td></tr></table>'."\n"; |
|
$Ptr .= '<table><tr><td align="center"><b>Select Sections</b>'; |
|
$Ptr .= '</td></tr>'."\n"; |
|
|
|
$Ptr .= '<tr><td align="center">'."\n"; |
|
my @sections = split(':',$cache->{'sectionList'}); |
|
my @selectedSections = split(':',$cache->{'sectionsSelected'}); |
|
$Ptr .= &Apache::lonhtmlcommon::MultipleSectionSelect(\@sections, |
|
\@selectedSections, |
|
'Statistics'); |
|
$Ptr .= '</td></tr></table>'."\n"; |
|
|
return $Ptr; |
return $Ptr; |
} |
} |
Line 151 sub CreateTableHeadings {
|
Line 186 sub CreateTableHeadings {
|
$sequenceHeadings)=@_; |
$sequenceHeadings)=@_; |
|
|
my $Str = ''; |
my $Str = ''; |
$Str .= '<br><table border="0" cellpadding="0" cellspacing="0"><tr>'."\n"; |
$Str .= '<table border="0" cellpadding="0" cellspacing="0"><tr>'."\n"; |
|
|
my $displayString = '<td align="left"><pre><a href="/adm/statistics?'; |
my $displayString = '<td align="left"><pre><a href="/adm/statistics?'; |
$displayString .= 'sort=LINKDATA">DISPLAYDATA</a>FORMATTING'; |
$displayString .= 'sort=LINKDATA">DISPLAYDATA</a>FORMATTING'; |
Line 501 sub CreateColumnSelectors {
|
Line 536 sub CreateColumnSelectors {
|
|
|
sub FindSelectedStudent { |
sub FindSelectedStudent { |
my($cache, $selectedName, $students)=@_; |
my($cache, $selectedName, $students)=@_; |
for(my $index=0; |
|
($selectedName ne 'All Students') && ($index<(scalar @$students)); |
if($selectedName eq 'All Students' || |
$index++) { |
$selectedName eq 'No Student Selected') { |
|
return $selectedName; |
|
} |
|
|
|
for(my $index=0; $index<(scalar @$students); $index++) { |
my $fullname = $cache->{$students->[$index].':fullname'}; |
my $fullname = $cache->{$students->[$index].':fullname'}; |
if($fullname eq $selectedName) { |
if($fullname eq $selectedName) { |
if($cache->{'StudentAssessmentMove'} eq 'next') { |
if($cache->{'StudentAssessmentMove'} eq 'next') { |
if($index == ((scalar @$students) - 1)) { |
if($index == ((scalar @$students) - 1)) { |
$selectedName = $students->[0]; |
$selectedName = $students->[0]; |
|
return $selectedName; |
} else { |
} else { |
$selectedName = $students->[$index+1]; |
$selectedName = $students->[$index+1]; |
|
return $selectedName; |
} |
} |
} elsif($cache->{'StudentAssessmentMove'} eq 'previous') { |
} elsif($cache->{'StudentAssessmentMove'} eq 'previous') { |
if($index == 0) { |
if($index == 0) { |
$selectedName = $students->[-1]; |
$selectedName = $students->[-1]; |
|
return $selectedName; |
} else { |
} else { |
$selectedName = $students->[$index-1]; |
$selectedName = $students->[$index-1]; |
|
return $selectedName; |
} |
} |
} else { |
} else { |
$selectedName = $students->[$index]; |
$selectedName = $students->[$index]; |
|
return $selectedName; |
} |
} |
last; |
last; |
} |
} |
} |
} |
|
|
return $selectedName; |
return 'No Student Selected'; |
} |
} |
|
|
=pod |
=pod |