version 1.130, 2002/11/03 19:16:19
|
version 1.131, 2002/11/06 22:58:36
|
Line 481 sub end_library {
|
Line 481 sub end_library {
|
} |
} |
|
|
sub start_block { |
sub start_block { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
|
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') { |
my $result; |
my $code = @$parstack[$#$parstack]; |
|
$code =~ s/\"//g; |
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || |
$code .=';return $condition;'; |
$target eq 'tex' || $target eq 'analyze') { |
# print "<br />$code<br />"; |
my $code = @$parstack[$#$parstack]; |
my $result = &Apache::run::run($code,$safeeval); |
if ($code) { |
&Apache::lonxml::debug("block :$code: returned :$result:"); |
$code =~ s/\"//g; |
if ( ! $result ) { |
$code .=';return $condition;'; |
my $skip=&Apache::lonxml::get_all_text("/block",$$parser[$#$parser]); |
$result = &Apache::run::run($code,$safeeval); |
&Apache::lonxml::debug("skipping ahead :$skip: $$parser[$#$parser]"); |
&Apache::lonxml::debug("block :$code: returned :$result:"); |
|
} else { |
|
$result='1'; |
|
} |
|
if ( ! $result ) { |
|
my $skip=&Apache::lonxml::get_all_text("/block",$$parser[-1]); |
|
&Apache::lonxml::debug("skipping ahead :$skip: $$parser[-1]"); |
|
} |
|
$result=''; |
|
} elsif ($target eq 'edit') { |
|
$result .=&Apache::edit::tag_start($target,$token); |
|
$result .=&Apache::edit::text_arg('Test Condition:','condition', |
|
$token,40); |
|
$result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
|
} elsif ($target eq 'modified') { |
|
my $constructtag=&Apache::edit::get_new_args($token,$parstack, |
|
$safeeval,'condition'); |
|
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } |
} |
} |
} |
return $result; |
return ""; |
|
} |
} |
|
|
sub end_block { |
sub end_block { |