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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 07 Oct 2004 18:06:05 -0000


albertel		Thu Oct  7 14:06:05 2004 EDT

  Modified files:              
    /loncom/homework	matchresponse.pm 
  Log:
  - BUG#3520, cleanup display of matchresponse is some small ways.
  
  
Index: loncom/homework/matchresponse.pm
diff -u loncom/homework/matchresponse.pm:1.44 loncom/homework/matchresponse.pm:1.45
--- loncom/homework/matchresponse.pm:1.44	Thu Jul  8 13:51:31 2004
+++ loncom/homework/matchresponse.pm	Thu Oct  7 14:06:05 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Full matching style response
 #
-# $Id: matchresponse.pm,v 1.44 2004/07/08 17:51:31 sakharuk Exp $
+# $Id: matchresponse.pm,v 1.45 2004/10/07 18:06:05 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -460,9 +460,9 @@
 	    my $text=$Apache::response::foilgroup{$name.'.text'};
 	    if ($target ne 'tex') {
 		if ($Apache::lonhomework::type ne 'exam') {
-		    $question.='<br />'.$optionlist.$text."\n";
+		    $question.="<br />\n".$optionlist.$text;
 		} else {
-		    $question.='<br />'.$text."\n";
+		    $question.="<br />\n".$text;
 		}
 		if ($Apache::lonhomework::type eq 'exam') {
 		    my @blank;
@@ -488,8 +488,10 @@
 	$result=$question.$result;
     } elsif ($result=&itemdisplay('right')) {
 	if ($target ne 'tex') {
-	    $result='<table><tr><td>'.$question.'</td><td>'.$result.
-		'</td></tr></table>';
+	    #remove the first <br />
+	    $question=~s|<br />||;
+	    $result='<table><tr><td valign="top">'.$question.
+		'</td><td valign="top">'.$result.'</td></tr></table>';
 	} else {
 	    my $tabsize=&Apache::londefdef::recalc($ENV{'form.textwidth'});
 	    my ($lefttabsize,$righttabsize)=(0,0);
@@ -508,8 +510,10 @@
 	}
     } elsif ($result=&itemdisplay('left')) {
 	if ($target ne 'tex') {
-	    $result='<table><tr><td>'.$result.'</td><td>'.$question.
-		'</td></tr></table>';
+	    #remove the first <br />
+	    $question=~s|<br />||;
+	    $result='<table><tr><td valign="top">'.$result.
+		'</td><td valign="top">'.$question.'</td></tr></table>';
 	} else {
 	    my $tabsize=&Apache::londefdef::recalc($ENV{'form.textwidth'});
 	    my ($lefttabsize,$righttabsize)=(0,0);