From 20b8b489ec86f53b0cfdd9ca0e091baa83dfa106 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Mon, 31 Mar 2008 15:07:14 +0000 Subject: [PATCH] MDL-8682 - the last commit caused a regression that stopped it working. !something==somethingelse is not the same as something!==somethingelse in javascript, it seems. --- mod/quiz/quiz.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/quiz/quiz.js b/mod/quiz/quiz.js index 37ce19afa4..c8c088c4b8 100644 --- a/mod/quiz/quiz.js +++ b/mod/quiz/quiz.js @@ -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 = { -- 2.39.5