core_question/question_engine

JavaScript required by the question engine.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Members

(static, constant) initForm

Source:

Initialise a form that contains questions printed using print_question. This has the effect of:

  1. Turning off browser autocomlete.
  2. Stopping enter from submitting the form (or toggling the next flag) unless keyboard focus is on the submit button or the flag.
  3. Removes any '.questionflagsavebutton's, since we have JavaScript to toggle the flags using ajax.
  4. Scroll to the position indicated by scrollpos= in the URL, if it is there.
  5. Prevent the user from repeatedly submitting the form.

(static, constant) initSubmitButton

Source:

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

Source:

Event handler to stop a question form being submitted more than once.