version 1.84.2.1, 2003/09/23 01:52:57
|
version 1.84.2.2, 2003/10/15 19:51:29
|
Line 305 sub displayfoils {
|
Line 305 sub displayfoils {
|
my $status=$Apache::inputtags::status[-1]; |
my $status=$Apache::inputtags::status[-1]; |
if ( ($target ne 'tex') && |
if ( ($target ne 'tex') && |
&Apache::response::show_answer() ) { |
&Apache::response::show_answer() ) { |
|
my $temp=1; |
foreach $name (@whichopt) { |
foreach $name (@whichopt) { |
my $text=$Apache::response::foilgroup{$name.'.text'}; |
my $text=$Apache::response::foilgroup{$name.'.text'}; |
|
my %lastresponse=&Apache::lonnet::str2hash($Apache::lonhomework::history{"resource.$part.$id.submission"}); |
|
my $lastopt=$lastresponse{$name}; |
if ($text!~/^\s*$/) { |
if ($text!~/^\s*$/) { |
if ($target eq 'tex') { |
if ($target eq 'tex') { |
$break='\vskip 0 mm '; |
$break='\vskip 0 mm '; |
Line 333 sub displayfoils {
|
Line 336 sub displayfoils {
|
} |
} |
if ($Apache::lonhomework::type eq 'exam') { |
if ($Apache::lonhomework::type eq 'exam') { |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$result.=&webbubbles(\@opt,\@alphabet); |
$result.=&webbubbles(\@opt,\@alphabet,$temp,$lastopt); |
} else { |
} else { |
$result.=&bubbles(\@alphabet,\@opt); |
$result.=&bubbles(\@alphabet,\@opt); |
} |
} |
} |
} |
|
$temp++; |
} |
} |
} else { |
} else { |
my $temp=1; |
my $temp=1; |
Line 374 sub displayfoils {
|
Line 378 sub displayfoils {
|
} |
} |
$result.=$break.$text."\n"; |
$result.=$break.$text."\n"; |
if ($Apache::lonhomework::type eq 'exam') { |
if ($Apache::lonhomework::type eq 'exam') { |
$result.=&webbubbles(\@opt,\@alphabet,$temp); |
$result.=&webbubbles(\@opt,\@alphabet,$temp,$lastopt); |
} |
} |
$temp++; |
$temp++; |
} else { |
} else { |
Line 455 sub optionlist_correction {
|
Line 459 sub optionlist_correction {
|
|
|
sub webbubbles { |
sub webbubbles { |
|
|
my ($ropt,$ralphabet,$temp)=@_; |
my ($ropt,$ralphabet,$temp,$lastopt)=@_; |
my @opt=@$ropt; |
my @opt=@$ropt; |
my @alphabet=@$ralphabet; |
my @alphabet=@$ralphabet; |
my $result=''; |
my $result=''; |
my $number_of_bubbles = $#opt + 1; |
my $number_of_bubbles = $#opt + 1; |
$result.= '<table border="1"><tr>'; |
$result.= '<table border="1"><tr>'; |
for (my $ind=0;$ind<$number_of_bubbles;$ind++) { |
for (my $ind=0;$ind<$number_of_bubbles;$ind++) { |
$result.='<td><input type="radio" name="HWVAL_'.$Apache::inputtags::response['-1'].':'.$temp. |
my $checked=''; |
'" value='.$opt[$ind].'>'.$alphabet[$ind].': '.$opt[$ind].'</td>'; |
if ($lastopt eq $opt[$ind]) { |
|
$checked=' checked="on" '; |
} |
} |
$result.='</tr></table>'; |
$result.='<td><input type="radio" name="HWVAL_'. |
return $result; |
$Apache::inputtags::response['-1'].':'.$temp. |
|
'" value="'.$opt[$ind].'" '.$checked.' />'.$alphabet[$ind].': '. |
|
$opt[$ind].'</td>'; |
|
} |
|
$result.='</tr></table>'; |
|
return $result; |
} |
} |
|
|
|
|