]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8682 - the last commit caused a regression that stopped it working.
authortjhunt <tjhunt>
Mon, 31 Mar 2008 15:07:14 +0000 (15:07 +0000)
committertjhunt <tjhunt>
Mon, 31 Mar 2008 15:07:14 +0000 (15:07 +0000)
!something==somethingelse

is not the same as

something!==somethingelse

in javascript, it seems.

mod/quiz/quiz.js

index 37ce19afa4a15499c52df81f45244666c27b39de..c8c088c4b894ed99503977aa7f54978d9b8f3f45 100644 (file)
@@ -21,11 +21,12 @@ are actually on the submit button. Don't stop the user typing things in text are
 function check_enter(e) {
     var target = e.target ? e.target : e.srcElement;
     var keyCode = e.keyCode ? e.keyCode : e.which;
-
-    if(keyCode==13 && !target.nodeName=='a' && (!target.type || (target.type!='submit' && target.type!='textarea')))
+    if (keyCode==13 && target.nodeName!='a' &&
+            (!target.type || !(target.type=='submit' || target.type=='textarea'))) {
         return false;
-    else
+    } else {
         return true;
+    }
 }
 
 quiz_timer = {