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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 25 Nov 2002 21:19:45 -0000


albertel		Mon Nov 25 16:19:45 2002 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  - end_part was poping the status stack to soon
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.138 loncom/homework/structuretags.pm:1.139
--- loncom/homework/structuretags.pm:1.138	Fri Nov 22 14:46:36 2002
+++ loncom/homework/structuretags.pm	Mon Nov 25 16:19:45 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.138 2002/11/22 19:46:36 albertel Exp $
+# $Id: structuretags.pm,v 1.139 2002/11/25 21:19:45 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -695,17 +695,19 @@
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   &Apache::lonxml::debug("in end_part $target ");
   my $status=$Apache::inputtags::status['-1'];
-  pop @Apache::inputtags::status;
-  if ( $target eq 'meta' ) { return ''; }
-  if ( $target eq 'grade' && $status eq 'CAN_ANSWER') {
-    return &Apache::inputtags::grade;
-  }
-  if ($target eq 'web' || $target eq 'tex' ) {
-    my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,$target);
+  my $result='';
+  if ( $target eq 'meta' ) {
+      $result='';
+  } elsif ( $target eq 'grade' && $status eq 'CAN_ANSWER') {
+    $result=&Apache::inputtags::grade;
+  } elsif ($target eq 'web' || $target eq 'tex' ) {
+    my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,
+						    $target);
     if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';}
-    return $gradestatus;
+    $result=$gradestatus;
   }
-  return '';
+  pop @Apache::inputtags::status;
+  return $result;
 }
 
 sub start_preduedate {