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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 02 Dec 2002 17:06:09 -0000


albertel		Mon Dec  2 12:06:09 2002 EDT

  Modified files:              
    /loncom/homework	radiobuttonresponse.pm optionresponse.pm 
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - correct answers are no longer shown for target tex
  
  
Index: loncom/homework/radiobuttonresponse.pm
diff -u loncom/homework/radiobuttonresponse.pm:1.61 loncom/homework/radiobuttonresponse.pm:1.62
--- loncom/homework/radiobuttonresponse.pm:1.61	Thu Nov 14 15:30:34 2002
+++ loncom/homework/radiobuttonresponse.pm	Mon Dec  2 12:06:08 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # mutliple choice style responses
 #
-# $Id: radiobuttonresponse.pm,v 1.61 2002/11/14 20:30:34 sakharuk Exp $
+# $Id: radiobuttonresponse.pm,v 1.62 2002/12/02 17:06:08 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -345,7 +345,11 @@
   my $result;
 
   my ($answer,@whichfoils)=&whichfoils($max,$randomize);
-  if ($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/ || ($Apache::inputtags::status[-1] eq  'SHOW_ANSWER')) {
+  my $part=$Apache::inputtags::part;
+  my $solved=$Apache::lonhomework::history{"resource.$part.solved"};
+  my $status=$Apache::inputtags::status[-1];
+  if ( ($target ne 'tex') &&
+       (($solved =~ /^correct/) || ($status eq  'SHOW_ANSWER')) ) {
     foreach my $name (@whichfoils) {
       if ($target ne 'tex') {
 	  $result.="<br />";
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.64 loncom/homework/optionresponse.pm:1.65
--- loncom/homework/optionresponse.pm:1.64	Thu Nov 14 12:26:58 2002
+++ loncom/homework/optionresponse.pm	Mon Dec  2 12:06:08 2002
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.64 2002/11/14 17:26:58 albertel Exp $
+# $Id: optionresponse.pm,v 1.65 2002/12/02 17:06:08 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -319,8 +319,11 @@
   my $part=$Apache::inputtags::part;
   my $id=$Apache::inputtags::response[-1];
   my $break;
-  if (($Apache::lonhomework::history{"resource.$part.solved"} =~ /^correct/)  || ($Apache::inputtags::status[-1] eq  'SHOW_ANSWER')) {    
-    my $temp=1; ####
+  my $solved=$Apache::lonhomework::history{"resource.$part.solved"};
+  my $status=$Apache::inputtags::status[-1];
+  if (
+      ($target ne 'tex') &&
+      (($solved =~ /^correct/) || ($status eq 'SHOW_ANSWER')) ) {
     foreach $name (@whichopt) {
 	my $text=$Apache::response::foilgroup{$name.'.text'};
 	if ($text!~/^\s*$/) {
@@ -353,7 +356,6 @@
 	  $result.=&bubbles(\@alphabet,\@opt);
         }
       }
-    $temp++;
     }
   } else {
     my $temp=1;
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.74 loncom/homework/caparesponse/caparesponse.pm:1.75
--- loncom/homework/caparesponse/caparesponse.pm:1.74	Wed Nov 27 11:50:09 2002
+++ loncom/homework/caparesponse/caparesponse.pm	Mon Dec  2 12:06:09 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.74 2002/11/27 16:50:09 albertel Exp $
+# $Id: caparesponse.pm,v 1.75 2002/12/02 17:06:09 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -175,7 +175,7 @@
 	if ($target eq 'web') {
 	  $result="<br />The correct answer is ";
         } elsif ($target eq 'tex') {
-	  $result='\vskip 0 mm The correct answer is \\texttt{';
+	  #$result='\vskip 0 mm The correct answer is \\texttt{';
         }
 	for (my $i=0; $i <= $#answers; $i++) {
 	   my $answer=$answers[$i];
@@ -193,15 +193,18 @@
 	     &Apache::lonxml::debug("no format answer :$answer:");
 	     $formatted="$answer,";
 	   }
-	   if ($target eq 'tex') {$formatted=&Apache::lonxml::latex_special_symbols($formatted);}
-	     $result.=$formatted;
-           }
+	   if ($target eq 'tex') {
+	       $formatted='';
+	       #$formatted=&Apache::lonxml::latex_special_symbols($formatted);
+	   }
+	   $result.=$formatted;
+       }
 	   chop $result;
 	   if ($target eq 'web') {
 	     $result.=" $unit.<br />";
 	   } elsif ($target eq 'tex') {
-	     $result.=&Apache::lonxml::latex_special_symbols($unit);
-	     $result.="}. \\vskip 0 mm ";
+	     #$result.=&Apache::lonxml::latex_special_symbols($unit);
+	     #$result.="}. \\vskip 0 mm ";
 	   }
        }
       if ($Apache::lonhomework::type eq 'exam') {