Diff for /loncom/homework/radiobuttonresponse.pm between versions 1.38 and 1.40

version 1.38, 2002/04/03 16:54:37 version 1.40, 2002/05/03 19:44:13
Line 213  sub whichfoils { Line 213  sub whichfoils {
       push (@falselist,$name);        push (@falselist,$name);
     } elsif ($Apache::response::foilgroup{$name.'.value'} eq 'unused') {      } elsif ($Apache::response::foilgroup{$name.'.value'} eq 'unused') {
     } else {      } else {
       &Apache::lonxml::error("Unknown state $Apache::response::foilgroup{$name.'.value'} for $name in <foilgroup>");        &Apache::lonxml::error(&HTML::Entites::encode("No valid value assigned ($Apache::response::foilgroup{$name.'.value'}) for foil $name in <foilgroup>"));
     }      }
   }    }
   my $whichtrue = int(rand($#truelist+1));    my $whichtrue = int(rand($#truelist+1));
   &Apache::lonxml::debug("Max is $max, From $#truelist elms, picking $whichtrue");    &Apache::lonxml::debug("Max is $max, From $#truelist elms, picking $whichtrue");
   my @whichfalse =();    my @whichfalse =();
   while ((($#whichfalse+1) < $max) && ($#falselist > -1)) {    while ((($#whichfalse+1) < $max-1) && ($#falselist > -1)) {
     &Apache::lonxml::debug("Have $#whichfalse max is $max");      &Apache::lonxml::debug("Have $#whichfalse max is $max");
     my $afalse=int(rand($#falselist+1));      my $afalse=int(rand($#falselist+1));
     &Apache::lonxml::debug("From $#falselist elms, picking $afalse");      &Apache::lonxml::debug("From $#falselist elms, picking $afalse");
Line 266  sub displayfoils { Line 266  sub displayfoils {
       $temp++;        $temp++;
     }      }
   }    }
       if ($target ne 'tex') {    if ($target ne 'tex') { $result.="<br />"; }
   return $result."<br />";    return $result;
       } else {  
   return $result;  
       }  
 }  }
   
 sub displayanswers {  sub displayanswers {

Removed from v.1.38  
changed lines
  Added in v.1.40


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