--- loncom/homework/optionresponse.pm 2001/05/31 22:34:33 1.9 +++ loncom/homework/optionresponse.pm 2001/06/01 15:56:49 1.10 @@ -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); @@ -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"); } @@ -189,11 +185,9 @@ sub end_foil { 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 ='.