version 1.37, 2002/07/30 21:31:48
|
version 1.40, 2002/08/06 17:39:15
|
Line 83 sub ProcessFormData{
|
Line 83 sub ProcessFormData{
|
&CheckFormElement($cache, 'sort', 'sort', 'fullname'); |
&CheckFormElement($cache, 'sort', 'sort', 'fullname'); |
&CheckFormElement($cache, 'download', 'download', 'false'); |
&CheckFormElement($cache, 'download', 'download', 'false'); |
|
|
|
# student assessment |
if(defined($ENV{'form.CreateStudentAssessment'}) || |
if(defined($ENV{'form.CreateStudentAssessment'}) || |
defined($ENV{'form.NextStudent'}) || |
defined($ENV{'form.NextStudent'}) || |
defined($ENV{'form.PreviousStudent'})) { |
defined($ENV{'form.PreviousStudent'})) { |
Line 110 sub ProcessFormData{
|
Line 111 sub ProcessFormData{
|
$cache->{'sectionsSelected'} = $cache->{'sectionList'}; |
$cache->{'sectionsSelected'} = $cache->{'sectionList'}; |
} |
} |
|
|
|
# Problem analysis |
|
&CheckFormElement($cache, 'Interval', 'Interval', '1'); |
|
|
|
# ProblemStatistcs |
|
&CheckFormElement($cache, 'DisplayCSVFormat', |
|
'DisplayFormat', 'Display Table Format'); |
|
&CheckFormElement($cache, 'ProblemStatisticsAscend', |
|
'ProblemStatisticsAscend', 'Ascending'); |
|
&CheckFormElement($cache, 'ProblemStatisticsMaps', |
|
'ProblemStatisticsMaps', 'All Maps'); |
|
|
|
# Search only form elements |
my @headingColumns=(); |
my @headingColumns=(); |
my @sequenceColumns=(); |
my @sequenceColumns=(); |
my $foundColumn = 0; |
my $foundColumn = 0; |
Line 131 sub ProcessFormData{
|
Line 144 sub ProcessFormData{
|
$cache->{'reportKey'} = 'false'; |
$cache->{'reportKey'} = 'false'; |
if($cache->{'reportSelected'} eq 'Analyze') { |
if($cache->{'reportSelected'} eq 'Analyze') { |
$cache->{'reportKey'} = 'Analyze'; |
$cache->{'reportKey'} = 'Analyze'; |
|
} elsif($cache->{'reportSelected'} eq 'DoDiffGraph') { |
|
$cache->{'reportKey'} = 'DoDiffGraph'; |
|
} elsif($cache->{'reportSelected'} eq 'PercentWrongGraph') { |
|
$cache->{'reportKey'} = 'PercentWrongGraph'; |
|
} |
|
|
|
if(defined($ENV{'form.DoDiffGraph'})) { |
|
$cache->{'reportSelected'} = 'DoDiffGraph'; |
|
$cache->{'reportKey'} = 'DoDiffGraph'; |
|
} elsif(defined($ENV{'form.PercentWrongGraph'})) { |
|
$cache->{'reportSelected'} = 'PercentWrongGraph'; |
|
$cache->{'reportKey'} = 'PercentWrongGraph'; |
} |
} |
|
|
foreach (keys(%ENV)) { |
foreach (keys(%ENV)) { |
Line 140 sub ProcessFormData{
|
Line 165 sub ProcessFormData{
|
my $data; |
my $data; |
(undef, $data)=split(':::', $_); |
(undef, $data)=split(':::', $_); |
$cache->{'AnalyzeInfo'}=$data; |
$cache->{'AnalyzeInfo'}=$data; |
|
|
&CheckFormElement($cache, 'Interval', 'Interval', '1'); |
|
} elsif(/form\.HeadingColumn/) { |
} elsif(/form\.HeadingColumn/) { |
my $value = $_; |
my $value = $_; |
$value =~ s/form\.//; |
$value =~ s/form\.//; |
Line 170 sub ProcessFormData{
|
Line 193 sub ProcessFormData{
|
$cache->{'DefaultColumns'} = 'false'; |
$cache->{'DefaultColumns'} = 'false'; |
|
|
return; |
return; |
|
|
# Select page to display |
|
if(defined($ENV{'form.ProblemStatistics'}) || |
|
defined($ENV{'form.ProblemStatisticsRecalculate'}) || |
|
defined($ENV{'form.DisplayCSVFormat'})) { |
|
$cache->{'GoToPage'} = 'ProblemStatistics'; |
|
&CheckFormElement($cache, 'DisplayCSVFormat', |
|
'DisplayFormat', 'Display Table Format'); |
|
&CheckFormElement($cache, 'Ascend','ProblemStatisticsAscend', |
|
'Ascending'); |
|
&CheckFormElement($cache, 'Maps', 'ProblemStatisticsMap', |
|
'All Maps'); |
|
} elsif(defined($ENV{'form.ProblemAnalysis'})) { |
|
$cache->{'GoToPage'} = 'ProblemAnalysis'; |
|
&CheckFormElement($cache, 'Interval', 'Interval', '1'); |
|
} elsif(defined($ENV{'form.DoDiffGraph'})) { |
|
$cache->{'GoToPage'} = 'DoDiffGraph'; |
|
} elsif(defined($ENV{'form.PercentWrongGraph'})) { |
|
$cache->{'GoToPage'} = 'PercentWrongGraph'; |
|
} elsif(defined($ENV{'form.ActivityLog'})) { |
|
$cache->{'GoToPage'} = 'ActivityLog'; |
|
} else { |
|
$cache->{'GoToPage'} = 'Menu'; |
|
} |
|
|
|
&CheckFormElement($cache, 'Status', 'Status', 'Active'); |
|
|
|
return; |
|
} |
} |
|
|
=pod |
=pod |
Line 298 sub SpaceColumns {
|
Line 293 sub SpaceColumns {
|
} |
} |
|
|
sub PrepareData { |
sub PrepareData { |
my ($c, $cacheDB, $studentInformation, $headings)=@_; |
my ($c, $cacheDB, $studentInformation, $headings,$r)=@_; |
|
|
# Test for access to the cache data |
# Test for access to the cache data |
my $courseID=$ENV{'request.course.id'}; |
my $courseID=$ENV{'request.course.id'}; |
Line 315 sub PrepareData {
|
Line 310 sub PrepareData {
|
|
|
# Download class list information if not using cached data |
# Download class list information if not using cached data |
my %cache; |
my %cache; |
unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT,0640)) { |
unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT(),0640)) { |
return "Unable to tie hash to db file."; |
return "Unable to tie hash to db file."; |
} |
} |
|
|
if(!$isCached) { |
if(!$isCached) { |
my $processTopResourceMapReturn= |
my $processTopResourceMapReturn= |
&Apache::loncoursedata::ProcessTopResourceMap(\%cache, $c); |
&Apache::loncoursedata::ProcessTopResourceMap(\%cache, $c, $r); |
if($processTopResourceMapReturn ne 'OK') { |
if($processTopResourceMapReturn ne 'OK') { |
untie(%cache); |
untie(%cache); |
return $processTopResourceMapReturn; |
return $processTopResourceMapReturn; |
Line 369 sub PrepareData {
|
Line 364 sub PrepareData {
|
&Apache::loncoursedata::ProcessStudentData(\%cache, $courseData, $who); |
&Apache::loncoursedata::ProcessStudentData(\%cache, $courseData, $who); |
$cache{'download'} = 'false'; |
$cache{'download'} = 'false'; |
} elsif($cache{'DownloadAll'} ne 'false') { |
} elsif($cache{'DownloadAll'} ne 'false') { |
|
$cache{'DownloadAll'} = 'false'; |
my @allStudents; |
my @allStudents; |
if($cache{'DownloadAll'} eq 'sorted') { |
if($cache{'DownloadAll'} eq 'sorted') { |
@allStudents = @$students; |
@allStudents = @$students; |
} else { |
} else { |
@allStudents = split(':::', $cache{'NamesOfStudents'}); |
@allStudents = split(':::', $cache{'NamesOfStudents'}); |
} |
} |
|
&Create_PrgWin($r); |
|
my $count=1; |
foreach (@allStudents) { |
foreach (@allStudents) { |
|
&Update_PrgWin(scalar(@allStudents),$count,$_,$r); |
my $courseData = |
my $courseData = |
&Apache::loncoursedata::DownloadCourseInformation( |
&Apache::loncoursedata::DownloadCourseInformation( |
$_, $courseID, |
$_, $courseID, |
Line 386 sub PrepareData {
|
Line 385 sub PrepareData {
|
untie(%cache); |
untie(%cache); |
return 'aborted'; |
return 'aborted'; |
} |
} |
|
$count++; |
} |
} |
$cache{'DownloadAll'} = 'false'; |
&Close_PrgWin($r); |
} |
} |
|
|
if($c->aborted()) { |
if($c->aborted()) { |
Line 438 sub Close_PrgWin {
|
Line 438 sub Close_PrgWin {
|
|
|
|
|
sub BuildClasslist { |
sub BuildClasslist { |
my ($cacheDB,$students,$studentInformation,$headings)=@_; |
my ($cacheDB,$students,$studentInformation,$headings,$r)=@_; |
|
|
my %cache; |
my %cache; |
unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) { |
unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { |
return '<html><body>Unable to tie database.</body></html>'; |
return '<html><body>Unable to tie database.</body></html>'; |
} |
} |
|
|
Line 451 sub BuildClasslist {
|
Line 451 sub BuildClasslist {
|
|
|
my $displayString = '<td align="left"><a href="/adm/statistics?'; |
my $displayString = '<td align="left"><a href="/adm/statistics?'; |
$displayString .= 'sort=LINKDATA">DISPLAYDATA </a></td>'."\n"; |
$displayString .= 'sort=LINKDATA">DISPLAYDATA </a></td>'."\n"; |
$Str .= &Apache::lonhtmlcommon::CreateHeadings(\%cache, $studentInformation, |
$Str .= &Apache::lonhtmlcommon::CreateHeadings(\%cache, |
|
$studentInformation, |
$headings, $displayString); |
$headings, $displayString); |
$Str .= '</tr>'."\n"; |
$Str .= '</tr>'."\n"; |
|
|
my $alternate=0; |
my $alternate=0; |
foreach (@$students) { |
foreach (@$students) { |
my ($username, $domain) = split(':', $_); |
my ($username, $domain) = split(':', $_); |
Line 488 sub BuildClasslist {
|
Line 490 sub BuildClasslist {
|
|
|
$Str .= '</tr>'."\n"; |
$Str .= '</tr>'."\n"; |
$Str .= '</table></td></tr></table>'."\n"; |
$Str .= '</table></td></tr></table>'."\n"; |
|
$r->print($Str); |
|
$r->rflush(); |
|
|
untie(%cache); |
untie(%cache); |
|
|
return $Str; |
return; |
} |
} |
|
|
sub CreateMainMenu { |
sub CreateMainMenu { |
Line 544 sub BuildStatistics {
|
Line 548 sub BuildStatistics {
|
my %reports = ('classlist' => 'Class list', |
my %reports = ('classlist' => 'Class list', |
'problem_statistics' => 'Problem Statistics', |
'problem_statistics' => 'Problem Statistics', |
'student_assessment' => 'Student Assessment', |
'student_assessment' => 'Student Assessment', |
|
# 'activitylog' => 'Activity Log', |
'reportSelected' => 'Class list'); |
'reportSelected' => 'Class list'); |
|
|
my %cache; |
my %cache; |
Line 553 sub BuildStatistics {
|
Line 558 sub BuildStatistics {
|
|
|
my ($returnValue, $students) = &PrepareData($c, $cacheDB, |
my ($returnValue, $students) = &PrepareData($c, $cacheDB, |
\@studentInformation, |
\@studentInformation, |
\@headings); |
\@headings,$r); |
if($returnValue ne 'OK') { |
if($returnValue ne 'OK') { |
$r->print('<html><body>'.$returnValue."\n".'</body></html>'); |
$r->print('<html><body>'.$returnValue."\n".'</body></html>'); |
return OK; |
return OK; |
} |
} |
|
|
my $GoToPage; |
my $GoToPage; |
if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) { |
if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { |
$GoToPage = $cache{'reportSelected'}; |
$GoToPage = $cache{'reportSelected'}; |
$reports{'reportSelected'} = $cache{'reportSelected'}; |
$reports{'reportSelected'} = $cache{'reportSelected'}; |
if(defined($cache{'reportKey'}) && |
if(defined($cache{'reportKey'}) && |
Line 577 sub BuildStatistics {
|
Line 582 sub BuildStatistics {
|
$r->print('<form name="Statistics" '); |
$r->print('<form name="Statistics" '); |
$r->print('method="post" action="/adm/statistics">'); |
$r->print('method="post" action="/adm/statistics">'); |
$r->print(&CreateMainMenu($cache{'Status'}, \%reports)); |
$r->print(&CreateMainMenu($cache{'Status'}, \%reports)); |
|
$r->rflush(); |
untie(%cache); |
untie(%cache); |
} else { |
} else { |
$r->print('<html><body>Unable to tie database.</body></html>'); |
$r->print('<html><body>Unable to tie database.</body></html>'); |
Line 591 sub BuildStatistics {
|
Line 597 sub BuildStatistics {
|
$courseID, |
$courseID, |
$c,$r); |
$c,$r); |
} elsif($GoToPage eq 'Problem Analysis') { |
} elsif($GoToPage eq 'Problem Analysis') { |
$r->print( |
&Apache::lonproblemanalysis::BuildProblemAnalysisPage($cacheDB, $r); |
&Apache::lonproblemanalysis::BuildProblemAnalysisPage($cacheDB)); |
|
} elsif($GoToPage eq 'Student Assessment') { |
} elsif($GoToPage eq 'Student Assessment') { |
$r->print( |
&Apache::lonstudentassessment::BuildStudentAssessmentPage($cacheDB, |
&Apache::lonstudentassessment::BuildStudentAssessmentPage($cacheDB, |
|
$students, |
$students, |
$courseID, |
$courseID, |
'Statistics', |
'Statistics', |
\@headings, |
\@headings, |
$spacing, |
$spacing, |
\@studentInformation, |
\@studentInformation, |
$r, $c)); |
$r, $c); |
} elsif($GoToPage eq 'Analyze') { |
} elsif($GoToPage eq 'Analyze') { |
$r->print(&Apache::lonproblemanalysis::BuildAnalyzePage($cacheDB, |
&Apache::lonproblemanalysis::BuildAnalyzePage($cacheDB, $students, |
$students, |
$courseID, $r); |
$courseID,$r)); |
} elsif($GoToPage eq 'DoDiffGraph' || $GoToPage eq 'PercentWrongGraph') { |
} elsif($GoToPage eq 'DoDiffGraph') { |
&Apache::lonproblemstatistics::BuildGraphicChart($GoToPage,$r,$cacheDB); |
&Apache::lonproblemstatistics::BuildDiffGraph($r); |
|
} elsif($GoToPage eq 'PercentWrongGraph') { |
|
&Apache::lonproblemstatistics::BuildWrongGraph($r); |
|
} elsif($GoToPage eq 'Class list') { |
} elsif($GoToPage eq 'Class list') { |
$r->print(&BuildClasslist($cacheDB, $students, \@studentInformation, |
&BuildClasslist($cacheDB, $students, \@studentInformation, |
\@headings)); |
\@headings, $r); |
} |
} |
|
|
$r->print('</form>'."\n"); |
$r->print('</form>'."\n"); |