--- loncom/homework/bridgetask.pm 2006/11/27 20:42:42 1.208 +++ loncom/homework/bridgetask.pm 2006/11/27 23:24:36 1.209 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.208 2006/11/27 20:42:42 albertel Exp $ +# $Id: bridgetask.pm,v 1.209 2006/11/27 23:24:36 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1285,7 +1285,12 @@ DONEBUTTON [@_]); $criteria = &layout_webgrade_Criteria($dim,$id,$criteria); my $internal_location=&internal_location($id); - $result=~s/\Q$internal_location\E/$criteria/; + if ($result =~ m/\Q$internal_location\E/) { + $result=~s/\Q$internal_location\E/$criteria/; + } else { + $result.=$criteria; + } + } } $result.=""; @@ -2065,7 +2070,7 @@ sub start_Setup { my $dim = &get_id($parstack,$safeeval); push(@Apache::bridgetask::dimension,$dim); &Apache::lonxml::startredirection(); - return &internal_location($dim); + return;# &internal_location($dim); } { @@ -2289,8 +2294,20 @@ sub end_Dimension { } } if ($result !~ /^\s*$/s) { - $result = "\n".'
'. - "\n".$result."\n
\n"; + # FIXME? this maybe unneccssary in the future, (CSE101 BT + # from Fall 2006 geenrate a div that attempts to hide some + # of the output in an odd way, this is a workaround so + # those old ones will continue to work. # It puts the + # LC_question div to come after any starting closie div + # that the dimension produces + if ($result =~ m{\s*}) { + $result =~ s{(\s*)} + {$1\n
}; + } else { + $result = "\n".'
'. + "\n".$result; + } + $result .= "\n
\n"; } } elsif ($target eq 'webgrade') { # in case of any side effects that we need @@ -2314,7 +2331,11 @@ sub end_Dimension { [@_]); $criteria = &layout_webgrade_Criteria($dim,$id,$criteria); my $internal_location=&internal_location($id); - $result=~s/\Q$internal_location\E/$criteria/; + if ($result =~ m/\Q$internal_location\E/) { + $result =~ s/\Q$internal_location\E/$criteria/; + } else { + $result.=$criteria ; + } } } if (&nest()) {