JavaScript required by the question engine.
- Source:
- Copyright:
- 2021 The Open University
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Members
(static, constant) initForm
Initialise a form that contains questions printed using print_question. This has the effect of:
- Turning off browser autocomlete.
- Stopping enter from submitting the form (or toggling the next flag) unless keyboard focus is on the submit button or the flag.
- Removes any '.questionflagsavebutton's, since we have JavaScript to toggle the flags using ajax.
- Scroll to the position indicated by scrollpos= in the URL, if it is there.
- Prevent the user from repeatedly submitting the form.
(static, constant) initSubmitButton
Initialise a question submit button. This saves the scroll position and sets the fragment on the form submit URL so the page reloads in the right place.
(static, constant) preventRepeatSubmission
Event handler to stop a question form being submitted more than once.