Diff for /loncom/homework/edit.pm between versions 1.68 and 1.73

version 1.68, 2003/10/24 21:09:24 version 1.73, 2003/11/28 01:55:24
Line 33  package Apache::edit; Line 33  package Apache::edit;
 use strict;  use strict;
 use Apache::lonnet();  use Apache::lonnet();
 use HTML::Entities();  use HTML::Entities();
   use Apache::lonlocal;
   
 # Global Vars  # Global Vars
 # default list of colors to use in editing  # default list of colors to use in editing
Line 273  sub handle_insertafter { Line 274  sub handle_insertafter {
     return $result;      return $result;
 }  }
   
   sub insert_img {
       return '
       <img />';
   }
   
 sub insert_responseparam {  sub insert_responseparam {
     return '      return '
     <responseparam />';      <responseparam />';
Line 342  sub insert_optionresponse { Line 348  sub insert_optionresponse {
 </optionresponse>';  </optionresponse>';
 }  }
   
   sub insert_organicresponse {
       return '
   <organicresponse>
       <textline />
       <hintgroup>
       <startouttext/>
       <endouttext />
       </hintgroup>
   </organicresponse>';
   }
   
   sub insert_organicstructure {
       return '
   <organicstructure />
   ';
   }
   
 sub insert_radiobuttonresponse {  sub insert_radiobuttonresponse {
     return '      return '
 <radiobuttonresponse max="10">  <radiobuttonresponse max="10">
Line 354  sub insert_radiobuttonresponse { Line 377  sub insert_radiobuttonresponse {
 </radiobuttonresponse>';  </radiobuttonresponse>';
 }  }
   
   sub insert_reactionresponse {
       return '
   <reactionresponse>
       <textline />
       <hintgroup>
       <startouttext/>
       <endouttext />
       </hintgroup>
   </reactionresponse>';
   }
   
 sub insert_rankresponse {  sub insert_rankresponse {
     return '      return '
 <rankresponse max="10">  <rankresponse max="10">
Line 477  sub editfield { Line 511  sub editfield {
 }  }
   
 sub modifiedfield {  sub modifiedfield {
     my ($token) = @_;      my ($endtag,$parser) = @_;
     my $result;      my $result;
 #  foreach my $envkey (sort keys %ENV) {  #  foreach my $envkey (sort keys %ENV) {
 #    &Apache::lonxml::debug("$envkey ---- $ENV{$envkey}");  #    &Apache::lonxml::debug("$envkey ---- $ENV{$envkey}");
Line 485  sub modifiedfield { Line 519  sub modifiedfield {
 #  &Apache::lonxml::debug("I want homework_edit_$Apache::lonxml::curdepth");  #  &Apache::lonxml::debug("I want homework_edit_$Apache::lonxml::curdepth");
 #  &Apache::lonxml::debug($ENV{"form.homework_edit_$Apache::lonxml::curdepth"});  #  &Apache::lonxml::debug($ENV{"form.homework_edit_$Apache::lonxml::curdepth"});
     $result=$ENV{"form.homework_edit_$Apache::lonxml::curdepth"};      $result=$ENV{"form.homework_edit_$Apache::lonxml::curdepth"};
       my $bodytext=&Apache::lonxml::get_all_text($endtag,$parser);
       # textareas throw away intial \n 
       if ($bodytext=~/^\n/) { $result="\n".$result; }
     return $result;      return $result;
 }  }
   
Line 553  sub checked_arg { Line 590  sub checked_arg {
     my $result;      my $result;
     my $optionlist="";      my $optionlist="";
     my $allselected=$token->[2]{$name};      my $allselected=$token->[2]{$name};
     $result=$description;      $result=&mt($description);
     foreach my $option (@$list) {      foreach my $option (@$list) {
  my ($value,$text);   my ($value,$text);
  if ( ref($option) eq 'ARRAY') {   if ( ref($option) eq 'ARRAY') {
Line 582  sub text_arg { Line 619  sub text_arg {
     my $result;      my $result;
     if (!defined $size) { $size=20; }      if (!defined $size) { $size=20; }
     my $arg=$token->[2]{$name};      my $arg=$token->[2]{$name};
     $result=$description.'&nbsp;<input name="'.&html_element_name($name).      $result=&mt($description).'&nbsp;<input name="'.&html_element_name($name).
  '" type="text" value="'.$arg.'" size="'.$size.'" />';   '" type="text" value="'.$arg.'" size="'.$size.'" />';
     return '<nobr>'.$result.'</nobr>';      return '<nobr>'.$result.'</nobr>';
 }  }
Line 640  sub select_or_text_arg { Line 677  sub select_or_text_arg {
     }      }
     $optionlist.="<option value=\"TYPEDINVALUE\"".      $optionlist.="<option value=\"TYPEDINVALUE\"".
   ((!$found)?' selected="on"':'').    ((!$found)?' selected="on"':'').
   ">Type in value</option>\n";    ">".&mt('Type-in value')."</option>\n";
 #  #
     my $element=&html_element_name($name);      my $element=&html_element_name($name);
     my $selectelement='select_list_'.$element;      my $selectelement='select_list_'.$element;
Line 653  sub select_or_text_arg { Line 690  sub select_or_text_arg {
      '.options['.$selectedindex.'].value';       '.options['.$selectedindex.'].value';
     my $typedinvalue='this.form.'.$typeinelement.'.value';      my $typedinvalue='this.form.'.$typeinelement.'.value';
     my $selecttypeinindex='this.form.'.$selectelement.'.options.length';      my $selecttypeinindex='this.form.'.$selectelement.'.options.length';
       $description=&mt($description);
 #  #
     return (<<ENDSELECTORTYPE);      return (<<ENDSELECTORTYPE);
 <nobr>  <nobr>

Removed from v.1.68  
changed lines
  Added in v.1.73


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