Diff for /loncom/homework/optionresponse.pm between versions 1.111 and 1.112

version 1.111, 2004/07/02 08:21:39 version 1.112, 2004/07/06 14:53:00
Line 38  sub start_optionresponse { Line 38  sub start_optionresponse {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   my $result='';    my $result='';
   #when in a option response use these    #when in a option response use these
   &Apache::lonxml::register('Apache::optionresponse',('foilgroup','foil','conceptgroup'));    &Apache::lonxml::register('Apache::optionresponse',('foilgroup','foil','conceptgroup','drawoptionlist'));
   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);
   %Apache::hint::option=();    %Apache::hint::option=();
Line 78  sub end_optionresponse { Line 78  sub end_optionresponse {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   &Apache::response::end_response;    &Apache::response::end_response;
   pop @Apache::lonxml::namespace;    pop @Apache::lonxml::namespace;
   &Apache::lonxml::deregister('Apache::optionresponse',('foilgroup','foil','conceptgroup'));    &Apache::lonxml::deregister('Apache::optionresponse',('foilgroup','foil','conceptgroup','drawoptionlist'));
   my $result;    my $result;
   if ($target eq 'edit') { $result=&Apache::edit::end_table(); }    if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
   undef(%Apache::response::foilnames);    undef(%Apache::response::foilnames);
Line 338  sub displayfoils { Line 338  sub displayfoils {
  my $lastopt=$lastresponse{$name};   my $lastopt=$lastresponse{$name};
  if ($text!~/^\s*$/) { $break='<br />'; }   if ($text!~/^\s*$/) { $break='<br />'; }
  $result.=$break;   $result.=$break;
  if ($target eq 'web') {   if ($target eq 'web' || $target eq 'tex') {
     my $value=$Apache::response::foilgroup{$name.'.value'};      my $value=$Apache::response::foilgroup{$name.'.value'};
     if (!($text=~s|<drawoptionlist\s*/>|$value|)) {      if (!($text=~s|<drawoptionlist\s*/>|$value|)) {
  if ($text=~/^\s*$/) {   if ($text=~/^\s*$/) {
Line 350  sub displayfoils { Line 350  sub displayfoils {
  $text='&#149;'.$text;   $text='&#149;'.$text;
     }      }
     $result.=$text."\n";      $result.=$text."\n";
       }   }
       if ($Apache::lonhomework::type eq 'exam') {        if ($Apache::lonhomework::type eq 'exam') {
   $result.=&webbubbles(\@opt,\@alphabet,$temp,$lastopt);    $result.=&webbubbles(\@opt,\@alphabet,$temp,$lastopt);
       }        }
Line 603  sub end_foil { Line 603  sub end_foil {
   my $result = '';    my $result = '';
   if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {     if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') { 
       $text=&Apache::lonxml::endredirection;        $text=&Apache::lonxml::endredirection;
       $text=~/(\w)/;  
       if (($target eq 'tex') and ($Apache::lonhomework::type ne 'exam') and ($text=~/\S/)) {$text = '\vspace*{-2 mm}\item '.$text;}         if (($target eq 'tex') and ($Apache::lonhomework::type ne 'exam') and ($text=~/\S/)) {$text = '\vspace*{-2 mm}\item '.$text;} 
   }    }
   if ($target eq 'web' || $target eq 'grade' || $target eq 'answer'     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' 
Line 647  sub end_foil { Line 646  sub end_foil {
   return $result;    return $result;
 }  }
   
   sub start_drawoptionlist {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
       return $token->[4];
   }
   
   sub end_drawoptionlist {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
       return $token->[2];
   }
   
 sub insert_foil {  sub insert_foil {
   return '    return '
 <foil name="" value="unused">  <foil name="" value="unused">

Removed from v.1.111  
changed lines
  Added in v.1.112


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