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

foxr foxr@source.lon-capa.org
Mon, 02 Aug 2010 10:52:59 -0000


foxr		Mon Aug  2 10:52:59 2010 EDT

  Modified files:              
    /loncom/homework	optionresponse.pm rankresponse.pm 
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  BZ3268 - make various problem types look better when multiple answers appear in
  a single part connected by text (<startouttext /> stuff <endouttext />
  
  
  
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.164 loncom/homework/optionresponse.pm:1.165
--- loncom/homework/optionresponse.pm:1.164	Tue Apr 27 14:11:17 2010
+++ loncom/homework/optionresponse.pm	Mon Aug  2 10:52:54 2010
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.164 2010/04/27 14:11:17 onken Exp $
+# $Id: optionresponse.pm,v 1.165 2010/08/02 10:52:54 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -583,9 +583,9 @@
 	      }
 	  }
 	  if ($Apache::lonhomework::type eq 'exam') {
-	      $result.='\vskip -1 mm\noindent\begin{enumerate}\item[\textbf{'.
-		  $internal_counter.'}.]'.&bubbles(\@alphabet,\@opt).
-		  '\end{enumerate} \vskip -8 mm \strut ';
+	      $result.='\vskip -1 mm\noindent';
+              $result.= '\textbf{'. $internal_counter.'}. \vskip -3mm'.&bubbles(\@alphabet,\@opt).
+		                 ' \strut ';
 	      $internal_counter++;
 	  }
           if ($target eq 'tex' && $env{'form.pdfFormFields'} eq 'yes'
@@ -692,7 +692,7 @@
 
 	$current_length += (length($opt[$ind])+length($alphabet[$ind])+4)*2;
 	if ($current_length<($textwidth-$leftmargin) and $ind!=$number_of_bubbles) {
-	    $line.='\hskip -1 mm {\small \textbf{'.$alphabet[$ind].'}}$\bigcirc$\hskip -1 mm & \hskip -3 mm {\small '.$opt[$ind].'} & ';
+	    $line.='\hskip 1pc {\small \textbf{'.$alphabet[$ind].'}}$\bigcirc$\hskip -1 mm & \hskip -3 mm {\small '.$opt[$ind].'} & ';
 	    $head.='lr';
 	} else {
 	    $line=~s/\&\s*$//;
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.62 loncom/homework/rankresponse.pm:1.63
--- loncom/homework/rankresponse.pm:1.62	Sun Feb 28 23:43:21 2010
+++ loncom/homework/rankresponse.pm	Mon Aug  2 10:52:54 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # rank style response
 #
-# $Id: rankresponse.pm,v 1.62 2010/02/28 23:43:21 raeburn Exp $
+# $Id: rankresponse.pm,v 1.63 2010/08/02 10:52:54 foxr Exp $
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -385,8 +385,11 @@
 		}
 	    } 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,'rankresponse').'\end{enumerate} \vskip -8 mm \strut ';
+		    $result .= '\vskip 0 mm '.$text.' \vskip 0 mm '."\n";
+		    $result .= '\vskip -1 mm';
+		    $result .= '\begin{enumerate}\item[\textbf{'.$internal_counter.'}.]';
+		    $result .= &Apache::optionresponse::bubbles(\@alp,\@whichopt,'rankresponse');
+		    $result .= '\end{enumerate} \vskip -8 mm \strut ';
 		    $internal_counter++;
 		} else {
                     if($env{'form.pdfFormFields'} ne 'yes') {
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.238 loncom/homework/caparesponse/caparesponse.pm:1.239
--- loncom/homework/caparesponse/caparesponse.pm:1.238	Sat Jun  5 22:25:22 2010
+++ loncom/homework/caparesponse/caparesponse.pm	Mon Aug  2 10:52:58 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.238 2010/06/05 22:25:22 www Exp $
+# $Id: caparesponse.pm,v 1.239 2010/08/02 10:52:58 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -592,9 +592,16 @@
 			&get_table_sizes($number_of_bubbles,$bubble_display);
 		    my $j=0;
 		    my $cou=0;
-		    $result.='\vskip -1 mm \noindent \begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]';
+		    $result.='\vskip 2mm \noindent ';
+		    $result .= '\textbf{'.$Apache::lonxml::counter.'.} \vskip -3mm ';
+
 		    for (my $i=0;$i<$number_of_tables;$i++) {
-			$result.='\vskip -1 mm \noindent \setlength{\tabcolsep}{2 mm}\begin{tabular}{';
+			if ($i == 0) {
+			    $result .= '\vskip -1mm ';
+			} else {
+			    $result .= '\vskip 1mm ';
+			}
+			$result.='\noindent \setlength{\tabcolsep}{2 mm}\hskip 2pc\begin{tabular}{';
 			for (my $ind=0;$ind<$table_range[$j];$ind++) {
 			    $result.='p{3 mm}p{'.$celllength.' mm}';
 			}
@@ -607,7 +614,6 @@
 			$j++;
 			$result.='\\\\\end{tabular}\vskip 0 mm ';
 		    }
-		    $result.='\end{enumerate}';
 		} else {
 		    $increment = &Apache::response::repetition();
 		}