Diff for /loncom/homework/optionresponse.pm between versions 1.18 and 1.24

version 1.18, 2001/06/26 21:41:58 version 1.24, 2001/09/13 19:55:02
Line 17  sub start_optionresponse { Line 17  sub start_optionresponse {
   push (@Apache::lonxml::namespace,'optionresponse');    push (@Apache::lonxml::namespace,'optionresponse');
   my $id = &Apache::response::start_response($parstack,$safeeval);    my $id = &Apache::response::start_response($parstack,$safeeval);
   if ($target eq 'edit') {    if ($target eq 'edit') {
     $result.=&Apache::edit::start_table($token)."<tr><td>Multiple Option Response Question</td>      $result.=&Apache::edit::start_table($token).
 <td>Delete:".        "<tr><td>Multiple Option Response Question</td><td>Delete:".
   &Apache::edit::deletelist($target,$token)   &Apache::edit::deletelist($target,$token)
     ."</td><td>&nbsp;</td></tr><tr><td colspan=\"3\">\n";    ."</td><td>&nbsp;</td></tr><tr><td colspan=\"3\">\n";
     $result.=&Apache::edit::text_arg('Max Number Of Foils:','max',$token,'4')."</td></tr>";      $result.=&Apache::edit::text_arg('Max Number Of Foils:','max',$token,'4').
         "</td></tr>";
     $result.="<tr><td colspan=\"3\">\n";      $result.="<tr><td colspan=\"3\">\n";
   }    }
   if ($target eq 'modified') {    if ($target eq 'modified') {
     my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'max');      my $constructtag=&Apache::edit::get_new_args($token,$parstack,
    $safeeval,'max');
     if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }      if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
   }    }
     if ($target eq 'meta') {
       $result=&Apache::response::meta_package_write('optionresponse');
     }
   return $result;    return $result;
 }  }
   
Line 40  sub end_optionresponse { Line 45  sub end_optionresponse {
   return $result;    return $result;
 }  }
   
 sub insert_optionresponse {  
   return '  
 <optionresponse max="10">  
     <foilgroup options=\"\">  
     </foilgroup>  
 </optionresponse>';  
 }  
   
 %Apache::response::foilgroup={};  %Apache::response::foilgroup={};
 sub start_foilgroup {  sub start_foilgroup {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
Line 200  sub displayfoils { Line 197  sub displayfoils {
   foreach $option (@opt) {    foreach $option (@opt) {
     $optionlist.="<option>$option</option>\n";      $optionlist.="<option>$option</option>\n";
   }    }
   if ($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/ ) {    if (($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/)  || ($Apache::inputtags::status[-1] eq  'SHOW_ANSWER')) {
     foreach $name (@whichopt) {      foreach $name (@whichopt) {
       $result.="<br />".$Apache::response::foilgroup{$name.'.value'}.        $result.="<br />".$Apache::response::foilgroup{$name.'.value'}.
  ":".$Apache::response::foilgroup{$name.'.text'}."\n";   ":".$Apache::response::foilgroup{$name.'.text'}."\n";
Line 274  sub start_foil { Line 271  sub start_foil {
     if ($$tagstack['-2'] eq 'conceptgroup') { $level = '-3'; }      if ($$tagstack['-2'] eq 'conceptgroup') { $level = '-3'; }
     my @opt;      my @opt;
     eval '@opt ='.&Apache::lonxml::get_param('options',$parstack,$safeeval,$level);      eval '@opt ='.&Apache::lonxml::get_param('options',$parstack,$safeeval,$level);
     $result.=&Apache::edit::text_arg('Name:','name',$token).      $result.=&Apache::edit::text_arg('Name:','name',$token);
       &Apache::edit::select_arg('Correct Option:','value',['unused',(@opt)],$token).      $result.= &Apache::edit::select_or_text_arg('Correct Option:','value',['unused',(@opt)],$token,'15');
       '</td></tr><tr><td colspan="3">';      $result .= '</td></tr><tr><td colspan="3">';
   }    }
   if ($target eq 'modified') {    if ($target eq 'modified') {
     my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'value','name');      my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'value','name');

Removed from v.1.18  
changed lines
  Added in v.1.24


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