Diff for /loncom/homework/structuretags.pm between versions 1.505 and 1.507

version 1.505, 2012/04/18 11:49:50 version 1.507, 2012/05/28 20:31:11
Line 1162  sub start_problem { Line 1162  sub start_problem {
     my $accessmsg;      my $accessmsg;
   
     my $name= &get_resource_name($parstack,$safeeval);      my $name= &get_resource_name($parstack,$safeeval);
     my ($result,$form_tag_start);      my ($result,$form_tag_start,$slot_name,$slot);
   
       if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
           $target eq 'tex') {
           if ($env{'form.markaccess'}) {
               my @interval=&Apache::lonnet::EXT("resource.0.interval");
               &Apache::lonnet::set_first_access($interval[1]);
           }
   
           ($status,$accessmsg,$slot_name,$slot) =
               &Apache::lonhomework::check_slot_access('0','problem');
           push (@Apache::inputtags::status,$status);
       }
   
     if ($target eq 'web' || $target eq 'webgrade' || $target eq 'tex'      if ($target eq 'web' || $target eq 'webgrade' || $target eq 'tex'
  || $target eq 'edit') {   || $target eq 'edit') {
  ($result,$form_tag_start) =   ($result,$form_tag_start) =
Line 1175  sub start_problem { Line 1188  sub start_problem {
     if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval,$target); }      if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval,$target); }
     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||      if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
  $target eq 'tex') {   $target eq 'tex') {
  if ($env{'form.markaccess'}) {  
     my @interval=&Apache::lonnet::EXT("resource.0.interval");  
     &Apache::lonnet::set_first_access($interval[1]);  
  }  
  my $resource_due =  &Apache::lonhomework::due_date(0, $env{'request.symb'});  
  my $time_left = $resource_due - time();  
  if ($resource_due && ($time_left > 0) && ($target eq 'web')) {  
     $result .= &Apache::lonhtmlcommon::set_due_date($resource_due);  
  }  
   
               if ($status eq 'CAN_ANSWER') {
         ($status,$accessmsg,my $slot_name,my $slot) =              my $resource_due =  &Apache::lonhomework::due_date(0, $env{'request.symb'});
             &Apache::lonhomework::check_slot_access('0','problem');              my $time_left = $resource_due - time();
         push (@Apache::inputtags::status,$status);              if ($resource_due && ($time_left > 0) && ($target eq 'web')) {
                   $result .= &Apache::lonhtmlcommon::set_due_date($resource_due);
               }
           }
   
  #handle rand seed in construction space   #handle rand seed in construction space
  my $rndseed=&setup_rndseed($safeeval,$target);   my $rndseed=&setup_rndseed($safeeval,$target);
Line 1490  sub end_problem { Line 1497  sub end_problem {
  $result.="</form>";   $result.="</form>";
     }      }
     if ($target eq 'web') {      if ($target eq 'web') {
  $result.= &Apache::loncommon::end_page({'discussion' => 1});                  #
                   # Closing </body></html> not added by end_page().
                   # Added separately at end of this routine, after added
                   # <script></script> so document will be valid xhtml.
                   #
    $result.= &Apache::loncommon::end_page({'discussion' => 1,
    'notbody'    => 1});
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $endminipage = '';   my $endminipage = '';
  if (not $env{'form.problem_split'}=~/yes/) {   if (not $env{'form.problem_split'}=~/yes/) {
Line 1548  sub end_problem { Line 1561  sub end_problem {
     #      #
     if ($target eq 'web') {      if ($target eq 'web') {
         $result .= &Apache::lonhtmlcommon::set_compute_end_time();          $result .= &Apache::lonhtmlcommon::set_compute_end_time();
           #
           # Closing tags delayed so any <script></script> tags 
           # not in head can appear inside body, for valid xhtml.
           # 
           $result .= "</body>\n</html>";
     }      }
     return $result;      return $result;
 }  }

Removed from v.1.505  
changed lines
  Added in v.1.507


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