version 1.65, 2003/03/25 22:20:25
|
version 1.68, 2003/05/12 22:07:17
|
Line 51 Main handler for statistics and chart.
|
Line 51 Main handler for statistics and chart.
|
use Apache::lonproblemstatistics; |
use Apache::lonproblemstatistics; |
use Apache::lonstudentassessment; |
use Apache::lonstudentassessment; |
use Apache::lonpercentage; |
use Apache::lonpercentage; |
|
use Apache::lonmysql; |
=over 4 |
=over 4 |
|
|
=cut |
=cut |
Line 82 use Apache::lonproblemanalysis();
|
Line 82 use Apache::lonproblemanalysis();
|
use Apache::lonproblemstatistics(); |
use Apache::lonproblemstatistics(); |
use Apache::lonstudentassessment(); |
use Apache::lonstudentassessment(); |
use Apache::lonpercentage; |
use Apache::lonpercentage; |
|
use Apache::lonmysql; |
use Time::HiRes; |
use Time::HiRes; |
|
|
####################################################### |
####################################################### |
Line 239 sub PrepareClasslist {
|
Line 240 sub PrepareClasslist {
|
} |
} |
|
|
# |
# |
|
# get the status requested |
|
my $requested_status = 'Active'; |
|
$requested_status = $ENV{'form.Status'} if (exists($ENV{'form.Status'})); |
|
# |
# Process the classlist |
# Process the classlist |
while (my ($student,$student_data) = each (%$classlist)) { |
while (my ($student,$student_data) = each (%$classlist)) { |
my $studenthash = (); |
my $studenthash = (); |
Line 265 sub PrepareClasslist {
|
Line 270 sub PrepareClasslist {
|
# |
# |
# Only put in the list those students we are interested in |
# Only put in the list those students we are interested in |
foreach my $sect (@SelectedSections) { |
foreach my $sect (@SelectedSections) { |
if (($sect eq 'all') || ($section eq $sect)) { |
if ( (($sect eq 'all') || |
|
($section eq $sect)) && |
|
(($studenthash->{'status'} eq $requested_status) || |
|
($requested_status eq 'Any')) |
|
){ |
push (@Students,$studenthash); |
push (@Students,$studenthash); |
last; |
last; |
} |
} |
Line 831 sub CreateMainMenu {
|
Line 840 sub CreateMainMenu {
|
# |
# |
$Str .= '<table border="0"><tbody><tr>'."\n"; |
$Str .= '<table border="0"><tbody><tr>'."\n"; |
$Str .= '<td></td>'."\n"; |
$Str .= '<td></td>'."\n"; |
|
$Str .= '<td></td>'."\n"; |
$Str .= '<td align="center"><b>Select a Report</b></td>'."\n"; |
$Str .= '<td align="center"><b>Select a Report</b></td>'."\n"; |
$Str .= '<td align="center"><b>Student Status</b></td></tr>'."\n"; |
|
$Str .= '<tr>'."\n"; |
$Str .= '<tr>'."\n"; |
# |
# |
$Str .= '<td align="center"><input type="submit" name="Refresh" '; |
$Str .= '<td align="center">'. |
$Str .= 'value="Update Display" /></td>'."\n"; |
'<input type="submit" name="Refresh" value="Update Display" />'. |
|
"</td>\n"; |
|
$Str .= '<td align="center">'. |
|
'<input type="submit" name="ClearCache" value="Clear Caches" />'. |
|
"</td>\n"; |
# |
# |
$Str .= '<td align="center">'; |
$Str .= '<td align="center">'; |
$Str .= '<select name="reportSelected" >'."\n"; |
$Str .= '<select name="reportSelected" >'."\n"; |
Line 849 sub CreateMainMenu {
|
Line 862 sub CreateMainMenu {
|
} |
} |
$Str .= '</select></td>'."\n"; |
$Str .= '</select></td>'."\n"; |
# |
# |
$Str .= '<td align="center">'; |
|
$Str .= &Apache::lonhtmlcommon::StatusOptions($status, 'Statistics'); |
|
$Str .= '</td>'."\n"; |
|
# |
|
$Str .= '</tr></tbody></table>'."\n"; |
$Str .= '</tr></tbody></table>'."\n"; |
$Str .= '<hr>'."\n"; |
$Str .= '<hr>'."\n"; |
# |
# |
Line 908 sub handler {
|
Line 917 sub handler {
|
$r->print(&Apache::lonhtmlcommon::Title('Course Statistics and Charts')); |
$r->print(&Apache::lonhtmlcommon::Title('Course Statistics and Charts')); |
$r->rflush(); |
$r->rflush(); |
# |
# |
|
if (! &Apache::lonmysql::verify_sql_connection()) { |
|
my $serveradmin = $r->dir_config('lonAdmEMail'); |
|
$r->print(<<END); |
|
<h2><font color="Red">Unable to connect to database!</font></h2> |
|
<p> |
|
Please notify the server administrator <b>$serveradmin</b>. |
|
</p><p> |
|
Course Statistics and Charts cannot be retrieved until the database is |
|
restarted. Your data is intact but cannot be displayed at this time. |
|
</p> |
|
</body> |
|
</html> |
|
END |
|
return; |
|
} |
|
# |
|
# Clean out the caches |
|
if (exists($ENV{'form.ClearCache'})) { |
|
&Apache::loncoursedata::delete_caches($ENV{'requres.course.id'}); |
|
} |
|
# |
# Set up the statistics and chart environment |
# Set up the statistics and chart environment |
&PrepareClasslist($r); |
&PrepareClasslist($r); |
&PrepareCourseData($r); |
&PrepareCourseData($r); |
Line 919 sub handler {
|
Line 949 sub handler {
|
# Print main menu |
# Print main menu |
my %reports = ('classlist' => 'Class list', |
my %reports = ('classlist' => 'Class list', |
'problem_statistics' => 'Problem Statistics', |
'problem_statistics' => 'Problem Statistics', |
'student_assessment' => 'Student Assessment', |
'student_assessment' => 'Problem Status Chart', |
'percentage' => 'Correct-problems Plot', |
'percentage' => 'Correct-problems Plot', |
'option_response' => 'Option Response Analysis', |
'option_response' => 'Option Response Analysis', |
# 'activitylog' => 'Activity Log', |
# 'activitylog' => 'Activity Log', |