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

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 19 Mar 2003 18:36:37 -0000


sakharuk		Wed Mar 19 13:36:37 2003 EDT

  Modified files:              
    /loncom/homework	matchresponse.pm 
  Log:
   Improved version of module (looks better on the paper).
  
  
Index: loncom/homework/matchresponse.pm
diff -u loncom/homework/matchresponse.pm:1.6 loncom/homework/matchresponse.pm:1.7
--- loncom/homework/matchresponse.pm:1.6	Tue Mar 18 16:26:33 2003
+++ loncom/homework/matchresponse.pm	Wed Mar 19 13:36:37 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Full matching style response
 #
-# $Id: matchresponse.pm,v 1.6 2003/03/18 21:26:33 sakharuk Exp $
+# $Id: matchresponse.pm,v 1.7 2003/03/19 18:36:37 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -388,8 +388,15 @@
 	    my $lastopt=$lastresponse{$name};
 	    my $last_letter=$name_letter_map{$lastopt};
 	    my $optionlist = '';
-	    if ($target ne 'tex') {$optionlist="<option></option>\n";} 
-	       else {$optionlist='\framebox[5 mm][s]{\tiny\strut}';}
+	    if ($target ne 'tex') {
+		$optionlist="<option></option>\n";
+	    } else {
+		if ($Apache::lonhomework::type ne 'exam') {
+		    $optionlist='\framebox[5 mm][s]{\tiny\strut}';
+		} else {
+		    $optionlist='\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]';
+		}
+	    }
 	    my $option;
 	    foreach $option (sort(keys(%letter_name_map))) {
 		if ($option eq $last_letter) {
@@ -414,7 +421,7 @@
 	    } else {		
 		if ($Apache::lonhomework::type eq 'exam') {
 		    $question.=' '.$optionlist.$text."\n";
-		    $question.='\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]'.&Apache::optionresponse::bubbles(\@Items,\@Items).'\end{enumerate}\strut ';
+		    $question.=&Apache::optionresponse::bubbles(\@Items,\@Items).'\end{enumerate} \vskip -7 mm \strut ';
 		    &Apache::lonxml::increment_counter();
 	        } else {
 		    $question.=' \\\\ '.$optionlist.$text."\n";