Diff for /loncom/homework/edit.pm between versions 1.53 and 1.57.2.2

version 1.53, 2003/06/04 23:04:34 version 1.57.2.2, 2003/10/06 20:11:38
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 514  sub text_arg { Line 518  sub text_arg {
   my $arg=$token->[2]{$name};    my $arg=$token->[2]{$name};
   $result=$description.'&nbsp;<input name="'.&html_element_name($name).    $result=$description.'&nbsp;<input name="'.&html_element_name($name).
     '" type="text" value="'.$arg.'" size="'.$size.'" />';      '" type="text" value="'.$arg.'" size="'.$size.'" />';
   return $result;    return '<nobr>'.$result.'</nobr>';
 }  }
   
 sub select_arg {  sub select_arg {
Line 523  sub select_arg { Line 527  sub select_arg {
     my $optionlist="";      my $optionlist="";
     my $selected=$token->[2]{$name};      my $selected=$token->[2]{$name};
     foreach my $option (@$list) {      foreach my $option (@$list) {
  my $value;   my ($text,$value);
  if ( ref($option) eq 'ARRAY') {   if ( ref($option) eq 'ARRAY') {
     $value='value="'.$$option[0].'"';      $value='value="'.$$option[0].'"';
     $option=$$option[1];      $text=$$option[1];
       $option=$$option[0];
  } else {   } else {
       $text=$option;
     $value='value="'.$option.'"';      $value='value="'.$option.'"';
  }   }
  if ( $selected eq $option ) {   if ( $selected eq $option ) {
     $optionlist.="<option $value selected=\"on\">$option</option>\n";      $optionlist.="<option $value selected=\"on\">$text</option>\n";
  } else {   } else {
     $optionlist.="<option $value >$option</option>\n";      $optionlist.="<option $value >$text</option>\n";
  }   }
     }      }
     $result.=$description.'&nbsp;<select name="'.&html_element_name($name).      $result.='<nobr>'.$description.'&nbsp;<select name="'.
         '">   &html_element_name($name).'">
        '.$optionlist.'         '.$optionlist.'
       </select>';        </select></nobr>';
     return $result;      return $result;
 }  }
   
Line 550  sub select_or_text_arg { Line 556  sub select_or_text_arg {
     my $found=0;      my $found=0;
     my $selected=$token->[2]{$name};      my $selected=$token->[2]{$name};
     foreach my $option (@$list) {      foreach my $option (@$list) {
  my $value;   my ($text,$value);
  if ( ref($option) eq 'ARRAY') {   if ( ref($option) eq 'ARRAY') {
     $value='value="'.$$option[0].'"';      $value='value="'.$$option[0].'"';
     $option=$$option[1];      $text=$$option[1];
       $option=$$option[0];
  } else {   } else {
       $text=$option;
     $value='value="'.$option.'"';      $value='value="'.$option.'"';
  }   }
  if ( $selected eq $option ) {   if ( $selected eq $option ) {
     $optionlist.="<option $value selected=\"on\">$option</option>\n";      $optionlist.="<option $value selected=\"on\">$text</option>\n";
     $found=1;      $found=1;
  } else {   } else {
     $optionlist.="<option $value>$option</option>\n";      $optionlist.="<option $value>$text</option>\n";
  }   }
     }      }
     $optionlist.="<option value=\"TYPEDINVALUE\">Type in value</option>\n";      $optionlist.="<option value=\"TYPEDINVALUE\">Type in value</option>\n";
Line 573  sub select_or_text_arg { Line 581  sub select_or_text_arg {
     } else {      } else {
  $result.=&text_arg($description,$name,$token,$size);   $result.=&text_arg($description,$name,$token,$size);
     }      }
     return $result;      return '<nobr>'.$result.'</nobr>';
 }  }
   
 #----------------------------------------------------- image coordinates  #----------------------------------------------------- image coordinates
Line 647  sub browse { Line 655  sub browse {
                                            $Apache::lonxml::curdepth);                                             $Apache::lonxml::curdepth);
     }      }
     my $result = <<"ENDBUTTON";      my $result = <<"ENDBUTTON";
 <a href=\"javascript:openbrowser('$form','$element')\"\>Browse</a>  <a href=\"javascript:openbrowser('$form','$element')\"\>Select</a>
 ENDBUTTON  ENDBUTTON
     return $result;      return $result;
 }  }

Removed from v.1.53  
changed lines
  Added in v.1.57.2.2


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