Diff for /loncom/homework/optionresponse.pm between versions 1.81 and 1.84.2.1

version 1.81, 2003/07/25 19:29:15 version 1.84.2.1, 2003/09/23 01:52:57
Line 303  sub displayfoils { Line 303  sub displayfoils {
   my $break;    my $break;
   my $solved=$Apache::lonhomework::history{"resource.$part.solved"};    my $solved=$Apache::lonhomework::history{"resource.$part.solved"};
   my $status=$Apache::inputtags::status[-1];    my $status=$Apache::inputtags::status[-1];
   if (    if ( ($target ne 'tex') &&
       ($target ne 'tex') &&         &Apache::response::show_answer() ) {
       (($solved =~ /^correct/) || ($status eq 'SHOW_ANSWER')) ) {  
     foreach $name (@whichopt) {      foreach $name (@whichopt) {
  my $text=$Apache::response::foilgroup{$name.'.text'};   my $text=$Apache::response::foilgroup{$name.'.text'};
  if ($text!~/^\s*$/) {   if ($text!~/^\s*$/) {
Line 328  sub displayfoils { Line 327  sub displayfoils {
     $result.=$text."\n";      $result.=$text."\n";
       } elsif ($target eq 'tex') {        } elsif ($target eq 'tex') {
   $Apache::response::foilgroup{$name.'.text'}=~s/\\item//;    $Apache::response::foilgroup{$name.'.text'}=~s/\\item//;
    $result .='\item \textit{'.$Apache::response::foilgroup{$name.'.value'}.'}'.    if ($max>1) {$result .='\item ';}
      $result .=' \textit{'.$Apache::response::foilgroup{$name.'.value'}.'}'.
       ":".$Apache::response::foilgroup{$name.'.text'}."\n";        ":".$Apache::response::foilgroup{$name.'.text'}."\n";
       }        }
       if ($Apache::lonhomework::type eq 'exam') {        if ($Apache::lonhomework::type eq 'exam') {
Line 436  sub displayfoils { Line 436  sub displayfoils {
 sub optionlist_correction {  sub optionlist_correction {
   
     my $texoptionlist = shift;      my $texoptionlist = shift;
     if ($texoptionlist=~/<option selected/) {      if ($texoptionlist=~/<option selected/ or $texoptionlist=~/<option>[^<]+<\/option>/) {
  $texoptionlist =~ s/<option><\/option>/\\item \[\] Possible answers are:/;   $texoptionlist =~ s/<option><\/option>/\\item \[\] Choose from: /;
  $texoptionlist =~ s/<option>/\{\\bf /g;   $texoptionlist =~ s/<option>/\{\\bf /g;
  $texoptionlist =~ s/<option selected="on">/\{\\bf /g;   $texoptionlist =~ s/<option selected="on">/\{\\bf /g;
  $texoptionlist =~ s/<\/option>/\},/g;   $texoptionlist =~ s/<\/option>/\},/g;

Removed from v.1.81  
changed lines
  Added in v.1.84.2.1


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