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

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 25 Aug 2004 19:38:58 -0000


sakharuk		Wed Aug 25 15:38:58 2004 EDT

  Modified files:              
    /loncom/homework	optionresponse.pm rankresponse.pm 
  Log:
  Possible (suggested today by Ed) quick fixing for rankresponce problem in exam mode. I still work on more elegant (Gerd's) solution. 
  
  
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.117 loncom/homework/optionresponse.pm:1.118
--- loncom/homework/optionresponse.pm:1.117	Fri Jul 30 14:45:49 2004
+++ loncom/homework/optionresponse.pm	Wed Aug 25 15:38:58 2004
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.117 2004/07/30 18:45:49 albertel Exp $
+# $Id: optionresponse.pm,v 1.118 2004/08/25 19:38:58 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -491,7 +491,7 @@
 
 
 sub bubbles {
-    my ($ralphabit,$ropt) = @_;
+    my ($ralphabit,$ropt,$responce) = @_;
     my @alphabet = @$ralphabit;
     my @opt = @$ropt;
     my ($result,$head,$line) =('','','');
@@ -508,6 +508,7 @@
     for (my $ind=0;$ind<=$number_of_bubbles;$ind++) {
 	my $leftmargin;
 	$opt[$ind]=&Apache::lonxml::latex_special_symbols($opt[$ind]);
+	if ($responce eq 'rankresponce') {$opt[$ind]='Rank '.$opt[$ind];}
 	if ($ind==0) {$leftmargin=6;} else {$leftmargin=10;}
 	$current_length += (length($opt[$ind])+length($alphabet[$ind])+4)*2;
 	if ($current_length<($textwidth-$leftmargin) and $ind!=$number_of_bubbles) {
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.34 loncom/homework/rankresponse.pm:1.35
--- loncom/homework/rankresponse.pm:1.34	Thu May 27 00:32:19 2004
+++ loncom/homework/rankresponse.pm	Wed Aug 25 15:38:58 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # rank style response
 #
-# $Id: rankresponse.pm,v 1.34 2004/05/27 04:32:19 albertel Exp $
+# $Id: rankresponse.pm,v 1.35 2004/08/25 19:38:58 sakharuk Exp $
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -300,7 +300,7 @@
 	    } else {
 		if ($Apache::lonhomework::type eq 'exam') {
 		    $result.='\vskip 0 mm   '.$text.' \vskip 0 mm '."\n";
-		    $result.='\vskip -1 mm\noindent\begin{enumerate}\item[\textbf{'.$internal_counter.'}.]'.&Apache::optionresponse::bubbles(\@alp,\@whichopt).'\end{enumerate} \vskip -8 mm \strut ';
+		    $result.='\vskip -1 mm\noindent\begin{enumerate}\item[\textbf{'.$internal_counter.'}.]'.&Apache::optionresponse::bubbles(\@alp,\@whichopt,'rankresponce').'\end{enumerate} \vskip -8 mm \strut ';
 		    $internal_counter++;
 		} else {
 		    $result.=' \vskip 0mm \framebox[5 mm][s]{\tiny\strut} '.$text."\n";