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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 29 Mar 2006 13:24:43 -0000


albertel		Wed Mar 29 08:24:43 2006 EDT

  Modified files:              
    /loncom/homework	bridgetask.pm 
  Log:
  - need to do endredir only for <task> <IntroParagraph>
  
  
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.127 loncom/homework/bridgetask.pm:1.128
--- loncom/homework/bridgetask.pm:1.127	Tue Mar 28 23:53:42 2006
+++ loncom/homework/bridgetask.pm	Wed Mar 29 08:24:43 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.127 2006/03/29 04:53:42 albertel Exp $
+# $Id: bridgetask.pm,v 1.128 2006/03/29 13:24:43 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1874,8 +1874,11 @@
 	if ($tagstack->[-2] eq 'Dimension') {
 	    $dimension{'intro'}=&Apache::lonxml::get_all_text('/introparagraph',$parser,$style);
 	
-	} elsif ($target eq 'webgrade') {
+	} elsif ($tagstack->[-2] eq 'Task' && $target eq 'webgrade') {
 	    &Apache::lonxml::startredirection();
+	} else {
+	    &Apache:;lonxml::error("Invalid use of <IntroParagraph> inside of <".$tagstack->[-2].">");
+	    &Apache::lonxml::get_all_text('/introparagraph',$parser,$style);
 	}
 	
     }
@@ -1884,7 +1887,7 @@
 
 sub end_IntroParagraph {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    if ($target eq 'webgrade') {
+    if ($tagstack->[-2] eq 'Task' && $target eq 'webgrade') {
 	my $result = &Apache::lonxml::endredirection();
     }
 }