--- loncom/homework/optionresponse.pm 2004/07/06 14:53:00 1.112
+++ loncom/homework/optionresponse.pm 2004/08/25 20:00:31 1.119
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: optionresponse.pm,v 1.112 2004/07/06 14:53:00 sakharuk Exp $
+# $Id: optionresponse.pm,v 1.119 2004/08/25 20:00:31 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -338,7 +338,7 @@ sub displayfoils {
my $lastopt=$lastresponse{$name};
if ($text!~/^\s*$/) { $break='
'; }
$result.=$break;
- if ($target eq 'web' || $target eq 'tex') {
+ if ($target eq 'web') {
my $value=$Apache::response::foilgroup{$name.'.value'};
if (!($text=~s||$value|)) {
if ($text=~/^\s*$/) {
@@ -453,10 +453,10 @@ sub optionlist_correction {
if ($TeXlayout eq 'vertical') {
$texoptionlist.=' \vskip 0 mm ',
} else {
- $texoptionlist.=',';
+ $texoptionlist.=', ';
}
}
- chop($texoptionlist);
+ $texoptionlist=~s/, $//;
if ($TeXlayout ne 'vertical') {$texoptionlist.='.';}
} else {
if ($TeXlayout ne 'vertical') {$texoptionlist='\\item [] \\vskip -5 mm';}
@@ -491,8 +491,8 @@ sub webbubbles {
sub bubbles {
- my ($ralphabit,$ropt) = @_;
- my @alphabet = @$ralphabit;
+ my ($ralphabet,$ropt,$response) = @_;
+ my @alphabet = @$ralphabet;
my @opt = @$ropt;
my ($result,$head,$line) =('','','');
my $number_of_bubbles = $#opt + 1;
@@ -508,6 +508,7 @@ sub bubbles {
for (my $ind=0;$ind<=$number_of_bubbles;$ind++) {
my $leftmargin;
$opt[$ind]=&Apache::lonxml::latex_special_symbols($opt[$ind]);
+ if ($response eq 'rankresponse') {$opt[$ind]='Rank '.$opt[$ind];}
if ($ind==0) {$leftmargin=6;} else {$leftmargin=10;}
$current_length += (length($opt[$ind])+length($alphabet[$ind])+4)*2;
if ($current_length<($textwidth-$leftmargin) and $ind!=$number_of_bubbles) {
@@ -603,6 +604,7 @@ sub end_foil {
my $result = '';
if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
$text=&Apache::lonxml::endredirection;
+ if ($target eq 'tex') {$text=~s/\\strut\s*\\\\\s*\\strut/\\vskip 0 mm/;}
if (($target eq 'tex') and ($Apache::lonhomework::type ne 'exam') and ($text=~/\S/)) {$text = '\vspace*{-2 mm}\item '.$text;}
}
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer'
@@ -648,12 +650,16 @@ sub end_foil {
sub start_drawoptionlist {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
- return $token->[4];
+ if ($target ne 'meta') {
+ return $token->[4];
+ }
}
sub end_drawoptionlist {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
- return $token->[2];
+ if ($target ne 'meta') {
+ return $token->[2];
+ }
}
sub insert_foil {