--- loncom/homework/optionresponse.pm 2001/05/31 22:34:33 1.9 +++ loncom/homework/optionresponse.pm 2001/06/02 03:59:59 1.11 @@ -10,7 +10,7 @@ sub BEGIN { } sub start_optionresponse { - my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result=''; #when in a radiobutton response use these &Apache::lonxml::register('Apache::optionresponse',('foilgroup','foil','conceptgroup')); @@ -49,7 +49,7 @@ sub start_foilgroup { } sub end_foilgroup { - my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result; if ($target ne 'meta') { @@ -99,9 +99,7 @@ sub end_foilgroup { sub getfoilcounts { my ($parstack,$safeeval)=@_; - my $rrargs =''; - if ( $#$parstack > 0 ) { $rrargs=$$parstack['-2']; } - my $max = &Apache::run::run("{$rrargs;".'return $max}',$safeeval); + my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2'); # +1 since instructors will count from 1 my $count = $#{ $Apache::response::foilgroup{'names'} }+1; return ($count,$max); @@ -160,7 +158,7 @@ sub start_conceptgroup { } sub end_conceptgroup { - my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; $Apache::optionresponse::conceptgroup=0; if ($target eq 'web' || $target eq 'grade') { my @names = @{ $Apache::response::conceptgroup{'names'} }; @@ -169,9 +167,7 @@ sub end_conceptgroup { push @{ $Apache::response::foilgroup{'names'} }, $name; $Apache::response::foilgroup{"$name.value"} = $Apache::response::conceptgroup{"$name.value"}; $Apache::response::foilgroup{"$name.text"} = $Apache::response::conceptgroup{"$name.text"}; - my $args; - if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; } - my $concept = &Apache::run::run("{$args;".'return $concept}',$safeeval); + my $concept = &Apache::lonxml::get_param('concept',$parstack,$safeeval); $Apache::response::foilgroup{"$name.concept"} = $concept; &Apache::lonxml::debug("Selecting $name in $concept"); } @@ -179,21 +175,19 @@ sub end_conceptgroup { } sub start_foil { - my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; if ($target eq 'web') { &Apache::lonxml::startredirection; } return ''; } sub end_foil { - my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $text =''; if ($target eq 'web') { $text=&Apache::lonxml::endredirection; } if ($target eq 'web' || $target eq 'grade') { - my $args =''; - if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; } - my $value = &Apache::run::run("{$args;".'return $value}',$safeeval); + my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval); if ($value ne 'unused') { - my $name = &Apache::run::run("{$args;".'return $name}',$safeeval); + my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); if ( $Apache::optionresponse::conceptgroup ) { push @{ $Apache::response::conceptgroup{'names'} }, $name; $Apache::response::conceptgroup{"$name.value"} = $value; @@ -206,9 +200,7 @@ sub end_foil { } } if ($target eq 'edit') { - my $args =''; - if ( $#$parstack > 1 ) { $args=$$parstack['-2']; } - my $options=&Apache::run::run("{$args;".'return $options}',$safeeval); + my $options= &Apache::lonxml::get_param('options',$parstack,$safeeval); if (!$options && $#$parstack > 2 ) { $args=$$parstack['-2']; } my @opt; #eval '@opt ='.