version 1.36, 2002/06/24 14:28:10
|
version 1.45, 2002/09/02 18:25:55
|
Line 278 sub addresource {
|
Line 278 sub addresource {
|
} |
} |
my $brepriv=&Apache::lonnet::allowed('bre',$resource); |
my $brepriv=&Apache::lonnet::allowed('bre',$resource); |
if ($hash{'src_'.$rid}) { |
if ($hash{'src_'.$rid}) { |
if ((($brepriv eq '2') && (!$hash{'randomout_'.$rid})) |
if (($brepriv eq '2') || ($brepriv eq 'F')) { |
|| ($brepriv eq 'F')) { |
|
my $pprefix=''; |
my $pprefix=''; |
if ($resource=~/\.(problem|exam|quiz|assess|survey|form)$/) { |
if ($resource=~/\.(problem|exam|quiz|assess|survey|form)$/) { |
$pprefix=&astatus($rid); |
$pprefix=&astatus($rid); |
Line 340 sub tracetable {
|
Line 339 sub tracetable {
|
my ($sofar,$rid,$beenhere,$showtypes,$indent,$linkid)=@_; |
my ($sofar,$rid,$beenhere,$showtypes,$indent,$linkid)=@_; |
my $newshowtypes=$showtypes; |
my $newshowtypes=$showtypes; |
my $further=$sofar; |
my $further=$sofar; |
#$Apache::lonxml::debug=1; |
# $Apache::lonxml::debug=1; |
&Apache::lonxml::debug("$rid ; $linkid ; $sofar ; $beenhere ; ".$hash{'src_'.$rid}); |
&Apache::lonxml::debug("$rid ; $linkid ; $sofar ; $beenhere ; ".$hash{'src_'.$rid}); |
if ($beenhere=~/\&$rid\&/) { return $further; } |
if ($beenhere=~/\&$rid\&/) { return $further; } |
$beenhere.=$rid.'&'; |
$beenhere.=$rid.'&'; |
Line 412 sub handler {
|
Line 411 sub handler {
|
if ($ENV{'request.course.fn'}) { |
if ($ENV{'request.course.fn'}) { |
$fn=$ENV{'request.course.fn'}; |
$fn=$ENV{'request.course.fn'}; |
if (-e "$fn.db") { |
if (-e "$fn.db") { |
if ((tie(%hash,'GDBM_File',"$fn.db",&GDBM_READER,0640)) && |
if ((tie(%hash,'GDBM_File',"$fn.db",&GDBM_READER(),0640)) && |
(tie(%parmhash,'GDBM_File', |
(tie(%parmhash,'GDBM_File', |
$ENV{'request.course.fn'}.'_parms.db', |
$ENV{'request.course.fn'}.'_parms.db', |
&GDBM_READER,0640))) { |
&GDBM_READER(),0640))) { |
$hashtied=1; |
$hashtied=1; |
} |
} |
} |
} |
Line 435 sub handler {
|
Line 434 sub handler {
|
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
|
|
my $firstres=$hash{'map_start_/res/'.$ENV{'request.course.uri'}}; |
my $firstres=$hash{'map_start_'. |
my $lastres=$hash{'map_finish_/res/'.$ENV{'request.course.uri'}}; |
&Apache::lonnet::clutter($ENV{'request.course.uri'})}; |
|
my $lastres=$hash{'map_finish_'. |
|
&Apache::lonnet::clutter($ENV{'request.course.uri'})}; |
if (!(($firstres) && ($lastres))) { |
if (!(($firstres) && ($lastres))) { |
$r->print('<html><body>Coursemap undefined.</body></html>'); |
$r->print('<html><body>Coursemap undefined.</body></html>'); |
} else { |
} else { |
Line 490 sub handler {
|
Line 491 sub handler {
|
|
|
@rows=(); |
@rows=(); |
|
|
&tracetable(0,$firstres,'&'.$lastres.'&','',0); |
&tracetable(0,$firstres,'&','',0); |
if ($hash{'src_'.$lastres}) { |
|
my $brepriv=&Apache::lonnet::allowed('bre',$hash{'src_'.$lastres}); |
|
if (($brepriv eq '2') || ($brepriv eq 'F')) { |
|
$rows[$#rows+1]=''.$lastres; |
|
} |
|
} |
|
|
|
# ------------------------------------------------------------------ Page parms |
# ------------------------------------------------------------------ Page parms |
|
|
Line 568 sub handler {
|
Line 563 sub handler {
|
} |
} |
} |
} |
# ----------------------------------------------------------- Start Page Output |
# ----------------------------------------------------------- Start Page Output |
$r->print('<html><head><title>Navigate LON-CAPA Maps</title></head>'); |
my $bodytagadd=''; |
$r->print('<body bgcolor="#FFFFFF"'); |
$r->print( |
|
'<html><head><title>Navigate Course Map</title></head>'); |
if (($currenturl=~/^\/res/) && |
if (($currenturl=~/^\/res/) && |
($currenturl!~/^\/res\/adm/)) { |
($currenturl!~/^\/res\/adm/)) { |
$r->print(' onLoad="window.location.hash='."'curloc'".'"'); |
$bodytagadd='onLoad="window.location.hash='."'curloc'".'"'; |
} |
} |
$r->print('><script>window.focus();</script>'. |
$r->print(&Apache::loncommon::bodytag('Navigate Course Map','', |
'<img align=right src=/adm/lonIcons/lonlogos.gif>'. |
$bodytagadd)); |
'<h1>Navigate Course Map</h1>'. |
$r->print('<script>window.focus();</script>'); |
"<h3>$date</h3>"); |
my $desc=$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; |
|
if (defined($desc)) { $r->print("<h2>$desc</h2>\n"); } |
|
$r->print("<h3>$date</h3>\n"); |
$r->rflush(); |
$r->rflush(); |
$r->print('<img src="/adm/lonMisc/chat.gif"> New discussion since '. |
$r->print('<img src="/adm/lonMisc/chat.gif"> New discussion since '. |
localtime($lastcheck). |
localtime($lastcheck). |
Line 609 sub handler {
|
Line 607 sub handler {
|
$r->print("\n<tr>"); |
$r->print("\n<tr>"); |
my @colcont=split(/\&/,$rows[$i]); |
my @colcont=split(/\&/,$rows[$i]); |
my $avespan=$lcm/($#colcont+1); |
my $avespan=$lcm/($#colcont+1); |
|
|
|
# for each item I wish to print on this row... |
for ($j=0;$j<=$#colcont;$j++) { |
for ($j=0;$j<=$#colcont;$j++) { |
my $indent;my $indentstr; |
my $indent;my $indentstr; |
my $linkid; |
my $linkid; |
my $rid=$colcont[$j]; |
my $rid=$colcont[$j]; |
|
|
|
# bug? $rid can't accept a list of two elements |
$rid=~/(\d+)\.(\d+)$/; |
$rid=~/(\d+)\.(\d+)$/; |
my $src= |
my $src= |
&Apache::lonnet::declutter($hash{'src_'.$1.'.'.$2}); |
&Apache::lonnet::declutter($hash{'src_'.$1.'.'.$2}); |
Line 650 sub handler {
|
Line 652 sub handler {
|
} elsif ($code eq '4') { |
} elsif ($code eq '4') { |
$add='<td bgcolor="#E0FFAA">'; |
$add='<td bgcolor="#E0FFAA">'; |
} else { |
} else { |
$add='<td bgcolor="#FFAAAA">'; |
$add='<td bgcolor="#CCCCFF">'; |
if ($tcode eq '2') { |
if ($tcode eq '2') { |
$add='<td bgcolor="#FFFFAA">'; |
$add='<td bgcolor="#FFFFAA">'; |
} |
} |
Line 711 sub handler {
|
Line 713 sub handler {
|
for(my $i=-1;$i<$indent;$i++) { $indentstr.=$is; } |
for(my $i=-1;$i<$indent;$i++) { $indentstr.=$is; } |
} |
} |
if (!$linkid) { $linkid=$rid; } |
if (!$linkid) { $linkid=$rid; } |
|
if ($hash{'randomout_'.$rid}) { |
|
$adde=' <i>(hidden)</i>'.$adde; |
|
} |
$r->print($add.$indentstr); |
$r->print($add.$indentstr); |
if ($rid) { |
if ($rid) { |
$r->print('<a href="'.$hash{'src_'.$linkid}. |
$r->print('<a href="'.$hash{'src_'.$linkid}. |
'?symb='.&Apache::lonnet::escape($symb) |
(($hash{'src_'.$linkid}=~/\?/)?'&':'?'). |
|
'symb='.&Apache::lonnet::escape($symb) |
.'">'. |
.'">'. |
$hwk.$hash{'title_'.$rid}.$hwke.'</a>'); |
$hwk.$hash{'title_'.$rid}.$hwke.'</a>'); |
} |
} |