Diff for /loncom/homework/optionresponse.pm between versions 1.38 and 1.41

version 1.38, 2002/04/25 21:35:30 version 1.41, 2002/06/21 20:36:30
Line 132  ENDTABLE Line 132  ENDTABLE
     if ($optchanged) {      if ($optchanged) {
       $result = "<foilgroup options=\"(";        $result = "<foilgroup options=\"(";
       foreach my $option (@options) {        foreach my $option (@options) {
  $option=~s/\'/\\\'/;   $option=~s/\'/\\\'/g;
  &Apache::lonxml::debug("adding option :$option:");   &Apache::lonxml::debug("adding option :$option:");
  $result .="'".$option."',";   $result .="'".$option."',";
       }        }
Line 229  sub getfoilcounts { Line 229  sub getfoilcounts {
   my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');    my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');
   # +1 since instructors will count from 1    # +1 since instructors will count from 1
   my $count = $#{ $Apache::response::foilgroup{'names'} }+1;    my $count = $#{ $Apache::response::foilgroup{'names'} }+1;
     if (&Apache::response::showallfoils()) { $max=$count; }
   return ($count,$max);    return ($count,$max);
 }  }
   
Line 238  sub whichfoils { Line 239  sub whichfoils {
   my @whichopt =();    my @whichopt =();
   while ((($#whichopt+1) < $max) && ($#names > -1)) {    while ((($#whichopt+1) < $max) && ($#names > -1)) {
     &Apache::lonxml::debug("Have $#whichopt max is $max");      &Apache::lonxml::debug("Have $#whichopt max is $max");
     my $aopt=int(rand($#names+1));      my $aopt;
       if (&Apache::response::showallfoils()) {
         $aopt=0;
       } else {
         $aopt=int(rand($#names+1));
       }
     &Apache::lonxml::debug("From $#whichopt $max $#names elms, picking $aopt");      &Apache::lonxml::debug("From $#whichopt $max $#names elms, picking $aopt");
     $aopt=splice(@names,$aopt,1);      $aopt=splice(@names,$aopt,1);
     &Apache::lonxml::debug("Picked $aopt");      &Apache::lonxml::debug("Picked $aopt");
Line 307  sub displayfoils { Line 313  sub displayfoils {
       $durtyoptionlist =~ s/<option>/{\\bf /g;        $durtyoptionlist =~ s/<option>/{\\bf /g;
       $durtyoptionlist =~ s/<\/option>/},/g;        $durtyoptionlist =~ s/<\/option>/},/g;
       $durtyoptionlist =~ s/,$/\./g;        $durtyoptionlist =~ s/,$/\./g;
         $durtyoptionlist =~ s/>/\$>\$/g;
         $durtyoptionlist =~ s/</\$<\$/g;
         $durtyoptionlist =~ s/=/\$=\$/g;
       $result.= $durtyoptionlist.$Apache::response::foilgroup{$name.'.text'};        $result.= $durtyoptionlist.$Apache::response::foilgroup{$name.'.text'};
       $Apache::optionresponse::displayoptionintex=1;        $Apache::optionresponse::displayoptionintex=1;
   } else {    } else {
Line 424  sub end_foil { Line 433  sub end_foil {
       &Apache::lonxml::debug("Got a name of :$name:");        &Apache::lonxml::debug("Got a name of :$name:");
       if (!$name) { $name=$Apache::lonxml::curdepth; }        if (!$name) { $name=$Apache::lonxml::curdepth; }
       &Apache::lonxml::debug("Using a name of :$name:");        &Apache::lonxml::debug("Using a name of :$name:");
       if ( $Apache::optionresponse::conceptgroup ) {        if ( $Apache::optionresponse::conceptgroup
      && !&Apache::response::showallfoils() ) {
  push @{ $Apache::response::conceptgroup{'names'} }, $name;   push @{ $Apache::response::conceptgroup{'names'} }, $name;
  $Apache::response::conceptgroup{"$name.value"} = $value;   $Apache::response::conceptgroup{"$name.value"} = $value;
  $Apache::response::conceptgroup{"$name.text"} = $text;   $Apache::response::conceptgroup{"$name.text"} = $text;

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


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