--- loncom/homework/matchresponse.pm 2003/11/07 08:52:20 1.30
+++ loncom/homework/matchresponse.pm 2004/01/06 20:16:17 1.32
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Full matching style response
#
-# $Id: matchresponse.pm,v 1.30 2003/11/07 08:52:20 albertel Exp $
+# $Id: matchresponse.pm,v 1.32 2004/01/06 20:16:17 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -317,9 +317,9 @@ sub grade_response {
my $response = &Apache::response::getresponse($temp);
push(@items,$response);
my $responsename = $letter_name_map{$response};
- $responsehash{$name}=$responsename;
my $value=$Apache::response::foilgroup{$name.'.value'};
if ( $response =~ /[^\s]/) {
+ $responsehash{$name}=$responsename;
&Apache::lonxml::debug("submitted a $response for $value
\n");
if ($value eq $responsename) {
$grade{$name}='1'; $right++;
@@ -465,11 +465,19 @@ sub displayfoils {
} elsif ($result=&itemdisplay('bottom')) {
$result=$question.$result;
} elsif ($result=&itemdisplay('right')) {
- $result='
'.$question.' | '.$result.
- ' |
';
+ if ($target ne 'tex') {
+ $result=''.$question.' | '.$result.
+ ' |
';
+ } else {
+ $result='\begin{tabular}{p{\textwidth/2}p{\textwidth/2}}\begin{minipage}{\textwidth/2}'.$question.'\end{minipage}&\begin{minipage}{\textwidth/2}'.$result.'\end{minipage}\end{tabular}';
+ }
} elsif ($result=&itemdisplay('left')) {
- $result=''.$result.' | '.$question.
- ' |
';
+ if ($target ne 'tex') {
+ $result=''.$result.' | '.$question.
+ ' |
';
+ } else {
+ $result='\begin{tabular}{p{\textwidth/2}p{\textwidth/2}}\begin{minipage}{\textwidth/2}'.$result.'\end{minipage}&\begin{minipage}{\textwidth/2}'.$question.'\end{minipage}\end{tabular}';
+ }
}
if ($target ne 'tex') {$result.="
";} else {$result.=' \\\\ ';}
return $result;