version 1.19, 2006/06/30 01:16:41
|
version 1.23, 2009/06/11 16:48:28
|
Line 143 ENDFOIL
|
Line 143 ENDFOIL
|
sub get_parent_uri { |
sub get_parent_uri { |
my ($cur_symb)=@_; |
my ($cur_symb)=@_; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $it = $navmap->getIterator(undef, undef, undef, 1); |
if (defined($navmap)) { |
while ( my $res=$it->next()) { |
my $it = $navmap->getIterator(undef, undef, undef, 1); |
if (ref($res) && $res->symb() eq $cur_symb) { last; } |
while ( my $res=$it->next()) { |
|
if (ref($res) && $res->symb() eq $cur_symb) { last; } |
|
} |
|
my ($src,$symb,$anchor)=&Apache::lonnavmaps::getLinkForResource($it->getStack()); |
|
if (defined($anchor)) { $anchor='#'.$anchor; } |
|
return $src.'?symb='.&escape($symb).$anchor; |
} |
} |
my ($src,$symb,$anchor)=&Apache::lonnavmaps::getLinkForResource($it->getStack()); |
return; |
if (defined($anchor)) { $anchor='#'.$anchor; } |
|
return $src.'?symb='.&escape($symb).$anchor; |
|
} |
} |
|
|
sub handler { |
sub handler { |
Line 219 sub handler {
|
Line 222 sub handler {
|
$spell_header)); |
$spell_header)); |
if ($symb) { |
if ($symb) { |
$r->print('<h1>'.&Apache::lonnet::gettitle($symb).'</h1>'); |
$r->print('<h1>'.&Apache::lonnet::gettitle($symb).'</h1>'); |
$r->print('<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'. |
my $displaylink = &get_parent_uri($symb); |
'<a href="'.&get_parent_uri($symb).'">'.&mt('Student View').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.'). |
if ($displaylink ne '') { |
&Apache::loncommon::help_open_topic('Caching').'</td></tr></table>'); |
my $functions=&Apache::lonhtmlcommon::start_funclist() |
|
.&Apache::lonhtmlcommon::add_item_funclist( |
|
'<a href="'.$displaylink.'">' |
|
.&mt('Student View').'</a>') |
|
.&Apache::lonhtmlcommon::end_funclist(); |
|
$r->print(&Apache::loncommon::head_subbox($functions)); |
|
} else { |
|
$r->print('<p class="LC_error">' |
|
.&mt('An error occurred retrieving the link to this problem.') |
|
.'<br />' |
|
.&mt('You may need to [_1]re-select the course[_2] and then return to this resource to view it.' |
|
,'<a href="/adm/roles">','</a>') |
|
.'</p>' |
|
); |
|
} |
|
$r->print('<p class="LC_warning">' |
|
.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.') |
|
.&Apache::loncommon::help_open_topic('Caching') |
|
.'</p>' |
|
); |
|
|
$r->print('<table border="2" bgcolor="#FFFFFF" width="100%"><tr><td>'. |
$r->print('<table border="2" bgcolor="#FFFFFF" width="100%"><tr><td>'. |
&rawrendering($symb). |
&rawrendering($symb). |
'</td></tr></table><br />'); |
'</td></tr></table><br />'); |
$r->print('<form name="simpleedit" method="POST">'); |
$r->print('<form name="simpleedit" method="post">'); |
# Question Type |
# Question Type |
my %questiontypes=('radio' => |
my %questiontypes=('radio' => |
'1 out of N multiple choice (radio button)', |
'1 out of N multiple choice (radio button)', |