Diff for /loncom/homework/edit.pm between versions 1.140 and 1.148

version 1.140, 2012/02/13 11:23:11 version 1.148, 2013/09/05 12:07:29
Line 175  sub tag_start { Line 175  sub tag_start {
 #    "</tr><tr><td colspan=\"3\">\n";  #    "</tr><tr><td colspan=\"3\">\n";
  my @help = Apache::lonxml::helpinfo($token);   my @help = Apache::lonxml::helpinfo($token);
  if ($help[0]) {   if ($help[0]) {
     $result .= '</td><td align="right" valign="top">' .      $result .= '</td><td class="LC_edit_problem_latexhelper">'.
  Apache::loncommon::help_open_topic(@help);   Apache::loncommon::help_open_topic(@help);
  } else { $result .= "</td><td>&nbsp;"; }   } else { $result .= "</td><td>&nbsp;"; }
  $result .= &end_row().&start_spanning_row();   $result .= &end_row().&start_spanning_row();
Line 203  sub start_table { Line 203  sub start_table {
     }      }
     $Apache::edit::colordepth++;      $Apache::edit::colordepth++;
     push(@Apache::edit::inserttag,$token->[1]);      push(@Apache::edit::inserttag,$token->[1]);
     my $result='<div align="right">';      my $result='<div>';
     $result.='<table bgcolor="'.$color.'" width="97%" border="0" cellspacing="3" cellpadding="2">';      $result.='<table bgcolor="'.$color.'" width="97%" border="0" cellspacing="3" cellpadding="2">';
     return $result;      return $result;
 }  }
Line 211  sub start_table { Line 211  sub start_table {
 sub end_table {  sub end_table {
     $Apache::edit::colordepth--;      $Apache::edit::colordepth--;
     my $result='</table></div>';      my $result='</table></div>';
     $result.='<div align="left"><table><tr><td>';      $result.='<div><table><tr><td>';
   
     my ($tagname,$closingtag);      my ($tagname,$closingtag);
     if (defined($Apache::edit::inserttag[-2])) {      if (defined($Apache::edit::inserttag[-2])) {
Line 427  sub insert_plotvector { Line 427  sub insert_plotvector {
 <plotvector />';  <plotvector />';
 }  }
   
   sub insert_drawvectorsum {
       return '
   <drawvectorsum />';
   }
   
   
 sub insert_functionplotrule {  sub insert_functionplotrule {
     return '      return '
 <functionplotrule />';  <functionplotrule />';
Line 482  sub insert_numericalresponse { Line 488  sub insert_numericalresponse {
 </numericalresponse>';  </numericalresponse>';
 }  }
   
   sub insert_externalresponse {
       return '
   <externalresponse url="" answer="" answerdisplay="" form="">
       <textfield spellcheck="none" />
   </externalresponse>';
   }
   
 sub insert_customresponse {  sub insert_customresponse {
     return '      return '
 <customresponse>  <customresponse>
Line 654  sub insert_matchresponse { Line 667  sub insert_matchresponse {
 <matchresponse max="10">  <matchresponse max="10">
     <foilgroup options="">      <foilgroup options="">
       <itemgroup>        <itemgroup>
           <item>
             <startouttext /><endouttext />
           </item>
       </itemgroup>        </itemgroup>
       <foil>        <foil>
          <startouttext /><endouttext />           <startouttext /><endouttext />
Line 738  sub js_change_detection { Line 754  sub js_change_detection {
     my $unsaved=&mt("There are unsaved changes");      my $unsaved=&mt("There are unsaved changes");
     return (<<SCRIPT);      return (<<SCRIPT);
 <script type="text/javascript">  <script type="text/javascript">
   // <![CDATA[
 var clean = true;  var clean = true;
 var is_submit = false;  var is_submit = false;
 var still_ask = false;  var still_ask = false;
Line 756  function unClean() { Line 773  function unClean() {
      clean=false;       clean=false;
 }  }
 window.onbeforeunload = compareForm;  window.onbeforeunload = compareForm;
   // ]]>
 </script>  </script>
 SCRIPT  SCRIPT
 }  }
Line 820  sub editfield { Line 838  sub editfield {
     if ($cols > 80) { $cols = 80; }      if ($cols > 80) { $cols = 80; }
     if ($cols < $minwidth ) { $cols = $minwidth; }      if ($cols < $minwidth ) { $cols = $minwidth; }
     if ($rows < $minheight) { $rows = $minheight; }      if ($rows < $minheight) { $rows = $minheight; }
     if ($description) { $description=$description."<br />"; }      if ($description) { $description='<br />'.&mt($description).'<br />'; }
   
     # remove typesetting whitespace from between data and the end tag      # remove typesetting whitespace from between data and the end tag
     # to make the edit look prettier      # to make the edit look prettier
Line 832  sub editfield { Line 850  sub editfield {
  $Apache::lonxml::curdepth.'" '.&element_change_detection().   $Apache::lonxml::curdepth.'" '.&element_change_detection().
         $textareaclass.'>'.          $textareaclass.'>'.
  &HTML::Entities::encode($data,'<>&"').'</textarea>'.   &HTML::Entities::encode($data,'<>&"').'</textarea>'.
  ($usehtmlarea?&Apache::lonhtmlcommon::spelllink('lonhomework',          ($usehtmlarea?'<br />'.&Apache::lonhtmlcommon::spelllink('lonhomework',
  'homework_edit_'.$Apache::lonxml::curdepth):'')."\n";                                     'homework_edit_'.$Apache::lonxml::curdepth):'')."\n";
 }  }
   
 sub modifiedfield {  sub modifiedfield {
Line 938  sub checked_arg { Line 956  sub checked_arg {
     $text=$option;      $text=$option;
     $value='value="'.$option.'"';      $value='value="'.$option.'"';
  }   }
  $result.='<span class="LC_nobreak"><label><input type="checkbox" '.$value.' name="'.          $result.=' <span class="LC_edit_opt"><label><input type="checkbox" '.$value.' name="'.
     &html_element_name($name).'"';      &html_element_name($name).'"';
  foreach my $selected (split(/,/,$allselected)) {   foreach my $selected (split(/,/,$allselected)) {
     if ( $selected eq $option ) {      if ( $selected eq $option ) {
Line 962  sub text_arg { Line 980  sub text_arg {
  $result .= 'class="' . $class . '" ';   $result .= 'class="' . $class . '" ';
     }      }
     $result .= &element_change_detection().'/>';      $result .= &element_change_detection().'/>';
     return '<span class="LC_nobreak">'.$result.'</span>';      return ' <span class="LC_edit_opt">'.$result.'</span>';
 }  }
   
 sub select_arg {  sub select_arg {
Line 988  sub select_arg { Line 1006  sub select_arg {
     }      }
         }          }
     }      }
     $result.='<span class="LC_nobreak">'.&mt($description).'&nbsp;<select name="'.      $result.=' <span class="LC_edit_opt">'.&mt($description).'&nbsp;<select name="'.
  &html_element_name($name).'" '.&element_change_detection().' >   &html_element_name($name).'" '.&element_change_detection().' >
        '.$optionlist.'         '.$optionlist.'
       </select></span>';        </select></span>';
Line 1039  sub select_or_text_arg { Line 1057  sub select_or_text_arg {
     $description=&mt($description);      $description=&mt($description);
 #  #
     return (<<ENDSELECTORTYPE);      return (<<ENDSELECTORTYPE);
 <span class="LC_nobreak">   <span class="LC_edit_opt">
 $description  $description
 &nbsp;<select name="$selectelement"  &nbsp;<select name="$selectelement"
 onChange="if ($selectedvalue!='TYPEDINVALUE') { $hiddenvalue=$selectedvalue; $typedinvalue=''; }" >  onchange="if ($selectedvalue!='TYPEDINVALUE') { $hiddenvalue=$selectedvalue; $typedinvalue=''; }" >
 $optionlist  $optionlist
 </select>  </select>
 <input type="text" size="$size" name="$typeinelement"  <input type="text" size="$size" name="$typeinelement"
        value="$typeinvalue"          value="$typeinvalue" 
 onChange="$hiddenvalue=$typedinvalue;"  onchange="$hiddenvalue=$typedinvalue;"
 onFocus="$selectedindex=$selecttypeinindex-1;" />  onfocus="$selectedindex=$selecttypeinindex-1;" />
 <input type="hidden" name="$element" value="$selected" $change_code />  <input type="hidden" name="$element" value="$selected" $change_code />
 </span>  </span>
 ENDSELECTORTYPE  ENDSELECTORTYPE

Removed from v.1.140  
changed lines
  Added in v.1.148


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