--- loncom/homework/radiobuttonresponse.pm 2008/11/20 15:19:15 1.139 +++ loncom/homework/radiobuttonresponse.pm 2010/05/03 14:43:50 1.145 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # mutliple choice style responses # -# $Id: radiobuttonresponse.pm,v 1.139 2008/11/20 15:19:15 jms Exp $ +# $Id: radiobuttonresponse.pm,v 1.145 2010/05/03 14:43:50 onken Exp $ # # Copyright Michigan State University Board of Trustees # @@ -74,14 +74,14 @@ sub start_radiobuttonresponse { .'
";
} else {
if ($target eq 'tex') {
- if($env{'form.pdfFormFields'} eq 'yes') {
- my $fieldname = $env{'request.symb'}.
- '&part_'. $Apache::inputtags::part.
- '&radiobuttonresponse'.
- '&HWVAL_' . $Apache::inputtags::response['-1'];
- my $value = $temp;
- my $text = $Apache::response::foilgroup{$name.'.text'};
- $result .= &Apache::lonxml::print_pdf_radiobutton($fieldname,
- $value,
- $text)."\n";
+ if($env{'form.pdfFormFields'} eq 'yes' && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
+ my $fieldname = $env{'request.symb'}.'&part_'. $Apache::inputtags::part
+ .'&radiobuttonresponse'.'&HWVAL_'.$Apache::inputtags::response['-1'];
+ $result .= '\item[{'.&Apache::lonxml::print_pdf_radiobutton($fieldname,$temp).'}]'
+ .$Apache::response::foilgroup{$name.'.text'}."\n";
} else {
$result .= '\item \vskip -2mm ';
}
@@ -376,7 +389,7 @@ sub displayallfoils {
}
}
if ($target eq 'tex') {
- if($env{'form.pdfFormFields'} ne 'yes') {
+ if($env{'form.pdfFormFields'} ne 'yes' or $Apache::inputtags::status[-1] ne 'CAN_ANSWER') {
$result .= '$\bigcirc$'.$Apache::response::foilgroup{$name.'.text'}.'\\\\'; #' stupid emacs
}
$i++;
@@ -386,8 +399,8 @@ sub displayallfoils {
onchange=\"javascript:setSubmittedPart('$part');\"
type=\"radio\"
name=\"HWVAL_$Apache::inputtags::response['-1']\"
- value=\"$temp\" ";
- if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }
+ value=\"$temp\"";
+ if (defined($lastresponse{$name})) { $result .= ' checked="checked"'; }
$result .= ' />'.$Apache::response::foilgroup{$name.'.text'}.
'';
}
@@ -439,7 +452,11 @@ sub whichfoils {
&Apache::lonxml::error(&HTML::Entities::encode("No valid value assigned ($Apache::response::foilgroup{$name.'.value'}) for foil $name in '); } } else { @@ -499,7 +516,11 @@ sub whichfoils { &Apache::lonxml::debug("Answer wants $answer"); my $truename=$truelist[$whichtrue]; my $dosplice=1; - if ($notrue && $Apache::lonhomework::type ne 'survey') { + if (($notrue) && + ($Apache::lonhomework::type ne 'survey') && + ($Apache::lonhomework::type ne 'surveycred') && + ($Apache::lonhomework::type ne 'anonsurvey') && + ($Apache::lonhomework::type ne 'anonsurveycred')) { $dosplice=0; &Apache::lonxml::error(&mt('There are no true statements available.').' '); } @@ -615,8 +636,8 @@ sub displayfoils { ""; } else { if ($Apache::lonhomework::type eq 'exam') { @@ -630,18 +651,14 @@ sub displayfoils { $i++; $bubble_number++; } else { - if($env{'form.pdfFormFields'} eq 'yes') { - - my $fieldname = $env{'request.symb'}. - '&part_'. $Apache::inputtags::part. - '&radiobuttonresponse'. - '&HWVAL_' . $Apache::inputtags::response['-1']; - my $value = $temp; - my $text = $Apache::response::foilgroup{$name.'.text'}; - $result .= &Apache::lonxml::print_pdf_radiobutton($fieldname, $value, $text).'\newline'."\n"; - } else { - $result .= '\vspace*{-2 mm}\item '.$Apache::response::foilgroup{$name.'.text'}; - } + if($env{'form.pdfFormFields'} eq 'yes' && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') { + my $fieldname = $env{'request.symb'}.'&part_'. $Apache::inputtags::part + .'&radiobuttonresponse'.'&HWVAL_'.$Apache::inputtags::response['-1']; + $result .= '\item[{'.&Apache::lonxml::print_pdf_radiobutton($fieldname,$temp).'}]' + .$Apache::response::foilgroup{$name.'.text'}."\n"; + } else { + $result .= '\vspace*{-2 mm}\item '.$Apache::response::foilgroup{$name.'.text'}; + } } } if ($target ne 'tex' && $direction eq 'horizontal') { |