--- loncom/interface/lonnavmaps.pm 2004/08/29 03:55:24 1.281 +++ loncom/interface/lonnavmaps.pm 2005/11/22 18:58:37 1.349.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.281 2004/08/29 03:55:24 albertel Exp $ +# $Id: lonnavmaps.pm,v 1.349.2.1 2005/11/22 18:58:37 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -30,12 +30,16 @@ package Apache::lonnavmaps; use strict; +use GDBM_File; use Apache::Constants qw(:common :http); use Apache::loncommon(); use Apache::lonmenu(); +use Apache::lonenc(); use Apache::lonlocal; +use Apache::lonnet; use POSIX qw (floor strftime); -use Data::Dumper; # for debugging, not always used +use Data::Dumper; # for debugging, not always +use Time::HiRes qw( gettimeofday tv_interval ); # symbolic constants sub SYMB { return 1; } @@ -53,6 +57,7 @@ my %statusIconMap = $resObj->CLOSED => '', $resObj->OPEN => 'navmap.open.gif', $resObj->CORRECT => 'navmap.correct.gif', + $resObj->PARTIALLY_CORRECT => 'navmap.ellipsis.gif', $resObj->INCORRECT => 'navmap.wrong.gif', $resObj->ATTEMPTED => 'navmap.ellipsis.gif', $resObj->ERROR => '' @@ -77,21 +82,28 @@ my %colormap = $resObj->OPEN => '', $resObj->NOTHING_SET => '', $resObj->ATTEMPTED => '', - $resObj->ANSWER_SUBMITTED => '' + $resObj->ANSWER_SUBMITTED => '', + $resObj->PARTIALLY_CORRECT => '#006600' ); # And a special case in the nav map; what to do when the assignment # is not yet done and due in less then 24 hours my $hurryUpColor = "#FF0000"; sub launch_win { - my ($mode,$script,$toplinkitems)=@_; + my ($mode,$script,$toplinkitems,$firsttime)=@_; my $result; if ($script ne 'no') { $result.=' +MENU + } + } + if ($ENV{QUERY_STRING} eq 'turningOffExternal') { + $env{'environment.remotenavmap'}='off'; } # Create the nav map @@ -225,20 +235,21 @@ ENDSUBM 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:Course not initialized"; return HTTP_NOT_ACCEPTABLE; } - - $r->print("
\n"); + $r->send_http_header; + my $html=&Apache::lonxml::xmlbegin(); + $r->print("$html\n"); $r->print("".&mt("Uncompleted Homework")."
"); - $ENV{'form.filter'} = ''; - $ENV{'form.condition'} = 1; + $env{'form.filter'} = ''; + $env{'form.condition'} = 1; $resource_no_folder_link = 1; } else { &add_linkitem(\%toplinkitems,'uncompleted', - 'location.href="navmaps?sort='.$ENV{'form.sort'}. + 'location.href="navmaps?sort='.$env{'form.sort'}. '&showOnlyHomework=1"', "Show Only Uncompleted Homework"); } - my %selected=($ENV{'form.sort'} => 'selected=on'); + my %selected=($env{'form.sort'} => 'selected=on'); my $sort_html=(""); # renderer call - &Apache::lonnet::logthis(join(':',keys(%toplinkitems))); - my $renderArgs = { 'cols' => [0,2,3], - 'sort' => $ENV{'form.sort'}, + my $renderArgs = { 'cols' => [0,1,2,3], + 'sort' => $env{'form.sort'}, 'url' => '/adm/navmaps', 'navmap' => $navmap, 'suppressNavmap' => 1, @@ -410,7 +421,6 @@ ENDSUBM 'caller' => 'navmapsdisplay', 'linkitems' => \%toplinkitems}; my $render = render($renderArgs); - $navmap->untieHashes(); # If no resources were printed, print a reassuring message so the # user knows there was no error. @@ -421,6 +431,8 @@ ENDSUBM $r->print("This course is empty.
"); } } + #my $td=&tv_interval($t0); + #$r->print("