--- loncom/homework/optionresponse.pm 2002/10/28 23:31:48 1.57
+++ loncom/homework/optionresponse.pm 2002/11/07 16:45:55 1.58
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: optionresponse.pm,v 1.57 2002/10/28 23:31:48 albertel Exp $
+# $Id: optionresponse.pm,v 1.58 2002/11/07 16:45:55 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -318,7 +318,8 @@ sub displayfoils {
my @whichopt = &whichfoils($max,$randomize);
my $part=$Apache::inputtags::part;
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) {
if ($target eq 'web') {
$result.="
";
@@ -333,6 +334,14 @@ sub displayfoils {
$result .='\item \textit{'.$Apache::response::foilgroup{$name.'.value'}.'}'.
":".$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 {
my $temp=1;
@@ -353,12 +362,7 @@ sub displayfoils {
.$optionlist
."\n".$Apache::response::foilgroup{$name.'.text'}."\n";
if ($Apache::lonhomework::type eq 'exam') {
- my $number_of_bubbles = $#opt + 1;
- $result.= '
';
- for (my $ind=0;$ind<$number_of_bubbles;$ind++) {
- $result.=''.$alphabet[$ind].': '.$opt[$ind].' | ';
- }
- $result.='
';
+ $result.=&webbubbles(\@opt,\@alphabet);
}
$temp++;
} else {
@@ -425,6 +429,22 @@ sub optionlist_correction {
}
+sub webbubbles {
+
+ my ($ropt,$ralphabet)=@_;
+ my @opt=@$ropt;
+ my @alphabet=@$ralphabet;
+ my $result='';
+ my $number_of_bubbles = $#opt + 1;
+ $result.= '';
+ for (my $ind=0;$ind<$number_of_bubbles;$ind++) {
+ $result.=''.$alphabet[$ind].': '.$opt[$ind].' | ';
+ }
+ $result.='
';
+ return $result;
+}
+
+
sub bubbles {
my ($ralphabit,$ropt) = @_;