version 1.48, 2009/05/16 23:21:00
|
version 1.49.6.1, 2014/05/22 12:44:24
|
Line 25
|
Line 25
|
# |
# |
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
# Created Nov. 14, 2002 by Jeremy Bowers |
|
|
|
package Apache::lonquickgrades; |
package Apache::lonquickgrades; |
|
|
use strict; |
use strict; |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http REDIRECT); |
use POSIX; |
use POSIX; |
use Apache::loncommon; |
use Apache::loncommon; |
use Apache::lonlocal; |
use Apache::lonlocal; |
Line 45 sub handler {
|
Line 44 sub handler {
|
sub real_handler { |
sub real_handler { |
my $r = shift; |
my $r = shift; |
|
|
|
# Check for critical messages and redirect if present. |
|
my ($redirect,$url) = &Apache::loncommon::critical_redirect(300); |
|
if ($redirect) { |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->header_out(Location => $url); |
|
return REDIRECT; |
|
} |
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{QUERY_STRING}); |
&Apache::loncommon::get_unprocessed_cgi($ENV{QUERY_STRING}); |
|
|
# Handle header-only request |
# Handle header-only request |
Line 65 sub real_handler {
|
Line 72 sub real_handler {
|
my $showPoints = |
my $showPoints = |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'standard'; |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'standard'; |
my $notshowSPRSlink = |
my $notshowSPRSlink = |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'external'; |
(($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'external') |
|
|| ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals')); |
|
my $notshowTotals= |
|
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals'; |
|
|
# Create the nav map |
# Create the nav map |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
Line 234 sub real_handler {
|
Line 244 sub real_handler {
|
if ($totalAttempted) { |
if ($totalAttempted) { |
$title .= " / " . &mt("Attempted"); |
$title .= " / " . &mt("Attempted"); |
} |
} |
$r->print("<th>$title / ".&mt('Total').'</td>' |
$r->print("<th>$title".($notshowTotals?'':" / ".&mt('Total')).'</th>' |
.&Apache::loncommon::end_data_table_header_row()); |
.&Apache::loncommon::end_data_table_header_row()); |
while ($depth > 0) { |
while ($depth > 0) { |
if ($curRes == $iterator->BEGIN_MAP()) {$depth++;} |
if ($curRes == $iterator->BEGIN_MAP()) {$depth++;} |
Line 262 sub real_handler {
|
Line 272 sub real_handler {
|
$r->print('<td valign="top">' |
$r->print('<td valign="top">' |
.$thisIndent |
.$thisIndent |
.'<span class="LC_nobreak">' |
.'<span class="LC_nobreak">' |
.$correct.' / '.$attempted.' / '.$total |
.$correct.' / '.$attempted.($notshowTotals?'':' / '.$total) |
.'</span></td>' |
.'</span></td>' |
.&Apache::loncommon::end_data_table_row() |
.&Apache::loncommon::end_data_table_row() |
); |
); |
Line 270 sub real_handler {
|
Line 280 sub real_handler {
|
$r->print('<td valign="top">' |
$r->print('<td valign="top">' |
.$thisIndent |
.$thisIndent |
.'<span class="LC_nobreak">' |
.'<span class="LC_nobreak">' |
.$correct.' / '.$total |
.$correct.($notshowTotals?'':' / '.$total) |
.'</span></td>' |
.'</span></td>' |
.&Apache::loncommon::end_data_table_row()); |
.&Apache::loncommon::end_data_table_row()); |
} |
} |