[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 25 Jun 2002 14:50:53 -0000


sakharuk		Tue Jun 25 10:50:53 2002 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  corrected to take into account that resources
  take care of themselves.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.97 loncom/homework/structuretags.pm:1.98
--- loncom/homework/structuretags.pm:1.97	Fri Jun 21 16:27:54 2002
+++ loncom/homework/structuretags.pm	Tue Jun 25 10:50:53 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.97 2002/06/21 20:27:54 albertel Exp $
+# $Id: structuretags.pm,v 1.98 2002/06/25 14:50:53 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -203,7 +203,7 @@
     &page_start($target,$token,$tagstack,$parstack,$parser,$safeeval);
   if ($target eq 'tex' and $ENV{'request.symb'} =~ m/\.page_/) { $result = '';}
 
-  if ($target eq 'web' || $target eq 'grade' || $target eq 'answer') {
+  if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') {
     #handle exam checkout
     if ($Apache::lonhomework::type eq 'exam') {
       my $token=$Apache::lonhomework::history{"resource.0.outtoken"};
@@ -283,7 +283,16 @@
 	$result.=$head_tag_start.
 	  "<title>$name</title></head>\n$body_tag_start\n";
       }
-    }
+  } elsif ($target eq 'tex') {
+      my $id = $Apache::inputtags::part;
+      my $duedate = &Apache::lonnet::EXT("resource.$id.duedate"); 
+      $duedate = POSIX::strftime("%c",localtime($duedate));
+      if (not $ENV{'request.symb'} =~ m/\.page_/) {
+	  $result .= '\begin{document} \noindent\fbox{Due date: '.$duedate.'} \\vskip 1 mm';	  
+      } else {
+	  $result .= '\begin{minipage}{\minipagewidth} ';
+      }
+  }
   } elsif ($target eq 'edit') {
     $result.=$head_tag_start."</head>".$body_tag_start.
       '<form name="lonhomework" method="POST" action="'.
@@ -301,12 +310,6 @@
   } elsif ($target eq 'modified') {
     $result=$token->[4];
     $result.=&Apache::edit::handle_insert();
-  } elsif ($target eq 'tex') {
-      if (not $ENV{'request.symb'} =~ m/\.page_/) {
-	  $result .= '\begin{document} ';
-      } else {
-	  $result .= '\begin{minipage}{\minipagewidth} ';
-      }
   } else {
     # page_start returned a starting result, delete it if we don't need it
     $result = '';