--- loncom/interface/lonnavmaps.pm 2001/01/06 13:45:37 1.2 +++ loncom/interface/lonnavmaps.pm 2001/01/16 22:19:18 1.7 @@ -45,8 +45,20 @@ sub tracetable { $beenhere.=$rid.'&'; if (defined($hash{'is_map_'.$rid})) { + $sofar++; + my $tprefix=''; + if ($hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$rid}}} + eq 'sequence') { + $tprefix='h'; + } + if (defined($rows[$sofar])) { + $rows[$sofar].='&'.$tprefix.$rid; + } else { + $rows[$sofar]=$tprefix.$rid; + } if ((defined($hash{'map_start_'.$hash{'src_'.$rid}})) && - (defined($hash{'map_finish_'.$hash{'src_'.$rid}}))) { + (defined($hash{'map_finish_'.$hash{'src_'.$rid}})) && + ($tprefix eq 'h')) { my $frid=$hash{'map_finish_'.$hash{'src_'.$rid}}; $sofar= &tracetable($sofar,$hash{'map_start_'.$hash{'src_'.$rid}}, @@ -55,10 +67,14 @@ sub tracetable { if ($hash{'src_'.$frid}) { my $brepriv=&Apache::lonnet::allowed('bre',$hash{'src_'.$frid}); if (($brepriv eq '2') || ($brepriv eq 'F')) { + my $pprefix=''; + if ($hash{'src_'.$frid}=~/\.problem$/) { + $pprefix='p1'; + } if (defined($rows[$sofar])) { - $rows[$sofar].='&'.$frid; + $rows[$sofar].='&'.$pprefix.$frid; } else { - $rows[$sofar]=$frid; + $rows[$sofar]=$pprefix.$frid; } } } @@ -68,10 +84,14 @@ sub tracetable { if ($hash{'src_'.$rid}) { my $brepriv=&Apache::lonnet::allowed('bre',$hash{'src_'.$rid}); if (($brepriv eq '2') || ($brepriv eq 'F')) { + my $pprefix=''; + if ($hash{'src_'.$rid}=~/\.problem$/) { + $pprefix='p1'; + } if (defined($rows[$sofar])) { - $rows[$sofar].='&'.$rid; + $rows[$sofar].='&'.$pprefix.$rid; } else { - $rows[$sofar]=$rid; + $rows[$sofar]=$pprefix.$rid; } } } @@ -146,23 +166,10 @@ sub handler { } } -# ------------------------------------------------------------ Add to symb list - - my $i; - my %symbhash=(); - for ($i=0;$i<=$#rows;$i++) { - if ($rows[$i]) { - my @colcont=split(/\&/,$rows[$i]); - map { - $symbhash{$hash{'src_'.$_}}=''; - } @colcont; - } - } - &Apache::lonnet::symblist($requrl,%symbhash); - # ------------------------------------------------------------------ Page parms my $j; + my $i; my $lcm=1; my $contents=0; @@ -176,6 +183,7 @@ sub handler { } } + unless ($contents) { $r->content_type('text/html'); $r->send_http_header; @@ -191,8 +199,9 @@ sub handler { 'Navigate LON-CAPA Maps'); $r->print(''. + ''. '

Navigate Course Map

'); - + $r->rflush(); # ----------------------------------------------------------------- Start table $r->print(''); for ($i=0;$i<=$#rows;$i++) { @@ -202,10 +211,32 @@ sub handler { my $avespan=$lcm/($#colcont+1); for ($j=0;$j<=$#colcont;$j++) { my $rid=$colcont[$j]; - $r->print(''); + my $add=''; + my $hwk=''; + my $hwke=''; + if ($rid=~/^h(.+)/) { + $rid=$1; + $add=''; + } + if ($rid=~/^p(\d)(.+)/) { + my $code=$1; + $rid=$2; + $hwk=''; + if ($code eq '2') { + $hwk=''; + $hwke=''; + } + if ($code eq '3') { + $hwk=''; + } elsif ($code eq '4') { + $hwk=''; + } + } + $r->print($add.''.$hwk. + $hash{'title_'.$rid}.$hwke.''.$adde); } $r->print(''); } @@ -232,6 +263,7 @@ sub handler { } } } + $ENV{'user.error.msg'}="$requrl:bre:0:0:Course not initialized"; return HTTP_NOT_ACCEPTABLE; }
'. - $hash{'title_'.$rid}.''); - $r->print('  '; + my $adde=''; + $adde='