--- loncom/homework/edit.pm 2013/05/06 16:07:29 1.144 +++ loncom/homework/edit.pm 2013/12/03 16:39:45 1.149 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # edit mode helpers # -# $Id: edit.pm,v 1.144 2013/05/06 16:07:29 bisitz Exp $ +# $Id: edit.pm,v 1.149 2013/12/03 16:39:45 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -161,7 +161,7 @@ sub tag_start { if ($target eq "edit") { my $tag=$token->[1]; if (!$description) { - $description=&Apache::lonxml::description($token); + $description=&mt(&Apache::lonxml::description($token)); if (!$description) { $description="<$tag>"; } } $result.= &start_table($token)."<tr><td>$description</td> @@ -175,7 +175,7 @@ sub tag_start { # "</tr><tr><td colspan=\"3\">\n"; my @help = Apache::lonxml::helpinfo($token); if ($help[0]) { - $result .= '</td><td align="right" valign="top">' . + $result .= '</td><td class="LC_edit_problem_latexhelper">'. Apache::loncommon::help_open_topic(@help); } else { $result .= "</td><td> "; } $result .= &end_row().&start_spanning_row(); @@ -203,7 +203,7 @@ sub start_table { } $Apache::edit::colordepth++; push(@Apache::edit::inserttag,$token->[1]); - my $result='<div align="right">'; + my $result='<div>'; $result.='<table bgcolor="'.$color.'" width="97%" border="0" cellspacing="3" cellpadding="2">'; return $result; } @@ -211,7 +211,7 @@ sub start_table { sub end_table { $Apache::edit::colordepth--; my $result='</table></div>'; - $result.='<div align="left"><table><tr><td>'; + $result.='<div><table><tr><td>'; my ($tagname,$closingtag); if (defined($Apache::edit::inserttag[-2])) { @@ -488,6 +488,13 @@ sub insert_numericalresponse { </numericalresponse>'; } +sub insert_externalresponse { + return ' +<externalresponse url="" answer="" answerdisplay="" form=""> + <textfield spellcheck="none" /> +</externalresponse>'; +} + sub insert_customresponse { return ' <customresponse> @@ -660,6 +667,9 @@ sub insert_matchresponse { <matchresponse max="10"> <foilgroup options=""> <itemgroup> + <item> + <startouttext /><endouttext /> + </item> </itemgroup> <foil> <startouttext /><endouttext /> @@ -1050,13 +1060,13 @@ sub select_or_text_arg { <span class="LC_edit_opt"> $description <select name="$selectelement" -onChange="if ($selectedvalue!='TYPEDINVALUE') { $hiddenvalue=$selectedvalue; $typedinvalue=''; }" > +onchange="if ($selectedvalue!='TYPEDINVALUE') { $hiddenvalue=$selectedvalue; $typedinvalue=''; }" > $optionlist </select> <input type="text" size="$size" name="$typeinelement" value="$typeinvalue" -onChange="$hiddenvalue=$typedinvalue;" -onFocus="$selectedindex=$selecttypeinindex-1;" /> +onchange="$hiddenvalue=$typedinvalue;" +onfocus="$selectedindex=$selecttypeinindex-1;" /> <input type="hidden" name="$element" value="$selected" $change_code /> </span> ENDSELECTORTYPE