--- loncom/homework/structuretags.pm 2001/05/13 20:01:34 1.37
+++ loncom/homework/structuretags.pm 2001/05/31 22:37:56 1.39
@@ -64,9 +64,7 @@ sub start_problem {
}
}
if ($target eq 'web') {
- my $args ='';
- if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
- my $name = &Apache::run::run("{$args;".'return $name}',$safeeval);
+ my $name= &Apache::lonxml::get_param('name',$parstack,$safeeval);
if ($name eq '') {
$name=&Apache::lonnet::EXT('resource.title');
if ($name eq 'con_lost') { $name = ''; }
@@ -95,7 +93,7 @@ sub start_problem {
';
- my $temp=&Apache::edit::insertlist($token,$target);
+ my $temp=&Apache::edit::insertlist($target,$token);
$result.=$temp;
return $result;
}
@@ -131,7 +129,6 @@ sub end_problem {
}
if ($target eq 'meta') {
if ($Apache::inputtags::part eq '0') {
-
$result=&Apache::response::mandatory_part_meta;
}
}
@@ -145,20 +142,23 @@ sub end_problem {
sub start_block {
my ($target,$token,$parstack,$parser,$safeeval)=@_;
- my $code = @$parstack[$#$parstack];
- $code =~ s/\"//g;
- $code .=';return $condition;';
-# print "
$code
";
- my $result = &Apache::run::run($code,$safeeval);
- &Apache::lonxml::debug("block :$code: returned :$result:");
- if ( ! $result ) {
- my $skip=&Apache::lonxml::get_all_text("/block",$$parser[$#$parser]);
- &Apache::lonxml::debug("skipping ahead :$skip: $$parser[$#$parser]");
+ if ($target eq 'web' || $target eq 'grade') {
+ my $code = @$parstack[$#$parstack];
+ $code =~ s/\"//g;
+ $code .=';return $condition;';
+ # print "
$code
";
+ my $result = &Apache::run::run($code,$safeeval);
+ &Apache::lonxml::debug("block :$code: returned :$result:");
+ if ( ! $result ) {
+ my $skip=&Apache::lonxml::get_all_text("/block",$$parser[$#$parser]);
+ &Apache::lonxml::debug("skipping ahead :$skip: $$parser[$#$parser]");
+ }
}
return "";
}
sub end_block {
+ return '';
}
sub start_while {
@@ -247,9 +247,7 @@ sub end_randomlist {
sub start_part {
my ($target,$token,$parstack,$parser,$safeeval)=@_;
- my $args ='';
- if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
- my $id = &Apache::run::run("{$args;".'return $id}',$safeeval);
+ my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval);
$Apache::inputtags::part=$id;
@Apache::inputtags::responselist = ();
if ($target eq 'meta') {