Diff for /loncom/homework/structuretags.pm between versions 1.444.4.2.2.2 and 1.447

version 1.444.4.2.2.2, 2009/12/02 18:22:12 version 1.447, 2009/05/28 12:39:17
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;
     }      }
           $pageheader = &Apache::lonhtmlcommon::breadcrumbs() # FIXME add 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 226  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);
     unless ($env{'request.gcicontext'} eq 'buildtest') {      $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')) {
   
     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 419  sub problem_web_to_edit_header { Line 422  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 525  $show_all Line 526  $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 533  $show_all Line 535  $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 677  sub checkout_msg { Line 680  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 895  sub start_problem { Line 900  sub start_problem {
  if ($env{'request.state'} ne "construct" &&    if ($env{'request.state'} ne "construct" && 
     ($symb eq '' || $Apache::lonhomework::type eq 'practice')) {      ($symb eq '' || $Apache::lonhomework::type eq 'practice')) {
     $form_tag_start.='<input type="hidden" name="rndseed" value="'.      $form_tag_start.='<input type="hidden" name="rndseed" value="'.
  $rndseed.'" />';   $rndseed.'" />'.
             unless ($env{'request.gcicontext'} eq 'buildtest') {      '<input type="submit" name="resetdata"
  $form_tag_start .= '<input type="submit" name="resetdata"  
                              value="'.&mt('New Problem Variation').'" />';                               value="'.&mt('New Problem Variation').'" />';
             }  
     if (exists($env{'form.username'})) {      if (exists($env{'form.username'})) {
  $form_tag_start.=   $form_tag_start.=
     '<input type="hidden" name="username"      '<input type="hidden" name="username"
                              value="'.$env{'form.username'}.'" />';                               value="'.$env{'form.username'}.'" />';
     }      }
             unless ($env{'request.gcicontext'} eq 'buildtest') {      if ($env{'request.role.adv'}) {
                 if ($env{'request.role.adv'}) {   $form_tag_start.=
                     $form_tag_start.= ' <label class="LC_nobreak">'      ' <label><input type="checkbox" name="showallfoils"';
                              .'<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.= ' />'.&mt('&nbsp;Show&nbsp;All&nbsp;Foils').
                     $form_tag_start.= ' /> '      '</label>';
                                      .&mt('Show All Foils')  
                                      .'</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();
             }              }
             unless ($env{'request.gcicontext'} eq 'buildtest') {      $form_tag_start.='<hr />';
         $form_tag_start.='<hr />';  
             }  
  }   }
   
  ($status,$accessmsg,my $slot_name,my $slot) =    ($status,$accessmsg,my $slot_name,my $slot) = 
Line 1074  sub end_problem { Line 1072  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 1109  sub end_problem { Line 1105  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) { $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{'.$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_/) {

Removed from v.1.444.4.2.2.2  
changed lines
  Added in v.1.447


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