[LON-CAPA-cvs] cvs: loncom /homework matchresponse.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 06 Jan 2004 20:16:17 -0000


sakharuk		Tue Jan  6 15:16:17 2004 EDT

  Modified files:              
    /loncom/homework	matchresponse.pm 
  Log:
  Bug 2541 (matching problem does not print properly) is fixed. Attribute location
  in itemgroup tag is now supported.
  
  
Index: loncom/homework/matchresponse.pm
diff -u loncom/homework/matchresponse.pm:1.31 loncom/homework/matchresponse.pm:1.32
--- loncom/homework/matchresponse.pm:1.31	Sat Nov 15 01:28:02 2003
+++ loncom/homework/matchresponse.pm	Tue Jan  6 15:16:17 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Full matching style response
 #
-# $Id: matchresponse.pm,v 1.31 2003/11/15 06:28:02 albertel Exp $
+# $Id: matchresponse.pm,v 1.32 2004/01/06 20:16:17 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -465,11 +465,19 @@
     } elsif ($result=&itemdisplay('bottom')) {
 	$result=$question.$result;
     } elsif ($result=&itemdisplay('right')) {
-	$result='<table><tr><td>'.$question.'</td><td>'.$result.
-	    '</td></tr></table>';
+	if ($target ne 'tex') {
+	    $result='<table><tr><td>'.$question.'</td><td>'.$result.
+		'</td></tr></table>';
+	} 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='<table><tr><td>'.$result.'</td><td>'.$question.
-	    '</td></tr></table>';
+	if ($target ne 'tex') {
+	    $result='<table><tr><td>'.$result.'</td><td>'.$question.
+		'</td></tr></table>';
+	} 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.="<br />";} else {$result.=' \\\\ ';}
     return $result;