Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.7, 1.7.1, 1.8, 1.9
-
Labels:None
-
Affected Branches:MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
-
Fixed Branches:MOODLE_18_STABLE, MOODLE_19_STABLE
Description
On a quiz page, if there are more than one questions where the input is a text field (as in SHORTANSWER questions), pressing the Enter key will submit the whole form, which is not a good idea. Look at this scenario.
Quiz settings: Adaptive mode Yes. / Students may review everything at any time, except for the correct answers (only available after quiz is closed).
Quiz with 2 shortanswer questions on page, Q1 and Q2
Student enters nothing in Q1 but enters a response in Q2, and then presses the Enter key
Moodle reaction -> Only Q1 is analysed, it is found empty and is graded accordingly, this message is displayed:
Incorrect
Marks for this submission: 0/1. This submission attracted a penalty of 0.1.
Nothing is displayed concerning Q2 where the student entered his response... which is puzzling to him.
It looks to me that in fact pressing the Enter key is equivalent to clicking the Submit page button.
Of course the students should be told NOT to use the Enter key to submit their responses but to click the individual Submit buttons but... it would be better is this was taken care of by the program itself!
I do hope some solution will be found for this problem, if not for 1.7 at least for 1.8 or 1.9 versions,
Joseph
As suggested, the solution is some JavaScript to stop the enter key having an effect.
On a suitable element (the form?) add onkeypress="return check_enter(event);"
and in some JavaScript function, define the check_enter function:
function checkEnter(e) {
var target = e.target ? e.target : e.srcElement;
var keyCode = e.keyCode ? e.keyCode : e.which;
// Stifle Enter on anything except submit buttons and textareas
if(keyCode==13 && (Unable to render embedded object: File (target.type ) not found.='submit' && target.type!='textarea')))
return false;
else
return true;
}
(That solution is courtesy of OpenMark.) I need to check that this works with the HTML editor in essay questions.
Unfortunately, there is nothing you can do about this when JavaScript is turned off.