Diff for /loncom/homework/structuretags.pm between versions 1.444.4.6 and 1.445

version 1.444.4.6, 2010/02/10 21:06:07 version 1.445, 2009/05/15 14:48:35
Line 225  sub page_start { Line 225  sub page_start {
         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'
Line 243  sub page_start { Line 243  sub page_start {
   
  my ($symb,undef,undef,undef,$publicuser)= &Apache::lonnet::whichuser();   my ($symb,undef,undef,undef,$publicuser)= &Apache::lonnet::whichuser();
  if ($symb eq '' && !$publicuser) {   if ($symb eq '' && !$publicuser) {
             $page_start .= '<p class="LC_info">'      my $help = &Apache::loncommon::help_open_topic("Ambiguous_Reference");
                           .&mt('Browsing resource, all submissions are temporary.')      $help=&mt("Browsing resource, all submissions are temporary.")."<br />";
                           .'</p>';      $page_start .= $help;
         }   }
     }      }
   
     if (!defined($found{'body'}) && $env{'request.state'} ne 'construct') {      if (!defined($found{'body'}) && $env{'request.state'} ne 'construct') {
Line 256  sub page_start { Line 256  sub page_start {
     my $form_tag_start;      my $form_tag_start;
     if (!defined($found{'form'})) {      if (!defined($found{'form'})) {
  $form_tag_start='<form name="lonhomework" enctype="multipart/form-data" method="post" action="';   $form_tag_start='<form name="lonhomework" enctype="multipart/form-data" method="post" action="';
         my $uri = Apache::loncommon::inhibit_menu_check(   my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'});
                 &Apache::lonenc::check_encrypt($env{'request.uri'}));  
         $uri = &HTML::Entities::encode($uri,'<>&"');  
  $form_tag_start.=$uri.'" ';   $form_tag_start.=$uri.'" ';
  if ($target eq 'edit') {   if ($target eq 'edit') {
     $form_tag_start.=&Apache::edit::form_change_detection();      $form_tag_start.=&Apache::edit::form_change_detection();
Line 420  sub problem_web_to_edit_header { Line 418  sub problem_web_to_edit_header {
     '</div>';      '</div>';
     }      }
           
     my $show_all_foils_text =      my $show_all_foils_text = 
         ($Apache::lonhomework::parsing_a_task) ?   ($Apache::lonhomework::parsing_a_task) ?
         &mt('Show All Instances')   &mt('&nbsp;Show&nbsp;All&nbsp;Instances')
         : &mt('Show All Foils');   : &mt('&nbsp;Show&nbsp;All&nbsp;Foils');
   
     my $show_all= '<span class="LC_nobreak"><label for="showallfoils">'      my $show_all= '<span class="LC_nobreak"><label><input type="checkbox" name="showallfoils"';
                  .'<input type="checkbox" name="showallfoils"';  
     if (defined($env{'form.showallfoils'})) { $show_all.=' checked="checked"'; }      if (defined($env{'form.showallfoils'})) { $show_all.=' checked="checked"'; }
     $show_all.= ' /> '.$show_all_foils_text      $show_all.= ' />'.$show_all_foils_text.'</label></span>';
                .'</label></span>';  
   
   
   
Line 678  sub checkout_msg { Line 674  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>
 <p class="LC_warning">$lt{'warning'}</p>  <font color="red">
   <p>$lt{'warning'}</p>
   </font>
 <form name="checkout" method="post" action="$uri">  <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(); }" />
Line 904  sub start_problem { Line 902  sub start_problem {
     '<input type="hidden" name="username"      '<input type="hidden" name="username"
                              value="'.$env{'form.username'}.'" />';                               value="'.$env{'form.username'}.'" />';
     }      }
             if ($env{'request.role.adv'}) {      if ($env{'request.role.adv'}) {
                 $form_tag_start.= ' <label class="LC_nobreak">'   $form_tag_start.=
                          .'<input type="checkbox" name="showallfoils"';      ' <label><input type="checkbox" name="showallfoils"';
                 if (defined($env{'form.showallfoils'})) {   if (defined($env{'form.showallfoils'})) {
                     $form_tag_start.=' checked="checked"';      $form_tag_start.=' checked="checked"';
                 }   }
                 $form_tag_start.= ' /> '   $form_tag_start.= ' />'.&mt('&nbsp;Show&nbsp;All&nbsp;Foils').
                                  .&mt('Show All Foils')      '</label>';
                                  .'</label>';  
   
     }      }
             if ($Apache::lonhomework::type eq 'practice') {              if ($Apache::lonhomework::type eq 'practice') {
                 $form_tag_start.=&practice_problem_header();                  $form_tag_start.=&practice_problem_header();
Line 1070  sub end_problem { Line 1066  sub end_problem {
  #  it in the problem header.  We have been logging the   #  it in the problem header.  We have been logging the
  #  last due date written to file.    #  last due date written to file. 
   
  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 1105  sub end_problem { Line 1099  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{'.$duedate_text.'} '.$toc_line;   '\textit{Due date: '.$duedate.'} '.$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) {      if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';}
                         $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';  
                     }  
  }   }
     } else {      } else {
  $frontmatter .= '\vskip 1mm\textit{'.$duedate_text.'} \\\\\\\\'.$startminipage;   $frontmatter .= '\vskip 1mm\textit{Due date: '.$duedate.'} \\\\\\\\'.$startminipage;
     }      }
  } else {   } else {
     if (not $env{'request.symb'} =~ m/\.page_/) {      if (not $env{'request.symb'} =~ m/\.page_/) {
  $frontmatter .= $begin_doc.$toc_line;   $frontmatter .= $begin_doc.$toc_line;
                 if (($Apache::lonhomework::type eq 'exam') and ($allow_print_points==1)) {   if (($Apache::lonhomework::type eq 'exam') and ($allow_print_points==1)) { $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';}
                     $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';  
                 }  
     } else {      } else {
  $frontmatter .= '\vskip 1mm \\\\\\\\'.$startminipage;   $frontmatter .= '\vskip 1mm \\\\\\\\'.$startminipage;
     }      }
Line 1762  sub start_part { Line 1752  sub start_part {
     '.disableexampointprint'}) eq 'yes') {      '.disableexampointprint'}) eq 'yes') {
  $allow_print_points=0;   $allow_print_points=0;
     }      }
                     if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) {       if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';}
                         $result .= '\vskip 10mm\fbox{\textit{'.$weight.' pt}}';  
                     }  
  } elsif ($target eq 'web') {   } elsif ($target eq 'web') {
     $result.='<a name="'.&escape($Apache::inputtags::part).'" />';      $result.='<a name="'.&escape($Apache::inputtags::part).'" />';
  }   }
Line 2051  sub start_simpleeditbutton { Line 2039  sub start_simpleeditbutton {
 #              .&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 .= '<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'.          $result.=&Apache::lontemplate::start_functionslist()
                    '<a href="'.$url.'/smpedit?symb='.&escape($symb).'">'.                  .&Apache::lontemplate::item_functionslist(
                    &mt('Edit').'</a></td></tr></table><br />';                       '<a href="'.$url.'/smpedit?symb='.&escape($symb).'">'.&mt('Edit').'</a>')
                   .&Apache::lontemplate::end_functionslist();
   
     }      }
     return $result;      return $result;

Removed from v.1.444.4.6  
changed lines
  Added in v.1.445


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