--- loncom/homework/optionresponse.pm	2001/06/26 21:41:58	1.18
+++ loncom/homework/optionresponse.pm	2001/08/13 21:44:24	1.23
@@ -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)."<tr><td>Multiple Option Response Question</td>
-<td>Delete:".
-  &Apache::edit::deletelist($target,$token)
-    ."</td><td>&nbsp;</td></tr><tr><td colspan=\"3\">\n";
-    $result.=&Apache::edit::text_arg('Max Number Of Foils:','max',$token,'4')."</td></tr>";
+    $result.=&Apache::edit::start_table($token).
+      "<tr><td>Multiple Option Response Question</td><td>Delete:".
+	&Apache::edit::deletelist($target,$token)
+	  ."</td><td>&nbsp;</td></tr><tr><td colspan=\"3\">\n";
+    $result.=&Apache::edit::text_arg('Max Number Of Foils:','max',$token,'4').
+      "</td></tr>";
     $result.="<tr><td colspan=\"3\">\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;
 }
 
@@ -40,14 +45,6 @@ sub end_optionresponse {
   return $result;
 }
 
-sub insert_optionresponse {
-  return '
-<optionresponse max="10">
-    <foilgroup options=\"\">
-    </foilgroup>
-</optionresponse>';
-}
-
 %Apache::response::foilgroup={};
 sub start_foilgroup {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
@@ -274,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).
-      '</td></tr><tr><td colspan="3">';
+    $result.=&Apache::edit::text_arg('Name:','name',$token);
+    $result.= &Apache::edit::select_or_text_arg('Correct Option:','value',['unused',(@opt)],$token,'15');
+    $result .= '</td></tr><tr><td colspan="3">';
   }
   if ($target eq 'modified') {
     my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'value','name');