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

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 04 Dec 2004 00:41:27 -0000


albertel		Fri Dec  3 19:41:27 2004 EDT

  Modified files:              
    /loncom/homework	matchresponse.pm rankresponse.pm optionresponse.pm 
  Log:
  - BUG#3637, printing was different if in using conceptgroups versus not using concept groups
  
  
Index: loncom/homework/matchresponse.pm
diff -u loncom/homework/matchresponse.pm:1.47 loncom/homework/matchresponse.pm:1.48
--- loncom/homework/matchresponse.pm:1.47	Thu Oct 21 02:35:57 2004
+++ loncom/homework/matchresponse.pm	Fri Dec  3 19:41:26 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Full matching style response
 #
-# $Id: matchresponse.pm,v 1.47 2004/10/21 06:35:57 albertel Exp $
+# $Id: matchresponse.pm,v 1.48 2004/12/04 00:41:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -636,8 +636,12 @@
     if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
 	$text=&Apache::lonxml::endredirection;
     }
+
     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
 	$target eq 'tex' || $target eq 'analyze') {
+	if ($target eq 'tex' && $Apache::lonhomework::type eq 'exam') {
+	    $text='\vskip 5mm $\triangleright$ '.$text;
+	}
 	my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);
 	if ($value ne 'unused') {
 	    my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
@@ -654,28 +658,12 @@
 		 && !&Apache::response::showallfoils() ) {
 		push @{ $Apache::response::conceptgroup{'names'} }, $name;
 		$Apache::response::conceptgroup{"$name.value"} = $value;
-		if ($target eq 'tex' && $Apache::lonhomework::type eq 'exam') {
-		    $Apache::response::conceptgroup{"$name.text"} = ' $\triangleright$ '.$text;
-		} else {
-		    $Apache::response::conceptgroup{"$name.text"} = $text;
-		}
+		$Apache::response::conceptgroup{"$name.text"} = $text;
 		$Apache::response::conceptgroup{"$name.location"} = $location;
 	    } else {
 		push @{ $Apache::response::foilgroup{'names'} }, $name;
 		$Apache::response::foilgroup{"$name.value"} = $value;
-		if ($Apache::lonhomework::type eq 'exam') {
-		    if ($target eq 'tex') {
-			$Apache::response::foilgroup{"$name.text"} = '\vskip 5 mm $\triangleright$ '.$text;
-		    } else {
-			$Apache::response::foilgroup{"$name.text"} = $text;
-		    }
-		} else {
-		    if ($target eq 'tex') {
-			$Apache::response::foilgroup{"$name.text"} = $text;
-		    } else {
-			$Apache::response::foilgroup{"$name.text"} = $text;
-		    }
-		}
+		$Apache::response::foilgroup{"$name.text"} = $text;
 		$Apache::response::foilgroup{"$name.location"} = $location;
 	    }
 	}
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.41 loncom/homework/rankresponse.pm:1.42
--- loncom/homework/rankresponse.pm:1.41	Mon Nov  8 17:56:05 2004
+++ loncom/homework/rankresponse.pm	Fri Dec  3 19:41:26 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # rank style response
 #
-# $Id: rankresponse.pm,v 1.41 2004/11/08 22:56:05 albertel Exp $
+# $Id: rankresponse.pm,v 1.42 2004/12/04 00:41:26 albertel Exp $
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -419,6 +419,9 @@
     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
 	$target eq 'tex' || $target eq 'analyze') {
 	my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);
+	if ($target eq 'tex' && $Apache::lonhomework::type eq 'exam') {
+	    $text='\vskip 5mm $\triangleright$ '.$text;
+	}
 	if ($value ne 'unused') {
 	    my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
 	    &Apache::lonxml::debug("Got a name of :$name:");
@@ -434,24 +437,12 @@
 		 && !&Apache::response::showallfoils() ) {
 		push @{ $Apache::response::conceptgroup{'names'} }, $name;
 		$Apache::response::conceptgroup{"$name.value"} = $value;
-		if ($target eq 'tex' and $Apache::lonhomework::type eq 'exam') {
-		    $Apache::response::conceptgroup{"$name.text"} = ' $\triangleright$ '.$text;
-		} else {
-		    $Apache::response::conceptgroup{"$name.text"} = $text;
-		}
+		$Apache::response::conceptgroup{"$name.text"} = $text;
 		$Apache::response::conceptgroup{"$name.location"} = $location;
 	    } else {
 		push @{ $Apache::response::foilgroup{'names'} }, $name;
 		$Apache::response::foilgroup{"$name.value"} = $value;
-		if ($target eq 'tex' and $Apache::lonhomework::type eq 'exam') {
-		    $Apache::response::foilgroup{"$name.text"} = '\vskip 5 mm $\triangleright$ '.$text;
-		} else {
-		    if ($target eq 'tex' and $Apache::lonhomework::type eq 'exam') {
-			$Apache::response::foilgroup{"$name.text"} = ' $\triangleright$ '.$text;
-		    } else {
-			$Apache::response::foilgroup{"$name.text"} = $text;
-		    } 
-		}
+		$Apache::response::foilgroup{"$name.text"} = $text;
 		$Apache::response::foilgroup{"$name.location"} = $location;
 	    }
 	}
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.121 loncom/homework/optionresponse.pm:1.122
--- loncom/homework/optionresponse.pm:1.121	Thu Oct 21 02:33:37 2004
+++ loncom/homework/optionresponse.pm	Fri Dec  3 19:41:26 2004
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.121 2004/10/21 06:33:37 albertel Exp $
+# $Id: optionresponse.pm,v 1.122 2004/12/04 00:41:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -623,6 +623,9 @@
   if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' 
       || $target eq 'tex' || $target eq 'analyze') {
     my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);
+    if ($target eq 'tex' && $Apache::lonhomework::type eq 'exam') {
+	$text='\vskip 5mm $\triangleright$ '.$text;
+    }
     if ($value ne 'unused') {
       my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
       &Apache::lonxml::debug("Got a name of :$name:");
@@ -637,20 +640,12 @@
 	   && !&Apache::response::showallfoils() ) {
 	push @{ $Apache::response::conceptgroup{'names'} }, $name;
 	$Apache::response::conceptgroup{"$name.value"} = $value;
-	if ($target eq 'tex' and $Apache::lonhomework::type eq 'exam') {
-	    $Apache::response::conceptgroup{"$name.text"} = '\vskip 4 mm $\triangleright$ '.$text;
-	} else {
-	    $Apache::response::conceptgroup{"$name.text"} = $text;
-	}
+	$Apache::response::conceptgroup{"$name.text"} = $text;
 	$Apache::response::conceptgroup{"$name.location"} = $location;
       } else {
 	push @{ $Apache::response::foilgroup{'names'} }, $name;
 	$Apache::response::foilgroup{"$name.value"} = $value;
-	if ($target eq 'tex' and $Apache::lonhomework::type eq 'exam') {
-	    $Apache::response::foilgroup{"$name.text"} = '\vskip 5 mm $\triangleright$ '.$text;
-	} else {
-	    $Apache::response::foilgroup{"$name.text"} = $text;
-	}
+	$Apache::response::foilgroup{"$name.text"} = $text;
 	$Apache::response::foilgroup{"$name.location"} = $location;
       }
     }