--- loncom/homework/structuretags.pm 2000/11/29 00:51:57 1.17 +++ loncom/homework/structuretags.pm 2000/12/01 00:44:48 1.18 @@ -36,6 +36,7 @@ sub start_problem { } my $name = &Apache::run::run("{$args;".'return $name}',$safeeval); $Apache::inputtags::part='0'; + @Apache::inputtags::responselist = (); my $expression='$external::part='.$Apache::inputtags::part.';'; $safeeval->share_from('Apache::inputtags',['@part']); &Apache::run::run($expression,$safeeval); @@ -47,9 +48,12 @@ sub end_problem { my ($target,$token,$parstack,$parser,$safeeval)=@_; my $result=''; unless ($target eq 'meta') { - $result="\n"; + if ( $target eq 'web' && $Apache::inputtags::part eq '0') { + $result.=&Apache::inputtags::grade; + } + $result.="\n"; } else { - if ($Apache::inputtags::part ne '0') { + if ($Apache::inputtags::part eq '0') { $result=&Apache::response::mandatory_part_meta; } } @@ -165,6 +169,7 @@ sub start_part { if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; } my $id = &Apache::run::run("{$args;".'return $id}',$safeeval); $Apache::inputtags::part=$id; + @Apache::inputtags::responselist = (); if ($target eq 'meta') { return &Apache::response::mandatory_part_meta; } @@ -172,6 +177,12 @@ sub start_part { sub end_part { my ($target,$token,$parstack,$parser,$safeeval)=@_; + &Apache::lonxml::debug("in end_part $target "); + if ( $target eq 'meta' ) { + return ''; + } + my $result=&Apaceh::inputtags::grade; + return $result; } 1;