core_question/question_engine

Description:
  • JavaScript required by the question engine.

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

JavaScript required by the question engine.

Members

(static, constant) initForm

Description:
  • 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.
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

Description:
  • 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.

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

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

Source:

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