--- loncom/homework/edit.pm	2001/07/18 20:27:22	1.19
+++ loncom/homework/edit.pm	2001/10/09 20:45:13	1.22
@@ -21,7 +21,10 @@ sub tag_start {
   my $result='';
   if ($target eq "edit") {
     my $tag=$token->[1];
-    if (!$description) { $description="<$tag>"; }
+    if (!$description) {
+      $description=&Apache::lonxml::description($token);
+      if (!$description) { $description="<$tag>"; }
+    }
     $result.= &start_table($token)."<tr><td>$description</td>
 <td>Delete".
   &deletelist($target,$token)
@@ -30,6 +33,9 @@ sub tag_start {
   &insertlist($target,$token).
     "</td>
 </tr><tr><td colspan=\"3\">\n";
+#<td>".
+#  &movebuttons($target,$token).
+#    "</tr><tr><td colspan=\"3\">\n";
   }
   return $result;
 }
@@ -74,6 +80,15 @@ sub end_table {
   return $result;
 }
 
+sub movebuttons {
+  my ($target,$token) = @_;
+  my $result='<input type="submit" name="moveup.'.
+    $Apache::lonxml::curdepth.'" value="Move Up" />';
+  $result.='<input type="submit" name="movedown.'.
+    $Apache::lonxml::curdepth.'" value="Move Down" />';
+  return $result;
+}
+
 sub deletelist {
   my ($target,$token) = @_;
   my $result = "<select name=\"delete_$Apache::lonxml::curdepth\">
@@ -202,9 +217,25 @@ sub insert_optionresponse {
 </optionresponse>';
 }
 
+sub insert_displayduedate { return '<displayduedate />'; }
+sub insert_displaytitle   { return '<displaytitle />'; }
+sub insert_hintpart {
+  return '
+<hintpart on="default">
+    <startouttext/>
+    <endouttext />
+</hintpart>';
+}
+
+sub insert_numericalhint {
+  return '
+<numericalhint>
+</numericalhint>';
+}
+
 sub editfield {
   my ($tag,$data,$description,$minwidth,$minheight)=@_;
-  
+
   my $count=0;
   my $maxlength=-1;
   map { $count++;
@@ -253,7 +284,8 @@ sub get_new_args {
   my ($token,$parstack,$safeeval,@args)=@_;
   my $rebuild=0;
   foreach my $arg (@args) {
-    my $value=&Apache::lonxml::get_param($arg,$parstack,$safeeval);
+    #just want the string that it was set to
+    my $value=$token->[2]->{$arg};
     my $newvalue=$ENV{"form.$Apache::lonxml::curdepth.$arg"};
     &Apache::lonxml::debug(" for:$arg: cur is :$value: new is :$newvalue:");
     if ($value ne $newvalue) {
@@ -271,7 +303,7 @@ sub rebuild_tag {
   if ($token->[0] eq 'S') {
     $result = '<'.$token->[1];
     while (my ($key,$val)= each(%{$token->[2]})) {
-      $val=~s:^\s|\s$::g;
+      $val=~s:^\s+|\s+$::g;
       $val=~s:"::g; #"
       &Apache::lonxml::debug("setting :$key: to  :$val:");
       $result.=' '.$key.'="'.$val.'"';