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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 15 Oct 2003 19:54:45 -0000


albertel		Wed Oct 15 15:54:45 2003 EDT

  Modified files:              (Branch: version_1_0_2)
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - backport 1.116
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.107.2.1 loncom/homework/caparesponse/caparesponse.pm:1.107.2.2
--- loncom/homework/caparesponse/caparesponse.pm:1.107.2.1	Mon Sep 22 21:52:57 2003
+++ loncom/homework/caparesponse/caparesponse.pm	Wed Oct 15 15:54:45 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.107.2.1 2003/09/23 01:52:57 albertel Exp $
+# $Id: caparesponse.pm,v 1.107.2.2 2003/10/15 19:54:45 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -231,11 +231,16 @@
 		if ($$tagstack[-1] eq 'numericalresponse') {
 		    if ($unit=~/\S/) {$result.=' (in '.$unit.')<br /><br />';}
 		    $result.= '<table border="1"><tr>';
+		    my $previous=$Apache::lonhomework::history{"resource.$Apache::inputtags::part.$id.submission"};
 		    for (my $ind=0;$ind<$number_of_bubbles;$ind++) {
+			my $checked='';
+			if ($previous eq $bubble_values[$ind]) {
+			    $checked=" checked='on' ";
+			}
 			$result.='<td><input type="radio" name="HWVAL_'.$id.
-			    '" value="'.$bubble_values[$ind].'"><b>'.
-				$alphabet[$ind].'</b>: '.
-				    $bubble_values[$ind].'</td>';
+			    '" value="'.$bubble_values[$ind].'" '.$checked
+			    .' /><b>'.$alphabet[$ind].'</b>: '.
+			    $bubble_values[$ind].'</td>';
 		    }
 		    $result.='</tr></table>';
 		} elsif ($$tagstack[-1] eq 'formularesponse') {