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

sakharuk lon-capa-cvs@mail.lon-capa.org
Fri, 08 Nov 2002 20:36:27 -0000


sakharuk		Fri Nov  8 15:36:27 2002 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  Added radiobuttons for web output for exams, correct name and id (the same as in inputtags.pm textaria sibroutine) is reproduced. Continue to work with printing in the case of answer date passed. 
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.70 loncom/homework/caparesponse/caparesponse.pm:1.71
--- loncom/homework/caparesponse/caparesponse.pm:1.70	Thu Nov  7 14:45:16 2002
+++ loncom/homework/caparesponse/caparesponse.pm	Fri Nov  8 15:36:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.70 2002/11/07 19:45:16 albertel Exp $
+# $Id: caparesponse.pm,v 1.71 2002/11/08 20:36:27 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -223,6 +223,7 @@
 	my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
 			'Q','R','S','T','U','V','W','X','Y','Z');
         if ($target eq 'web') {
+	    my $id=$Apache::inputtags::response[-1];
 	    $result.= '<table border="1"><tr>';
 	    for ($ind=0;$ind<$number_of_bubbles;$ind++) {
 		my $ans;
@@ -241,7 +242,7 @@
 		    }
 		    $ans = sprintf('%.'.$format,$bubbles_values[$ind]);
 		}
-		    $result.='<td>'.$alphabet[$ind].': '.$ans.'</td>';
+		    $result.='<td><input type="radio" name="HWVAL'.$id.'" value="'.$ans.'"><b>'.$alphabet[$ind].'</b>: '.$ans.'</td>';
 	    }
 	    $result.='</tr></table>';
 	} elsif ($target eq 'tex') {