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

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 25 Mar 2003 22:15:04 -0000


sakharuk		Tue Mar 25 17:15:04 2003 EDT

  Modified files:              
    /loncom/homework	rankresponse.pm 
  Log:
   Corrections are done: 1. Number of possibilities exactly corresponds to the screen (web) one for LaTeX output.
  2. The enumaretion is corrected for the exam mode - numbers appear on the same lines as bubbles themselfs. 
  
  
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.7 loncom/homework/rankresponse.pm:1.8
--- loncom/homework/rankresponse.pm:1.7	Thu Mar 20 12:59:19 2003
+++ loncom/homework/rankresponse.pm	Tue Mar 25 17:15:04 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # rank style response
 #
-# $Id: rankresponse.pm,v 1.7 2003/03/20 17:59:19 sakharuk Exp $
+# $Id: rankresponse.pm,v 1.8 2003/03/25 22:15:04 sakharuk Exp $
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -279,8 +279,8 @@
 		}
 	    } else {
 		if ($Apache::lonhomework::type eq 'exam') {
-		    $result.='\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]\vskip 0 mm '.$text."\n";
-		    $result.=&Apache::optionresponse::bubbles(\@alp,\@whichopt).'\end{enumerate} \vskip -7 mm \strut ';
+		    $result.='\vskip 0 mm   '.$text."\n";
+		    $result.='\vskip -1 mm\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]\parbox{\textwidth - 5 mm}{'.&Apache::optionresponse::bubbles(\@alp,\@whichopt).'}\end{enumerate} \vskip -5 mm \strut ';
 		} else {
 		    $result.=' \\\\ \framebox[5 mm][s]{\tiny\strut} '.$text."\n";
 		}
@@ -375,7 +375,7 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     $Apache::rankresponse::conceptgroup=0;
     my $result='';
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ) {
+    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') {
 	#if not there aren't any foils to display and thus no question
 	if (defined(@{ $Apache::response::conceptgroup{'names'} })) {
 	    my @names = @{ $Apache::response::conceptgroup{'names'} };
@@ -392,7 +392,7 @@
 						     $safeeval);
 	    $Apache::response::foilgroup{"$name.concept"} = $concept;
 	    &Apache::lonxml::debug("Selecting $name in $concept");
-	    if ($target eq 'web') {
+	    if ($target eq 'web' || $target eq 'tex') {
 		my $part_id="$Apache::inputtags::part.$Apache::inputtags::response[-1]";
 		push(@{ $Apache::hint::rank{"$part_id.concepts"} },
 		     $concept);