Diff for /loncom/homework/optionresponse.pm between versions 1.61 and 1.62

version 1.61, 2002/11/11 20:13:47 version 1.62, 2002/11/11 20:26:59
Line 318  sub displayfoils { Line 318  sub displayfoils {
   my @whichopt = &whichfoils($max,$randomize);    my @whichopt = &whichfoils($max,$randomize);
   my $part=$Apache::inputtags::part;    my $part=$Apache::inputtags::part;
   my $id=$Apache::inputtags::response[-1];    my $id=$Apache::inputtags::response[-1];
     my $break;
   if (($Apache::lonhomework::history{"resource.$part.solved"} =~ /^correct/)  || ($Apache::inputtags::status[-1] eq  'SHOW_ANSWER')) {        if (($Apache::lonhomework::history{"resource.$part.solved"} =~ /^correct/)  || ($Apache::inputtags::status[-1] eq  'SHOW_ANSWER')) {    
     my $temp=1; ####      my $temp=1; ####
     foreach $name (@whichopt) {      foreach $name (@whichopt) {
       if ($target eq 'web') {   my $text=$Apache::response::foilgroup{$name.'.text'};
   $result.="<br />";   if ($text!~/^\s*$/) {
       if ($target eq 'tex') {
    $break='\vskip 0 mm ';
       } elsif ($target eq 'web') {
    $break='<br />';
       }
    }
    $result.=$break;
    if ($target eq 'web') {
       my $value=$Apache::response::foilgroup{$name.'.value'};
       if (!($text=~s|<drawoptionlist\s*/>|$value|)) {
    if ($text=~/^\s*$/) {
       $text=$value.$text;
    } else {
       $text=$value.': '.$text;
    }
       }
       $result.=$text."\n";
       } elsif ($target eq 'tex') {        } elsif ($target eq 'tex') {
   $result.='\vskip 0 mm ';  
       }  
       if ($target ne 'tex') {  
   my $text=$Apache::response::foilgroup{$name.'.text'};  
   my $value=$Apache::response::foilgroup{$name.'.value'};  
   if (!($text=~s|<drawoptionlist\s*/>|$value|)) {  
       $text=$value.': '.$text;  
   }  
   $result.=$text."\n";  
       } else {  
   $Apache::response::foilgroup{$name.'.text'}=~s/\\item//;    $Apache::response::foilgroup{$name.'.text'}=~s/\\item//;
    $result .='\item \textit{'.$Apache::response::foilgroup{$name.'.value'}.'}'.     $result .='\item \textit{'.$Apache::response::foilgroup{$name.'.value'}.'}'.
       ":".$Apache::response::foilgroup{$name.'.text'}."\n";        ":".$Apache::response::foilgroup{$name.'.text'}."\n";
Line 351  sub displayfoils { Line 359  sub displayfoils {
     my $temp=1;      my $temp=1;
     my %lastresponse=&Apache::lonnet::str2hash($Apache::lonhomework::history{"resource.$part.$id.submission"});      my %lastresponse=&Apache::lonnet::str2hash($Apache::lonhomework::history{"resource.$part.$id.submission"});
     foreach $name (@whichopt) {      foreach $name (@whichopt) {
         my $text=$Apache::response::foilgroup{$name.'.text'};
         if ($text!~/^\s*$/) {
     if ($target eq 'tex') {
         $break='\vskip 0 mm ';
     } elsif ($target eq 'web') {
         $break='<br />';
     }
         }
       my $lastopt=$lastresponse{$name};        my $lastopt=$lastresponse{$name};
       my $optionlist="<option></option>\n";        my $optionlist="<option></option>\n";
       my $option;        my $option;
Line 369  sub displayfoils { Line 385  sub displayfoils {
   if (!($text=~s|<drawoptionlist\s*/>|$optionlist|)) {    if (!($text=~s|<drawoptionlist\s*/>|$optionlist|)) {
       $text=$optionlist.$text;        $text=$optionlist.$text;
   }    }
   $result.="<br />".$text."\n";    $result.=$break.$text."\n";
   if ($Apache::lonhomework::type eq 'exam') {    if ($Apache::lonhomework::type eq 'exam') {
     $result.=&webbubbles(\@opt,\@alphabet);      $result.=&webbubbles(\@opt,\@alphabet);
   }    }
Line 417  sub displayfoils { Line 433  sub displayfoils {
   $result.=&bubbles(\@alphabet,\@opt);    $result.=&bubbles(\@alphabet,\@opt);
       }        }
   }    }
       }         }
     }      }
   }   
   if ($target ne 'tex') {  
       return $result."<br />";  
   }    }
   else {    if ($target ne 'tex') {
         return $result.$break;
     } else {
       return $result;        return $result;
   }    }
 }  }

Removed from v.1.61  
changed lines
  Added in v.1.62


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