--- loncom/homework/optionresponse.pm 2001/01/19 21:44:51 1.1 +++ loncom/homework/optionresponse.pm 2001/02/22 00:49:03 1.4 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # option list style responses - +# 2/21 Guy package Apache::optionresponse; use strict; @@ -11,7 +11,7 @@ sub BEGIN { sub start_optionresponse { my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; #when in a radiobutton response use these - &Apache::lonxml::register('Apache::optionresponse',('foilgroup','foil')); + &Apache::lonxml::register('Apache::optionresponse',('foilgroup','foil','conceptgroup')); my $id = &Apache::response::start_response($parstack,$safeeval); return ''; } @@ -64,7 +64,7 @@ sub end_foilgroup { my $response = $ENV{'form.HWVAL_'.$Apache::inputtags::response['-1'].":$temp"}; $allresponse.="$response:"; if ( $response =~ /[^\s]/) { - &Apache::lonxml::debug("submitted a $response
\n"); + &Apache::lonxml::debug("submitted a $response
\n"); my $value=$Apache::response::foilgroup{$name.'.value'}; if ($value eq $response) {$right++;} else {$wrong++;} } @@ -137,13 +137,22 @@ sub displayfoils { return $result."
"; } +sub start_conceptgroup { +} + +sub end_conceptgroup { +} + sub start_foil { - $Apache::lonxml::redirection--; + my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; + if ($target eq 'web') { &Apache::lonxml::startredirection; } return ''; } sub end_foil { my ($target,$token,$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]; } @@ -152,14 +161,9 @@ sub end_foil { my $name = &Apache::run::run("{$args;".'return $name}',$safeeval); push @{ $Apache::response::foilgroup{'names'} }, $name; $Apache::response::foilgroup{"$name.value"} = $value; - $Apache::response::foilgroup{"$name.text"} = $Apache::lonxml::outputstack; + $Apache::response::foilgroup{"$name.text"} = $text; } } - - $Apache::lonxml::redirection++; - if ($Apache::lonxml::redirection == 1) { - $Apache::lonxml::outputstack=''; - } return ''; }