Diff for /loncom/homework/structuretags.pm between versions 1.442 and 1.451

version 1.442, 2009/04/06 13:29:02 version 1.451, 2009/06/11 16:48:28
Line 203  sub page_start { Line 203  sub page_start {
  }   }
     }      }
   
       my $pageheader = '';
     if (defined($found{'body'})) {      if (defined($found{'body'})) {
  $body_args{'skip_phases'}{'body'}=1;   $body_args{'skip_phases'}{'body'}=1;
     } elsif (!defined($found{'body'})       } elsif (!defined($found{'body'}) 
Line 211  sub page_start { Line 212  sub page_start {
     if ($env{'environment.remote'} ne 'off') {      if ($env{'environment.remote'} ne 'off') {
  $body_args{'only_body'}  = 1;   $body_args{'only_body'}  = 1;
     }      }
           # Breadcrumbs for Construction Space
           &Apache::lonhtmlcommon::clear_breadcrumbs();
           &Apache::lonhtmlcommon::add_breadcrumb({
               'text'  => 'Construction Space',
               'href'  => &Apache::loncommon::authorspace(),
           });
   # FIXME Where are we?
   #        &Apache::lonhtmlcommon::add_breadcrumb({
   #            'text'  => 'Problem Editing', # 'Problem Testing'
   #            'href'  => '',
   #        });
           $pageheader = &Apache::lonhtmlcommon::breadcrumbs()
                        .&Apache::loncommon::head_subbox(
                   &Apache::loncommon::CSTR_pageheader());
  }   }
     } elsif (!defined($found{'body'})) {      } elsif (!defined($found{'body'})) {
  my %add_entries;   my %add_entries;
Line 222  sub page_start { Line 237  sub page_start {
   
  my $bgcolor=&Apache::lonxml::get_param('bgcolor',$parstack,   my $bgcolor=&Apache::lonxml::get_param('bgcolor',$parstack,
        $safeeval);         $safeeval);
         if ($bgcolor eq '' ) { $bgcolor = '#FFFFFF'; }          if ($bgcolor eq '' ) { $bgcolor = '#FFFFFF'; }
   
  $body_args{'bgcolor'}        = $bgcolor;          $body_args{'bgcolor'}        = $bgcolor;
  $body_args{'no_title'}       = 1;          # $body_args{'no_title'}       = 1;
  $body_args{'force_register'} = 1;          $body_args{'force_register'} = 1;
  $body_args{'add_entries'}    = \%add_entries;          $body_args{'add_entries'}    = \%add_entries;
  if ($env{'environment.remote'} eq 'off'          if ($env{'environment.remote'} eq 'off'
     && $env{'request.state'} eq   'construct') {              && $env{'request.state'} eq   'construct') {
     $body_args{'only_body'}  = 1;              $body_args{'only_body'}  = 1;
  }          }
     }      }
     $body_args{'no_auto_mt_title'} = 1;      $body_args{'no_auto_mt_title'} = 1;
     my $page_start = &Apache::loncommon::start_page($name,$extra_head,      my $page_start = &Apache::loncommon::start_page($name,$extra_head,
     \%body_args);      \%body_args);
       $page_start .= $pageheader;
     if (!defined($found{'body'})       if (!defined($found{'body'}) 
  && $env{'request.state'} ne 'construct'   && $env{'request.state'} ne 'construct'
  && ($target eq 'web' || $target eq 'webgrade')) {   && ($target eq 'web' || $target eq 'webgrade')) {
Line 522  $show_all Line 537  $show_all
   
     $result.='      $result.='
    </div>     </div>
    <div class="LC_edit_problem_header_edit_row">';     <hr class="LC_edit_problem_divide" />
      <div>';
     $result.='<input type="hidden" name="problemmode" value="view" />';      $result.='<input type="hidden" name="problemmode" value="view" />';
     $result .= '<input type="button" name="submitmode" accesskey="e" value="'.&mt('Edit').'" '.      $result .= '<input type="button" name="submitmode" accesskey="e" value="'.&mt('Edit').'" '.
                'onclick="javascript:setmode(this.form,'."'edit'".')" />';                 'onclick="javascript:setmode(this.form,'."'edit'".')" />';
Line 530  $show_all Line 546  $show_all
                'onclick="javascript:setmode(this.form,'."'editxml'".')" />';                 'onclick="javascript:setmode(this.form,'."'editxml'".')" />';
     $result.='      $result.='
    </div>     </div>
      <hr class="LC_edit_problem_divide" />
    '.&Apache::lonxml::message_location().'     '.&Apache::lonxml::message_location().'
 </div>';  </div>';
     return $result;      return $result;
Line 674  sub checkout_msg { Line 691  sub checkout_msg {
     return (<<ENDCHECKOUT);      return (<<ENDCHECKOUT);
 <h2>$lt{'resource'}</h2>  <h2>$lt{'resource'}</h2>
     <p>$lt{'id_expln'}</p>      <p>$lt{'id_expln'}</p>
 <font color="red">  <p class="LC_warning">$lt{'warning'}</p>
 <p>$lt{'warning'}</p>  <form name="checkout" method="post" action="$uri">
 </font>  
 <form name="checkout" method="POST" action="$uri">  
 <input type="hidden" name="doescheckout" value="yes" />  <input type="hidden" name="doescheckout" value="yes" />
 <input type="button" name="checkoutbutton" value="$lt{'checkout'}" onClick="javascript:if (confirm('$lt{'checkout?'}')) { document.checkout.submit(); }" />  <input type="button" name="checkoutbutton" value="$lt{'checkout'}" onClick="javascript:if (confirm('$lt{'checkout?'}')) { document.checkout.submit(); }" />
 </form>  </form>
Line 711  sub firstaccess_msg { Line 726  sub firstaccess_msg {
     my $buttontext = &mt('Show Resource');      my $buttontext = &mt('Show Resource');
     my $timertext = &mt('Start Timer?');      my $timertext = &mt('Start Timer?');
     $result .= (<<ENDCHECKOUT);      $result .= (<<ENDCHECKOUT);
 <form name="markaccess" method="POST" action="$uri">  <form name="markaccess" method="post" action="$uri">
 <input type="hidden" name="markaccess" value="yes" />  <input type="hidden" name="markaccess" value="yes" />
 <input type="button" name="accessbutton" value="$buttontext" onClick="javascript:if (confirm('$timertext')) { document.markaccess.submit(); }" />  <input type="button" name="accessbutton" value="$buttontext" onClick="javascript:if (confirm('$timertext')) { document.markaccess.submit(); }" />
 </form>  </form>
Line 957  sub start_problem { Line 972  sub start_problem {
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $startminipage = ($env{'form.problem_split'}=~/yes/i)? ''   my $startminipage = ($env{'form.problem_split'}=~/yes/i)? ''
                     : '\begin{minipage}{\textwidth}';                      : '\begin{minipage}{\textwidth}';
  $result.='\begin{document}\noindent \vskip 1 mm '.   $result.='\noindent \vskip 1 mm '.
     $startminipage.'\vskip 0 mm';      $startminipage.'\vskip 0 mm';
  if ($status eq 'UNAVAILABLE') {   if ($status eq 'UNAVAILABLE') {
     $result.=&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'\vskip 0 mm ';      $result.=&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'\vskip 0 mm ';
Line 1058  sub end_problem { Line 1073  sub end_problem {
     $allow_print_points=0;      $allow_print_points=0;
  }   }
  my $name_of_resourse= &Apache::lonxml::latex_special_symbols(&get_resource_name($parstack,$safeeval),'header');   my $name_of_resourse= &Apache::lonxml::latex_special_symbols(&get_resource_name($parstack,$safeeval),'header');
  my $begin_doc='\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$env{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent ';   my $begin_doc=' \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$env{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent ';
  my $toc_line='\vskip 1 mm\noindent '.$startminipage.   my $toc_line='\vskip 1 mm\noindent '.$startminipage.
     '\addcontentsline{toc}{subsection}{'.$name_of_resourse.'}';      '\addcontentsline{toc}{subsection}{'.$name_of_resourse.'}';
   
Line 1068  sub end_problem { Line 1083  sub end_problem {
   
  my $duetime = &Apache::lonnet::EXT("resource.$id.duedate");    my $duetime = &Apache::lonnet::EXT("resource.$id.duedate"); 
  my $duedate = POSIX::strftime("%c",localtime($duetime));   my $duedate = POSIX::strftime("%c",localtime($duetime));
           my $duedate_text = &mt('Due date: [_1]'
                                 ,&Apache::lonlocal::locallocaltime($duetime));
  my $temp_file;   my $temp_file;
  my $filename = "/home/httpd/prtspool/$env{'user.name'}_$env{'user.domain'}_printout.due";   my $filename = "/home/httpd/prtspool/$env{'user.name'}_$env{'user.domain'}_printout.due";
   
Line 1099  sub end_problem { Line 1116  sub end_problem {
     if (not $env{'request.symb'} =~ m/\.page_/) {      if (not $env{'request.symb'} =~ m/\.page_/) {
  if(not $duedate=~m/1969/ and $Apache::lonhomework::type ne 'exam') {   if(not $duedate=~m/1969/ and $Apache::lonhomework::type ne 'exam') {
     $frontmatter .= $begin_doc.      $frontmatter .= $begin_doc.
  '\textit{Due date: '.$duedate.'} '.$toc_line;   '\textit{'.$duedate_text.'} '.$toc_line;
  } else {   } else {
     $frontmatter.= $begin_doc.$toc_line;      $frontmatter.= $begin_doc.$toc_line;
     if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';}      if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';}
  }   }
     } else {      } else {
  $frontmatter .= '\vskip 1mm\textit{Due date: '.$duedate.'} \\\\\\\\'.$startminipage;   $frontmatter .= '\vskip 1mm\textit{'.$duedate_text.'} \\\\\\\\'.$startminipage;
     }      }
  } else {   } else {
     if (not $env{'request.symb'} =~ m/\.page_/) {      if (not $env{'request.symb'} =~ m/\.page_/) {
Line 2034  sub start_simpleeditbutton { Line 2051  sub start_simpleeditbutton {
         my $url=$env{'request.noversionuri'};          my $url=$env{'request.noversionuri'};
         $url=~s/\?.*$//;          $url=~s/\?.*$//;
  my ($symb) = &Apache::lonnet::whichuser();   my ($symb) = &Apache::lonnet::whichuser();
 #       Warning make more sense and is more important on edit screen  #       Warning makes more sense and is more important on edit screen
 #       $result='<p class="LC_warning">'  #       $result='<p class="LC_warning">'
 #              .&mt('Note: it can take up to 10 minutes for changes to take effect for all users.')  #              .&mt('Note: it can take up to 10 minutes for changes to take effect for all users.')
 #              .&Apache::loncommon::help_open_topic('Caching')  #              .&Apache::loncommon::help_open_topic('Caching')
 #              .'</p>';  #              .'</p>';
         $result.=&Apache::lontemplate::start_functionslist()          $result.=&Apache::lonhtmlcommon::start_funclist()
                 .&Apache::lontemplate::item_functionslist(                  .&Apache::lonhtmlcommon::add_item_funclist(
                      '<a href="'.$url.'/smpedit?symb='.&escape($symb).'">'.&mt('Edit').'</a>')                       '<a href="'.$url.'/smpedit?symb='.&escape($symb).'">'
                 .&Apache::lontemplate::end_functionslist();                      .&mt('Edit').'</a>')
                   .&Apache::lonhtmlcommon::end_funclist();
   
     }      }
     return $result;      return $result;

Removed from v.1.442  
changed lines
  Added in v.1.451


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