--- loncom/homework/edit.pm	2004/06/03 16:42:02	1.82
+++ loncom/homework/edit.pm	2004/10/26 15:06:58	1.88
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # edit mode helpers
 #
-# $Id: edit.pm,v 1.82 2004/06/03 16:42:02 www Exp $
+# $Id: edit.pm,v 1.88 2004/10/26 15:06:58 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -68,10 +68,9 @@ sub tag_start {
 #    "</tr><tr><td colspan=\"3\">\n";
 	my @help = Apache::lonxml::helpinfo($token);
 	if ($help[0]) {
-	    $result .= '<td align="right" valign="top">' .
-		Apache::loncommon::help_open_topic(@help) .
-		'</td>';
-	} else { $result .= "<td>&nbsp;</td>"; }
+	    $result .= '</td><td align="right" valign="top">' .
+		Apache::loncommon::help_open_topic(@help);
+	} else { $result .= "</td><td>&nbsp;"; }
 	$result .= &end_row().&start_spanning_row();
     }
     return $result;
@@ -191,7 +190,7 @@ sub get_insert_list {
 		$descrip."</option>\n";
 	}
 	foreach my $option (sort(keys(%options))) {$result.=$options{$option};}
-	if ($result) { $result='<option selected="on"></option>'.$result; }
+	if ($result) { $result='<option selected="selected"></option>'.$result; }
     }
     return $result;
 }
@@ -282,10 +281,16 @@ sub insert_responseparam {
     <responseparam />';
 }
 
+sub insert_parameter {
+    return '
+    <parameter />';
+}
+
 sub insert_formularesponse {
     return '
 <formularesponse answer="" samples="">
-    <textline />
+    <responseparam description="Numerical Tolerance" type="tolerance" default="0.00001" name="tol" />
+    <textline size="25"/>
     <hintgroup>
     <startouttext /><endouttext />
     </hintgroup>
@@ -487,7 +492,11 @@ sub editfield {
     my ($tag,$data,$description,$minwidth,$minheight,$usehtmlarea)=@_;
 
     my ($rows,$cols)=&textarea_sizes(\$data);
-    $rows+=3; # make room for HTMLarea
+    if (&Apache::lonhtmlcommon::htmlareabrowser() &&
+	!&Apache::lonhtmlcommon::htmlareablocked()) {
+	$rows+=7;      # make room for HTMLarea
+	$minheight+=7; # make room for HTMLarea
+    }
     if ($cols > 80) { $cols = 80; }
     if ($cols < $minwidth ) { $cols = $minwidth; }
     if ($rows < $minheight) { $rows = $minheight; }
@@ -500,7 +509,9 @@ sub editfield {
 	'" cols="'.$cols.'" name="homework_edit_'.
 	$Apache::lonxml::curdepth.'" id="homework_edit_'.
 	$Apache::lonxml::curdepth.'">'.
-	&HTML::Entities::encode($data,'<>&"').'</textarea>'."\n";
+	&HTML::Entities::encode($data,'<>&"').'</textarea>'.
+	($usehtmlarea?&Apache::lonhtmlcommon::spelllink('lonhomework',
+			 'homework_edit_'.$Apache::lonxml::curdepth):'')."\n";
 }
 
 sub modifiedfield {
@@ -601,7 +612,7 @@ sub checked_arg {
 	    &html_element_name($name)."'";
 	foreach my $selected (split(/,/,$allselected)) {
 	    if ( $selected eq $option ) {
-		$result.=" checked='on' ";
+		$result.=" checked='checked' ";
 		last;
 	    }
 	}
@@ -636,7 +647,7 @@ sub select_arg {
 	    $value='value="'.$option.'"';
 	}
 	if ( $selected eq $option ) {
-	    $optionlist.="<option $value selected=\"on\">$text</option>\n";
+	    $optionlist.="<option $value selected=\"selected\">$text</option>\n";
 	} else {
 	    $optionlist.="<option $value >$text</option>\n";
 	}
@@ -665,14 +676,14 @@ sub select_or_text_arg {
 	    $value='value="'.$option.'"';
 	}
 	if ( $selected eq $option ) {
-	    $optionlist.="<option $value selected=\"on\">$text</option>\n";
+	    $optionlist.="<option $value selected=\"selected\">$text</option>\n";
 	    $found=1;
 	} else {
 	    $optionlist.="<option $value>$text</option>\n";
 	}
     }
     $optionlist.="<option value=\"TYPEDINVALUE\"".
- 	((!$found)?' selected="on"':'').
+ 	((!$found)?' selected="selected"':'').
  	">".&mt('Type-in value')."</option>\n";
 #
     my $element=&html_element_name($name);