Diff for /loncom/homework/radiobuttonresponse.pm between versions 1.106 and 1.108

version 1.106, 2006/03/27 21:18:16 version 1.108, 2006/12/07 23:10:42
Line 32  use HTML::Entities(); Line 32  use HTML::Entities();
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonnet;  use Apache::lonnet;
   
   my $exam_max_bubbles = 10;
   
 BEGIN {  BEGIN {
     &Apache::lonxml::register('Apache::radiobuttonresponse',('radiobuttonresponse'));      &Apache::lonxml::register('Apache::radiobuttonresponse',('radiobuttonresponse'));
 }  }
Line 274  sub displayallfoils { Line 276  sub displayallfoils {
                 $result .= '<label>';                  $result .= '<label>';
  $result.="<input type=\"radio\" name=\"HWVAL_$Apache::inputtags::response['-1']\" value=\"$temp\" ";   $result.="<input type=\"radio\" name=\"HWVAL_$Apache::inputtags::response['-1']\" value=\"$temp\" ";
  if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }   if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }
  $result .= '>'.$Apache::response::foilgroup{$name.'.text'}.   $result .= ' />'.$Apache::response::foilgroup{$name.'.text'}.
                     '</label>';                      '</label>';
  $temp++;   $temp++;
  if ($direction eq 'horizontal') { $result.="</td>"; }   if ($direction eq 'horizontal') { $result.="</td>"; }
Line 487  sub displayfoils { Line 489  sub displayfoils {
                 $result.= '<label>';                  $result.= '<label>';
  $result.="<input type=\"radio\" name=\"HWVAL_$Apache::inputtags::response['-1']\" value=\"$temp\" ";   $result.="<input type=\"radio\" name=\"HWVAL_$Apache::inputtags::response['-1']\" value=\"$temp\" ";
  if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }   if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }
  $result .= '>'.$Apache::response::foilgroup{$name.'.text'}."</label>";   $result .= ' />'.$Apache::response::foilgroup{$name.'.text'}."</label>";
     } else {      } else {
  if ($Apache::lonhomework::type eq 'exam') {   if ($Apache::lonhomework::type eq 'exam') {
       
       # If necessary, start a new group of bubbles
       # in the next row on the scantron sheet:
       #
       if ($i >= $exam_max_bubbles) {
    $i = 0; # Back to A.
    $Apache::lonxml::counter++; # Next row of bubbles...
    $result .= '\item[\textbf{'.$Apache::lonxml::counter.'}.]';
       }
   
     $result .= '{\small \textbf{'.$alphabet[$i].'}}$\bigcirc$'.$Apache::response::foilgroup{$name.'.text'}.'\\\\';  #' stupid emacs      $result .= '{\small \textbf{'.$alphabet[$i].'}}$\bigcirc$'.$Apache::response::foilgroup{$name.'.text'}.'\\\\';  #' stupid emacs
     $i++;      $i++;
   
  } else {   } else {
     $result .= '\vspace*{-2 mm}\item '.$Apache::response::foilgroup{$name.'.text'};      $result .= '\vspace*{-2 mm}\item '.$Apache::response::foilgroup{$name.'.text'};
  }   }

Removed from v.1.106  
changed lines
  Added in v.1.108


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