Diff for /loncom/homework/radiobuttonresponse.pm between versions 1.147 and 1.148.2.1

version 1.147, 2010/12/19 04:24:29 version 1.148.2.1, 2011/09/16 23:14:28
Line 336  sub displayallfoils { Line 336  sub displayallfoils {
     my $i   =0;      my $i   =0;
     my $id=$Apache::inputtags::response['-1'];      my $id=$Apache::inputtags::response['-1'];
     my $part=$Apache::inputtags::part;      my $part=$Apache::inputtags::part;
     my $lastresponse;  
     my ($lastresponse,$newvariation,$showanswer);      my ($lastresponse,$newvariation,$showanswer);
     if ((($Apache::lonhomework::history{"resource.$part.type"} eq 'randomizetry') ||      if ((($Apache::lonhomework::history{"resource.$part.type"} eq 'randomizetry') ||
         ($Apache::lonhomework::type eq 'randomizetry')) &&          ($Apache::lonhomework::type eq 'randomizetry')) &&
Line 556  sub whichfoils { Line 555  sub whichfoils {
     $dosplice=0;      $dosplice=0;
  } else {   } else {
     if ($topcount>0 || $bottomcount>0) {      if ($topcount>0 || $bottomcount>0) {
  $answer = int(&Math::Random::random_uniform() * ($#whichfalse+1))                  my $inc = 1;
     + $topcount;                  if (($bottomcount > 0) && ($Apache::lonhomework::type ne 'exam')) {
                       $inc = 2;
                   }
                   $answer=int(&Math::Random::random_uniform() * ($#whichfalse+$inc))
                           + $topcount;
   
     }      }
  }   }
  &Apache::lonxml::debug("Answer now wants $answer");   &Apache::lonxml::debug("Answer now wants $answer");

Removed from v.1.147  
changed lines
  Added in v.1.148.2.1


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