--- loncom/homework/optionresponse.pm 2001/06/11 16:13:53 1.13 +++ loncom/homework/optionresponse.pm 2001/06/12 22:42:55 1.14 @@ -17,7 +17,7 @@ sub start_optionresponse { push (@Apache::lonxml::namespace,'optionresponse'); my $id = &Apache::response::start_response($parstack,$safeeval); if ($target eq 'edit') { - $result.=" + $result.=&Apache::edit::start_table($token)."
Multiple Option Response Question
Multiple Option Response Question Delete:". &Apache::edit::deletelist($target,$token) ."
\n"; @@ -53,13 +53,13 @@ sub start_foilgroup { my $option; my @opt; eval '@opt ='. &Apache::lonxml::get_param('options',$parstack,$safeeval); - + my $count=0; foreach $option (@opt) { - $optionlist.="\n"; + $optionlist.="\n"; } my $insertlist=&Apache::edit::insertlist($target,$token); + $result.=&Apache::edit::start_table($token); $result.= (<
Select Options Add new Option: @@ -73,23 +73,32 @@ ENDTABLE } if ($target eq 'modified') { my @options; + my $optchanged=0; eval '@options ='.&Apache::lonxml::get_param('options',$parstack,$safeeval); + if ($ENV{"form.$Apache::lonxml::curdepth.deleteopt"}) { + my $delopt=$ENV{"form.$Apache::lonxml::curdepth.deleteopt"}; + splice(@options,$delopt,1); + $optchanged=1; + } if ($ENV{"form.$Apache::lonxml::curdepth.options"}) { my $newopt = $ENV{"form.$Apache::lonxml::curdepth.options"}; - $newopt =~ s/\'/\\\'/g; if ($options[0]) { - push(@options,$ENV{"form.$Apache::lonxml::curdepth.options"}); + push(@options,$newopt); } else { - $options[0]=$ENV{"form.$Apache::lonxml::curdepth.options"}; + $options[0]=$newopt; } + $optchanged=1; + } + if ($optchanged) { $result = "". + "Correct Option:
"; } return $result; } @@ -262,8 +276,8 @@ sub end_foil { sub insert_foil { return ' - - + + '; } 1;