version 1.57, 2002/10/28 23:31:48
|
version 1.58, 2002/11/07 16:45:55
|
Line 318 sub displayfoils {
|
Line 318 sub displayfoils {
|
my @whichopt = &whichfoils($max,$randomize); |
my @whichopt = &whichfoils($max,$randomize); |
my $part=$Apache::inputtags::part; |
my $part=$Apache::inputtags::part; |
my $id=$Apache::inputtags::response[-1]; |
my $id=$Apache::inputtags::response[-1]; |
if (($Apache::lonhomework::history{"resource.$part.solved"} =~ /^correct/) || ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER')) { |
if (($Apache::lonhomework::history{"resource.$part.solved"} =~ /^correct/) || ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER')) { |
|
my $temp=1; #### |
foreach $name (@whichopt) { |
foreach $name (@whichopt) { |
if ($target eq 'web') { |
if ($target eq 'web') { |
$result.="<br />"; |
$result.="<br />"; |
Line 333 sub displayfoils {
|
Line 334 sub displayfoils {
|
$result .='\item \textit{'.$Apache::response::foilgroup{$name.'.value'}.'}'. |
$result .='\item \textit{'.$Apache::response::foilgroup{$name.'.value'}.'}'. |
":".$Apache::response::foilgroup{$name.'.text'}."\n"; |
":".$Apache::response::foilgroup{$name.'.text'}."\n"; |
} |
} |
|
if ($Apache::lonhomework::type eq 'exam') { |
|
if ($target ne 'tex') { |
|
$result.=&webbubbles(\@opt,\@alphabet); |
|
} else { |
|
$result.=&bubbles(\@alphabet,\@opt); |
|
} |
|
} |
|
$temp++; |
} |
} |
} else { |
} else { |
my $temp=1; |
my $temp=1; |
Line 353 sub displayfoils {
|
Line 362 sub displayfoils {
|
.$optionlist |
.$optionlist |
."</select>\n".$Apache::response::foilgroup{$name.'.text'}."\n"; |
."</select>\n".$Apache::response::foilgroup{$name.'.text'}."\n"; |
if ($Apache::lonhomework::type eq 'exam') { |
if ($Apache::lonhomework::type eq 'exam') { |
my $number_of_bubbles = $#opt + 1; |
$result.=&webbubbles(\@opt,\@alphabet); |
$result.= '<table border="1"><tr>'; |
|
for (my $ind=0;$ind<$number_of_bubbles;$ind++) { |
|
$result.='<td>'.$alphabet[$ind].': '.$opt[$ind].'</td>'; |
|
} |
|
$result.='</tr></table>'; |
|
} |
} |
$temp++; |
$temp++; |
} else { |
} else { |
Line 425 sub optionlist_correction {
|
Line 429 sub optionlist_correction {
|
} |
} |
|
|
|
|
|
sub webbubbles { |
|
|
|
my ($ropt,$ralphabet)=@_; |
|
my @opt=@$ropt; |
|
my @alphabet=@$ralphabet; |
|
my $result=''; |
|
my $number_of_bubbles = $#opt + 1; |
|
$result.= '<table border="1"><tr>'; |
|
for (my $ind=0;$ind<$number_of_bubbles;$ind++) { |
|
$result.='<td>'.$alphabet[$ind].': '.$opt[$ind].'</td>'; |
|
} |
|
$result.='</tr></table>'; |
|
return $result; |
|
} |
|
|
|
|
sub bubbles { |
sub bubbles { |
|
|
my ($ralphabit,$ropt) = @_; |
my ($ralphabit,$ropt) = @_; |