Diff for /loncom/homework/lonsimpleproblemedit.pm between versions 1.12 and 1.13

version 1.12, 2004/11/30 23:28:57 version 1.13, 2004/12/14 18:24:17
Line 33  use Apache::Constants qw(:common :http); Line 33  use Apache::Constants qw(:common :http);
 use Apache::loncommon;  use Apache::loncommon;
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::lonlocal;  use Apache::lonlocal;
   use Apache::lonnavmaps;
   
 my %qparms;  my %qparms;
 my $prefix;  my $prefix;
Line 127  sub foil { Line 128  sub foil {
 ENDFOIL  ENDFOIL
 }  }
   
   sub get_parent_uri {
       my ($cur_symb)=@_;
       my $navmap = Apache::lonnavmaps::navmap->new();
       my $it = $navmap->getIterator(undef, undef, undef, 1);
       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='.&Apache::lonnet::escape($symb).$anchor;
   }
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
   
Line 146  sub handler { Line 159  sub handler {
 # ----------------------------------------------------- Figure out where we are  # ----------------------------------------------------- Figure out where we are
     my $uri=$r->uri;      my $uri=$r->uri;
     $uri=~s/\/smpedit$//;      $uri=~s/\/smpedit$//;
     my $symb=&Apache::lonnet::symbread($uri);      my $symb=&Apache::lonnet::symbread();
   
 # ------------------------------------------------ Prefix for everything stored  # ------------------------------------------------ Prefix for everything stored
     $prefix=$ENV{'request.course.id'}.'.'.$symb.'.0.';      $prefix=$ENV{'request.course.id'}.'.'.$symb.'.0.';
Line 198  ENDDOCUMENT Line 211  ENDDOCUMENT
     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>'.   $r->print('<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'.
                 '<a href="'.$uri.'">'.&mt('Student View').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.').                  '<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.').
   &Apache::loncommon::help_open_topic('Caching').'</td></tr></table>');    &Apache::loncommon::help_open_topic('Caching').'</td></tr></table>');
  $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).

Removed from v.1.12  
changed lines
  Added in v.1.13


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>