--- loncom/homework/optionresponse.pm 2001/06/27 18:51:59 1.19 +++ loncom/homework/optionresponse.pm 2001/09/13 19:55:02 1.24 @@ -17,17 +17,22 @@ sub start_optionresponse { push (@Apache::lonxml::namespace,'optionresponse'); my $id = &Apache::response::start_response($parstack,$safeeval); if ($target eq 'edit') { - $result.=&Apache::edit::start_table($token)."Multiple Option Response Question -Delete:". - &Apache::edit::deletelist($target,$token) - ." \n"; - $result.=&Apache::edit::text_arg('Max Number Of Foils:','max',$token,'4').""; + $result.=&Apache::edit::start_table($token). + "Multiple Option Response QuestionDelete:". + &Apache::edit::deletelist($target,$token) + ." \n"; + $result.=&Apache::edit::text_arg('Max Number Of Foils:','max',$token,'4'). + ""; $result.="\n"; } if ($target eq 'modified') { - my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'max'); + my $constructtag=&Apache::edit::get_new_args($token,$parstack, + $safeeval,'max'); if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } } + if ($target eq 'meta') { + $result=&Apache::response::meta_package_write('optionresponse'); + } return $result; } @@ -192,7 +197,7 @@ sub displayfoils { foreach $option (@opt) { $optionlist.="\n"; } - if ($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/ ) { + if (($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/) || ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER')) { foreach $name (@whichopt) { $result.="
".$Apache::response::foilgroup{$name.'.value'}. ":".$Apache::response::foilgroup{$name.'.text'}."\n"; @@ -266,9 +271,9 @@ sub start_foil { if ($$tagstack['-2'] eq 'conceptgroup') { $level = '-3'; } my @opt; eval '@opt ='.&Apache::lonxml::get_param('options',$parstack,$safeeval,$level); - $result.=&Apache::edit::text_arg('Name:','name',$token). - &Apache::edit::select_arg('Correct Option:','value',['unused',(@opt)],$token). - ''; + $result.=&Apache::edit::text_arg('Name:','name',$token); + $result.= &Apache::edit::select_or_text_arg('Correct Option:','value',['unused',(@opt)],$token,'15'); + $result .= ''; } if ($target eq 'modified') { my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'value','name');