--- loncom/homework/structuretags.pm 2000/07/25 21:27:30 1.1
+++ loncom/homework/structuretags.pm 2000/08/22 16:19:26 1.4
@@ -8,7 +8,7 @@ use strict;
use Apache::lonnet;
sub BEGIN {
- &Apache::lonxml::register('Apache::structuretags',('block'));
+ &Apache::lonxml::register('Apache::structuretags',('block','while'));
}
sub start_block {
@@ -17,9 +17,12 @@ sub start_block {
my $code = @$parstack[$#$parstack];
$code =~ s/\"//g;
$code .=';return $condition;';
+# print "
$code
";
my $result = &Apache::run::run($code,$safeeval);
if ( ! $result ) {
- my $skip=$parser->get_text("/block");
+# my $skip=$$parser[$#$parser]->get_text("/block");
+ my $skip=&Apache::lonxml::get_all_text("block",$$parser[$#$parser]);
+# print "skipped $skip";
}
return "";
}
@@ -27,5 +30,32 @@ sub start_block {
sub end_block {
}
+sub start_while {
+ my ($target,$token,$parstack,$parser,$safeeval)=@_;
+
+ my $code = @$parstack[$#$parstack];
+ $code =~ s/\"//g;
+ $code .=';return $condition;';
+
+ print "