Diff for /loncom/homework/edit.pm between versions 1.92 and 1.96

version 1.92, 2005/04/07 06:56:21 version 1.96, 2005/11/15 15:57:45
Line 92  sub start_table { Line 92  sub start_table {
     foreach my $namespace (reverse @Apache::lonxml::namespace) {      foreach my $namespace (reverse @Apache::lonxml::namespace) {
  my $testtag=$namespace.'::'.$tag;   my $testtag=$namespace.'::'.$tag;
  $tagnum=$Apache::lonxml::insertlist{"$testtag.num"};   $tagnum=$Apache::lonxml::insertlist{"$testtag.num"};
    &Apache::lonxml::debug(" $testtag ");
  if (defined($tagnum)) { last; }   if (defined($tagnum)) { last; }
     }      }
     if (!defined ($tagnum)) {$tagnum=$Apache::lonxml::insertlist{"$tag.num"};}      if (!defined ($tagnum)) {$tagnum=$Apache::lonxml::insertlist{"$tag.num"};}
     my $color = $Apache::lonxml::insertlist{"$tagnum.color"};      my $color = $Apache::lonxml::insertlist{"$tagnum.color"};
       &Apache::lonxml::debug(" $tagnum -- $color");
     if (!defined($color)) {      if (!defined($color)) {
  $color = $Apache::edit::colorlist[$Apache::edit::colordepth];   $color = $Apache::edit::colorlist[$Apache::edit::colordepth];
     }      }
Line 109  sub start_table { Line 111  sub start_table {
 sub end_table {  sub end_table {
     $Apache::edit::colordepth--;      $Apache::edit::colordepth--;
     my $result='</table></div>';      my $result='</table></div>';
     $result.="<table><tr><td>";      $result.='<div align="left"><table><tr><td>';
   
     my ($tagname,$closingtag);      my ($tagname,$closingtag);
     if (defined($Apache::edit::inserttag[-2])) {      if (defined($Apache::edit::inserttag[-2])) {
Line 119  sub end_table { Line 121  sub end_table {
  $closingtag=$Apache::edit::inserttag[-1];   $closingtag=$Apache::edit::inserttag[-1];
     }      }
     $result.=&innerinsertlist('edit',$tagname,$closingtag).      $result.=&innerinsertlist('edit',$tagname,$closingtag).
  "</td></tr></table>";   "</td></tr></table></div>";
     pop(@Apache::edit::inserttag);      pop(@Apache::edit::inserttag);
     return $result;      return $result;
 }  }
Line 309  sub insert_numericalresponse { Line 311  sub insert_numericalresponse {
 </numericalresponse>';  </numericalresponse>';
 }  }
   
   sub insert_customresponse {
       return '
   <customresponse>
       <answer type="loncapa/perl">
       </answer>
       <textline />
       <hintgroup>
       <startouttext /><endouttext />
       </hintgroup>
   </customresponse>';
   }
   
   sub insert_customresponse_answer {
       return '
       <answer type="loncapa/perl">
       </answer>
   ';
   }
   
 sub insert_stringresponse {  sub insert_stringresponse {
     return '      return '
 <stringresponse answer="" type="">  <stringresponse answer="" type="">
Line 654  sub select_arg { Line 675  sub select_arg {
     foreach my $option (@$list) {      foreach my $option (@$list) {
  my ($text,$value);   my ($text,$value);
  if ( ref($option) eq 'ARRAY') {   if ( ref($option) eq 'ARRAY') {
     $value='value="'.$$option[0].'"';      $value='value="'.&HTML::Entities::encode($$option[0]).'"';
     $text=$$option[1];      $text=$$option[1];
     $option=$$option[0];      $option=$$option[0];
  } else {   } else {
     $text=$option;      $text=$option;
     $value='value="'.$option.'"';      $value='value="'.&HTML::Entities::encode($option,'\'"&<>').'"';
  }   }
  if ( $selected eq $option ) {   if ( $selected eq $option ) {
     $optionlist.="<option $value selected=\"selected\">$text</option>\n";      $optionlist.="<option $value selected=\"selected\">$text</option>\n";
Line 683  sub select_or_text_arg { Line 704  sub select_or_text_arg {
     foreach my $option (@$list) {      foreach my $option (@$list) {
  my ($text,$value);   my ($text,$value);
  if ( ref($option) eq 'ARRAY') {   if ( ref($option) eq 'ARRAY') {
     $value='value="'.$$option[0].'"';      $value='value="'.&HTML::Entities::encode($$option[0]).'"';
     $text=$$option[1];      $text=$$option[1];
     $option=$$option[0];      $option=$$option[0];
  } else {   } else {
     $text=$option;      $text=$option;
     $value='value="'.$option.'"';      $value='value="'.&HTML::Entities::encode($option,'\'"&<>').'"';
  }   }
  if ( $selected eq $option ) {   if ( $selected eq $option ) {
     $optionlist.="<option $value selected=\"selected\">$text</option>\n";      $optionlist.="<option $value selected=\"selected\">$text</option>\n";

Removed from v.1.92  
changed lines
  Added in v.1.96


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