Diff for /loncom/homework/edit.pm between versions 1.49 and 1.55

version 1.49, 2003/05/06 11:54:08 version 1.55, 2003/06/10 18:39:08
Line 75  sub tag_end { Line 75  sub tag_end {
   my ($target,$token,$description) = @_;    my ($target,$token,$description) = @_;
   my $result='';    my $result='';
   if ($target eq 'edit') {    if ($target eq 'edit') {
     my $tag=$token->[1];      $result.="</td></tr>".&end_table()."\n";
     if (!defined($description)) {  
       $result.="</td></tr><tr><td>&lt;/$tag&gt;</td><td colspan=\"2\">&nbsp;</td>";  
     } else {  
       if ($description ne '') { $result.="</td></tr><tr><td>$description</td><td colspan=\"2\">&nbsp;</td>"; }  
     }  
     $result.="</tr>".&end_table()."\n";  
   }    }
   return $result;    return $result;
 }  }
Line 310  sub insert_essayresponse { Line 304  sub insert_essayresponse {
 </essayresponse>';  </essayresponse>';
 }  }
   
   sub insert_imageresponse {
     return '
   <imageresponse max="1">
       <foilgroup>
       </foilgroup>
       <hintgroup>
       </hintgroup>
   </imageresponse>';
   }
   
 sub insert_optionresponse {  sub insert_optionresponse {
   return '    return '
 <optionresponse max="10">  <optionresponse max="10">
Line 386  sub insert_radiobuttonhint { Line 390  sub insert_radiobuttonhint {
 </radiobuttonhint>';  </radiobuttonhint>';
 }  }
   
   sub insert_optionhint {
     return '
   <optionhint>
   </optionhint>';
   }
   
 sub insert_startouttext {  sub insert_startouttext {
   return "<startouttext />\n<endouttext />";    return "<startouttext />\n<endouttext />";
 }  }
Line 398  sub textarea_sizes { Line 408  sub textarea_sizes {
   my ($data)=@_;    my ($data)=@_;
   my $count=0;    my $count=0;
   my $maxlength=-1;    my $maxlength=-1;
   foreach (split ("\n", $$data)) { $count++;    foreach (split ("\n", $$data)) {
  if (length($_) > $maxlength) { $maxlength = length($_); }        $count+=int(length($_)/79);
       }        $count++;
         if (length($_) > $maxlength) { $maxlength = length($_); }
     }
   my $rows = $count;    my $rows = $count;
   my $cols = $maxlength;    my $cols = $maxlength;
   return ($rows,$cols);    return ($rows,$cols);
Line 454  sub get_new_args { Line 466  sub get_new_args {
     my $element=&html_element_name($arg);      my $element=&html_element_name($arg);
     my $newvalue=$ENV{"form.$element"};      my $newvalue=$ENV{"form.$element"};
     &Apache::lonxml::debug(" for:$arg: cur is :$value: new is :$newvalue:");      &Apache::lonxml::debug(" for:$arg: cur is :$value: new is :$newvalue:");
     if ($value ne $newvalue) {      if (defined($newvalue) && $value ne $newvalue) {
       $token->[2]->{$arg}=$newvalue;        $token->[2]->{$arg}=$newvalue;
       $rebuild=1;        $rebuild=1;
     }      }
Line 621  sub entercoordpair { Line 633  sub entercoordpair {
  $formwidth='&formwidth='.$width.'_'.$Apache::edit::bgimgsrccurdepth;   $formwidth='&formwidth='.$width.'_'.$Apache::edit::bgimgsrccurdepth;
     }      }
     my $result = <<"ENDBUTTON";      my $result = <<"ENDBUTTON";
 <a href="/cgi-bin/imagechoice.pl?mode=pair&formname=$form&file=$bgfile$formheight$formwidth"  <a href="/cgi-bin/imagechoice.pl?mode=pair&formname=$form&file=$bgfile$formheight$formwidth&formcoord=$element"
 target="imagechoice">Click Coordinate Pair</a>  target="imagechoice">Click Coordinate Pair</a>
 ENDBUTTON  ENDBUTTON
     return $result;      return $result;

Removed from v.1.49  
changed lines
  Added in v.1.55


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>