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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 18 Sep 2007 22:18:42 -0000


albertel		Tue Sep 18 18:18:42 2007 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  - BUG#5431
     - need to set the cubmitted part when the user clicks on the correct
       Submit Answer button (using onmouseup rather than onclick so that when
       the user presses enter the virtual click of the first submit button
       doesn't undo the preservation of which field they last typed in)
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.229 loncom/homework/inputtags.pm:1.230
--- loncom/homework/inputtags.pm:1.229	Tue Aug 14 15:32:42 2007
+++ loncom/homework/inputtags.pm	Tue Sep 18 18:18:41 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.229 2007/08/14 19:32:42 albertel Exp $
+# $Id: inputtags.pm,v 1.230 2007/09/18 22:18:41 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1131,7 +1131,12 @@
 	}
 	if ( $showbutton ) { 
 	    if ($target ne 'tex') {
-		$button = '<input onsubmit="javascript:setSubmittedPart(\''.$id.'\')" type="submit" name="submit_'.$id.'" value="'.&mt('Submit Answer').'" />';
+		$button = 
+		    '<input 
+                          onmouseup="javascript:setSubmittedPart(\''.$id.'\')"
+                           onsubmit="javascript:setSubmittedPart(\''.$id.'\')"
+                        type="submit" name="submit_'.$id.'"
+                         value="'.&mt('Submit Answer').'" />';
 	    }
 	}