--- loncom/interface/lonquickgrades.pm 2002/11/15 19:32:09 1.2
+++ loncom/interface/lonquickgrades.pm 2003/06/25 18:30:27 1.17
@@ -31,9 +31,15 @@ package Apache::lonquickgrades;
use strict;
use Apache::Constants qw(:common :http);
+use POSIX;
sub handler {
my $r = shift;
+ return real_handler($r);
+}
+
+sub real_handler {
+ my $r = shift;
&Apache::loncommon::get_unprocessed_cgi($ENV{QUERY_STRING});
@@ -57,82 +63,220 @@ sub handler {
&Apache::loncommon::no_cache($r);
$r->send_http_header;
+ my $showPoints = $ENV{'course.'.$ENV{'request.course.id'}.'.grading'} eq 'standard';
+
# Create the nav map
my $navmap = Apache::lonnavmaps::navmap->new(
$ENV{"request.course.fn"}.".db",
- $ENV{"request.course.fn"}."_parms.db", 1, 0);
+ $ENV{"request.course.fn"}."_parms.db", 1, 0, 1);
if (!defined($navmap)) {
my $requrl = $r->uri;
- $ENV{'user.error.msg'} = "$requrl:bre:0:0:Course not initialized";
+ $ENV{'user.error.msg'} = "$requrl:bre:0:0:Navamp initialization failed.";
return HTTP_NOT_ACCEPTABLE;
}
+
+ # Keep this hash in sync with %statusIconMap in lonnavmaps; they
+ # should match color/icon
+ my $res = $navmap->firstResource(); # temp resource to access constants
# Header
- $r->print(&Apache::loncommon::bodytag('Quick Score Display','',
- ''));
+ my $title = $showPoints ? "Quick Points Display" : "Quick Completed Problems Display";
+ $r->print(&Apache::loncommon::bodytag($title, '', ''));
+
+ if ($showPoints) {
+ $r->print(<
This may take a few moments to display.
"); + + $r->rflush(); $navmap->init(); # End navmap using boilerplate - # Col labels - $r->print(<Sequence | '); + $r->print('Done / Total |
$score / $avail | |
"); + + my $thisIndent = ''; + for (my $i = 1; $i < $depth; $i++) { $thisIndent .= $indentString; } + + $r->print("$thisIndent$title | "); + $r->print("$thisIndent | Total Points Scored: $total");
- $r->print(" Total Points Available: $totalAvailable"); - $r->print(" |