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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 27 Mar 2007 19:20:51 -0000


albertel		Tue Mar 27 15:20:51 2007 EDT

  Modified files:              
    /loncom/homework	matchresponse.pm radiobuttonresponse.pm 
                    	optionresponse.pm rankresponse.pm 
  Log:
  - BUG#4244 enter works correctly now also with ption/radio/rank/match response
  
  
Index: loncom/homework/matchresponse.pm
diff -u loncom/homework/matchresponse.pm:1.60 loncom/homework/matchresponse.pm:1.61
--- loncom/homework/matchresponse.pm:1.60	Wed Feb 21 20:25:31 2007
+++ loncom/homework/matchresponse.pm	Tue Mar 27 15:20:49 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Full matching style response
 #
-# $Id: matchresponse.pm,v 1.60 2007/02/22 01:25:31 albertel Exp $
+# $Id: matchresponse.pm,v 1.61 2007/03/27 19:20:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -487,7 +487,8 @@
 		}
 	    }
 	    if ($target ne 'tex' && $Apache::lonhomework::type ne 'exam') {
-	        $optionlist='<select name="HWVAL_'.
+	        $optionlist='<select onchange="javascript:setSubmittedPart(\''.
+		  $part.'\');" name="HWVAL_'.
 		    $Apache::inputtags::response[-1].':'.$temp.'">'.
 		        $optionlist."</select>\n";
 	    }
Index: loncom/homework/radiobuttonresponse.pm
diff -u loncom/homework/radiobuttonresponse.pm:1.112 loncom/homework/radiobuttonresponse.pm:1.113
--- loncom/homework/radiobuttonresponse.pm:1.112	Wed Feb 28 21:31:20 2007
+++ loncom/homework/radiobuttonresponse.pm	Tue Mar 27 15:20:49 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # mutliple choice style responses
 #
-# $Id: radiobuttonresponse.pm,v 1.112 2007/03/01 02:31:20 albertel Exp $
+# $Id: radiobuttonresponse.pm,v 1.113 2007/03/27 19:20:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -310,7 +310,11 @@
 		    $i++;
 		} else {
 		    $result .= '<label>';
-		    $result.="<input type=\"radio\" name=\"HWVAL_$Apache::inputtags::response['-1']\" value=\"$temp\" ";
+		    $result.="<input
+                       onchange=\"javascript:setSubmittedPart('$part');\"
+                       type=\"radio\"
+                       name=\"HWVAL_$Apache::inputtags::response['-1']\"
+                       value=\"$temp\" ";
 		    if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }
 		    $result .= ' />'.$Apache::response::foilgroup{$name.'.text'}.
 			'</label>';
@@ -528,7 +532,11 @@
 	    }
 	    if ($target ne 'tex') { 
                 $result.= '<label>';
-		$result.="<input type=\"radio\" name=\"HWVAL_$Apache::inputtags::response['-1']\" value=\"$temp\" ";
+		$result.=
+		    "<input type=\"radio\"
+                            onchange=\"javascript:setSubmittedPart('$part');\"
+                            name=\"HWVAL_$Apache::inputtags::response['-1']\"
+                            value=\"$temp\" ";
 		if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }
 		$result .= ' />'.$Apache::response::foilgroup{$name.'.text'}."</label>";
 	    } else {
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.138 loncom/homework/optionresponse.pm:1.139
--- loncom/homework/optionresponse.pm:1.138	Wed Feb 28 21:33:28 2007
+++ loncom/homework/optionresponse.pm	Tue Mar 27 15:20:49 2007
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.138 2007/03/01 02:33:28 albertel Exp $
+# $Id: optionresponse.pm,v 1.139 2007/03/27 19:20:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -444,7 +444,8 @@
       }
       if ($target ne 'tex') {
 	  if ($Apache::lonhomework::type ne 'exam') {
-	      $optionlist='<select name="HWVAL_'.
+	      $optionlist='<select onchange="javascript:setSubmittedPart(\''.
+		  $part.'\');" name="HWVAL_'.
 		  $Apache::inputtags::response['-1'].':'.$temp.'">'.
 		  $optionlist."</select>\n";
 	  } else {
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.50 loncom/homework/rankresponse.pm:1.51
--- loncom/homework/rankresponse.pm:1.50	Wed Feb 21 20:25:31 2007
+++ loncom/homework/rankresponse.pm	Tue Mar 27 15:20:49 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # rank style response
 #
-# $Id: rankresponse.pm,v 1.50 2007/02/22 01:25:31 albertel Exp $
+# $Id: rankresponse.pm,v 1.51 2007/03/27 19:20:49 albertel Exp $
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -305,7 +305,8 @@
 		}
 	    }
 	    if ($target ne 'tex' && $Apache::lonhomework::type ne 'exam') {
-		$optionlist='<select name="HWVAL_'.
+		$optionlist='<select onchange="javascript:setSubmittedPart(\''.
+		  $part.'\');" name="HWVAL_'.
 		    $Apache::inputtags::response[-1].':'.$temp.'">'.
 		        $optionlist."</select>\n";
 	    } else {