Diff for /loncom/homework/structuretags.pm between versions 1.311 and 1.312

version 1.311, 2005/11/03 12:20:54 version 1.312, 2005/11/03 17:55:12
Line 422  sub firstaccess_msg { Line 422  sub firstaccess_msg {
 ENDCHECKOUT  ENDCHECKOUT
 }  }
   
 # initializes the problem globals across the inputtags, lonhomework, and   
 # structuretags modules.  
 #  
 #   
 sub init_problem_globals {  sub init_problem_globals {
     my ($type)=@_;      my ($type)=@_;
     #initialize globals      #initialize globals
Line 500  sub start_problem { Line 496  sub start_problem {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   
     # We'll use the redirection to fix up printing of duedates.      # We'll use the redirection to fix up printing of duedates.
       &Apache::lonxml::startredirection();
     &Apache::lonxml::startredirection;  
   
     # Problems don't nest and we don't allow more than one <problem> in      # Problems don't nest and we don't allow more than one <problem> in
     # a .problem file.      # a .problem file.
Line 674  sub start_problem { Line 669  sub start_problem {
     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.'}';
   
     #  Figure out what the due date is and if we need to print it in the problem header.      #  Figure out what the due date is and if we need to print
     #  We have been logging the last due date written to file.        #  it in the problem header.  We have been logging the
     #      #  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 $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";
   
     # Figure out what the last printed due date is or set it to the epoch if no duedates      # Figure out what the last printed due date is or set it
     # have been printed.      # to the epoch if no duedates have been printed.
   
     my $due_file_content = 0;      #   If the file does not yet exist, time is the epoch.      my $due_file_content = 0;      #   If the file does not yet exist, time is the epoch.
     if (-e $filename) {      if (-e $filename) {
Line 694  sub start_problem { Line 688  sub start_problem {
  $due_file_content = $due_file[$#due_file];   $due_file_content = $due_file[$#due_file];
  chomp $due_file_content;   chomp $due_file_content;
     }       } 
     # The big change; Due do the comparison on   
     # the absolute time rather than textual time since that is format independent.      # comparisons of the absolute times
     #  
     if ($due_file_content != $duetime) {      if ($due_file_content != $duetime) {
  $temp_file = Apache::File->new('>'.$filename);   $temp_file = Apache::File->new('>'.$filename);
  print $temp_file "$duetime\n";   print $temp_file "$duetime\n";
Line 739  sub start_problem { Line 732  sub start_problem {
   
 sub end_problem {  sub end_problem {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $result= &Apache::lonxml::endredirection; # This captures the entire <problem>.... body.      my $result= &Apache::lonxml::endredirection(); # started in &start_problem
   
     my $status=$Apache::inputtags::status['-1'];      my $status=$Apache::inputtags::status['-1'];
     if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||      if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||
Line 1180  sub ordered_show_check { Line 1173  sub ordered_show_check {
   
 sub start_part {  sub start_part {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     &Apache::lonxml::startredirection; # we'll use redirection to fix up duedates.      &Apache::lonxml::startredirection(); # we'll use redirection to fix up 
                                            # duedates.
     my $result='';      my $result='';
     my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval);      my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval);
     if ($id =~ /^\s*$/) { $id = $Apache::lonxml::curdepth; }      if ($id =~ /^\s*$/) { $id = $Apache::lonxml::curdepth; }
Line 1289  sub end_part { Line 1283  sub end_part {
     my $status=$Apache::inputtags::status['-1'];      my $status=$Apache::inputtags::status['-1'];
     my $hidden=&Apache::loncommon::check_if_partid_hidden($Apache::inputtags::part);      my $hidden=&Apache::loncommon::check_if_partid_hidden($Apache::inputtags::part);
     my $in_order_show=&ordered_show_check();      my $in_order_show=&ordered_show_check();
     my $result= &Apache::lonxml::endredirection; # $resutl has entire <part> body.      my $result= &Apache::lonxml::endredirection(); # started in &start_part
     if ( $target eq 'meta' ) {      if ($target eq 'grade') {
  $result.='';  
     } elsif ($target eq 'grade') {  
  if (($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode) &&   if (($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode) &&
     !$hidden && $in_order_show) {      !$hidden && $in_order_show) {
     $result.=&Apache::inputtags::grade;      $result.=&Apache::inputtags::grade;

Removed from v.1.311  
changed lines
  Added in v.1.312


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