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

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 01 Jul 2003 20:13:14 -0000


sakharuk		Tue Jul  1 16:13:14 2003 EDT

  Modified files:              
    /loncom/homework	rankresponse.pm 
  Log:
  Bug 1667 is fixed. Internal counter (works only for bubblesheet LaTeX exams) is
  implemented. 
  
  
  
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.14 loncom/homework/rankresponse.pm:1.15
--- loncom/homework/rankresponse.pm:1.14	Fri Jun  6 00:26:44 2003
+++ loncom/homework/rankresponse.pm	Tue Jul  1 16:13:14 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # rank style response
 #
-# $Id: rankresponse.pm,v 1.14 2003/06/06 04:26:44 albertel Exp $
+# $Id: rankresponse.pm,v 1.15 2003/07/01 20:13:14 sakharuk Exp $
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -104,6 +104,7 @@
 	} elsif ( $target eq 'grade') {
 	    &grade_response($max,$randomize,$tol);
 	}
+	&Apache::lonxml::increment_counter(&getfoilcounts($max));
     } elsif ($target eq 'edit') {
 	$result=&Apache::edit::end_table();
     }
@@ -254,6 +255,7 @@
 	my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"};
 	my %lastresponse=&Apache::lonnet::str2hash($lastresponse); 
 	my @alp = splice @alphabet, 0, $#whichopt + 1;
+	my $internal_counter=$Apache::lonxml::counter;
 	foreach my $name (@whichfoils) {
 	    my $lastopt=$lastresponse{$name};
 	    my $optionlist='';
@@ -286,7 +288,8 @@
 	    } else {
 		if ($Apache::lonhomework::type eq 'exam') {
 		    $result.='\vskip 0 mm   '.$text.' \vskip -3 mm '."\n";
-		    $result.='\vskip -5 mm\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]\parbox{\textwidth - 5 mm}{'.&Apache::optionresponse::bubbles(\@alp,\@whichopt).'}\end{enumerate} \vskip -5 mm \strut ';
+		    $result.='\vskip -5 mm\begin{enumerate}\item[\textbf{'.$internal_counter.'}.]\parbox{\textwidth - 5 mm}{'.&Apache::optionresponse::bubbles(\@alp,\@whichopt).'}\end{enumerate} \vskip -5 mm \strut ';
+		    $internal_counter++;
 		} else {
 		    $result.=' \\\\ \framebox[5 mm][s]{\tiny\strut} '.$text."\n";
 		}