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

version 1.63, 2003/09/08 21:22:15 version 1.68, 2003/10/24 21:09:24
Line 67  sub tag_start { Line 67  sub tag_start {
 #<td>".   #<td>". 
 #  &movebuttons($target,$token).  #  &movebuttons($target,$token).
 #    "</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 align="right" valign="top">' .      $result .= '<td align="right" valign="top">' .
  Apache::loncommon::help_open_topic(@help) .   Apache::loncommon::help_open_topic(@help) .
Line 283  sub insert_formularesponse { Line 283  sub insert_formularesponse {
 <formularesponse answer="" samples="">  <formularesponse answer="" samples="">
     <textline />      <textline />
     <hintgroup>      <hintgroup>
       <startouttext/>
       <endouttext />
     </hintgroup>      </hintgroup>
 </formularesponse>';  </formularesponse>';
 }  }
Line 292  sub insert_numericalresponse { Line 294  sub insert_numericalresponse {
 <numericalresponse answer="">  <numericalresponse answer="">
     <textline />      <textline />
     <hintgroup>      <hintgroup>
       <startouttext/>
       <endouttext />
     </hintgroup>      </hintgroup>
 </numericalresponse>';  </numericalresponse>';
 }  }
Line 301  sub insert_stringresponse { Line 305  sub insert_stringresponse {
 <stringresponse answer="" type="">  <stringresponse answer="" type="">
     <textline />      <textline />
     <hintgroup>      <hintgroup>
       <startouttext/>
       <endouttext />
     </hintgroup>      </hintgroup>
 </stringresponse>';  </stringresponse>';
 }  }
Line 318  sub insert_imageresponse { Line 324  sub insert_imageresponse {
     <foilgroup>      <foilgroup>
     </foilgroup>      </foilgroup>
     <hintgroup>      <hintgroup>
       <startouttext/>
       <endouttext />
     </hintgroup>      </hintgroup>
 </imageresponse>';  </imageresponse>';
 }  }
Line 328  sub insert_optionresponse { Line 336  sub insert_optionresponse {
     <foilgroup options="">      <foilgroup options="">
     </foilgroup>      </foilgroup>
     <hintgroup>      <hintgroup>
       <startouttext/>
       <endouttext />
     </hintgroup>      </hintgroup>
 </optionresponse>';  </optionresponse>';
 }  }
Line 338  sub insert_radiobuttonresponse { Line 348  sub insert_radiobuttonresponse {
     <foilgroup>      <foilgroup>
     </foilgroup>      </foilgroup>
     <hintgroup>      <hintgroup>
       <startouttext/>
       <endouttext />
     </hintgroup>      </hintgroup>
 </radiobuttonresponse>';  </radiobuttonresponse>';
 }  }
Line 348  sub insert_rankresponse { Line 360  sub insert_rankresponse {
     <foilgroup options="">      <foilgroup options="">
     </foilgroup>      </foilgroup>
     <hintgroup>      <hintgroup>
       <startouttext/>
       <endouttext />
     </hintgroup>      </hintgroup>
 </rankresponse>';  </rankresponse>';
 }  }
Line 360  sub insert_matchresponse { Line 374  sub insert_matchresponse {
       </itemgroup>        </itemgroup>
     </foilgroup>      </foilgroup>
     <hintgroup>      <hintgroup>
       <startouttext/>
       <endouttext />
     </hintgroup>      </hintgroup>
 </matchresponse>';  </matchresponse>';
 }  }
Line 374  sub insert_hintpart { Line 390  sub insert_hintpart {
 </hintpart>';  </hintpart>';
 }  }
   
   sub insert_hintgroup {
     return '
   <hintgroup>
       <startouttext/>
       <endouttext />
   </hintgroup>';
   }
   
 sub insert_numericalhint {  sub insert_numericalhint {
     return '      return '
 <numericalhint>  <numericalhint>
Line 569  sub select_arg { Line 593  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.='<nobr>'.$description.'&nbsp;<select name="'.      $result.='<nobr>'.$description.'&nbsp;<select name="'.
Line 596  sub select_or_text_arg { Line 622  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\"".      $optionlist.="<option value=\"TYPEDINVALUE\"".
Line 703  ENDBUTTON Line 731  ENDBUTTON
 #----------------------------------------------------- browse  #----------------------------------------------------- browse
 sub browse {  sub browse {
     # insert a link to call up the filesystem browser (lonindexer)      # insert a link to call up the filesystem browser (lonindexer)
     my ($id, $mode) = @_;      my ($id, $mode, $titleid) = @_;
     my $form    = 'lonhomework';      my $form    = 'lonhomework';
     my $element;      my $element;
     if (! defined($mode) || $mode eq 'attribute') {      if (! defined($mode) || $mode eq 'attribute') {
         $element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth");          $element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth");
     } elsif ($mode eq 'textnode') {  # for data between <tag> ... </tag>      } elsif ($mode eq 'textnode') {  # for data between <tag> ... </tag>
         $element = &Apache::lonnet::escape('homework_edit_'.          $element = &Apache::lonnet::escape('homework_edit_'.
                                            $Apache::lonxml::curdepth);                                             $Apache::lonxml::curdepth);
       }
       my $titleelement;
       if ($titleid) {
    $titleelement=",'','','".&Apache::lonnet::escape("$titleid\_$Apache::lonxml::curdepth")."'";
     }      }
     my $result = <<"ENDBUTTON";      my $result = <<"ENDBUTTON";
 <a href=\"javascript:openbrowser('$form','$element')\"\>Select</a>  <a href=\"javascript:openbrowser('$form','$element'$titleelement)\"\>Select</a>
 ENDBUTTON  ENDBUTTON
     return $result;      return $result;
 }  }
Line 721  ENDBUTTON Line 753  ENDBUTTON
 #----------------------------------------------------- browse  #----------------------------------------------------- browse
 sub search {  sub search {
     # insert a link to call up the filesystem browser (lonindexer)      # insert a link to call up the filesystem browser (lonindexer)
     my ($id, $mode) = @_;      my ($id, $mode, $titleid) = @_;
     my $form    = 'lonhomework';      my $form    = 'lonhomework';
     my $element;      my $element;
     if (! defined($mode) || $mode eq 'attribute') {      if (! defined($mode) || $mode eq 'attribute') {
Line 730  sub search { Line 762  sub search {
         $element = &Apache::lonnet::escape('homework_edit_'.          $element = &Apache::lonnet::escape('homework_edit_'.
                                            $Apache::lonxml::curdepth);                                             $Apache::lonxml::curdepth);
     }      }
       my $titleelement;
       if ($titleid) {
    $titleelement=",'".&Apache::lonnet::escape("$titleid\_$Apache::lonxml::curdepth")."'";
       }
     my $result = <<"ENDBUTTON";      my $result = <<"ENDBUTTON";
 <a href=\"javascript:opensearcher('$form','$element')\"\>Search</a>  <a href=\"javascript:opensearcher('$form','$element'$titleelement)\"\>Search</a>
 ENDBUTTON  ENDBUTTON
     return $result;      return $result;
 }  }

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


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