Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-25013

Possible problem with JavaScript auto-loading

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Expected behaviour:

      1. Create a quiz with, say, a shortanswer question in it.
      2. Preview the quiz.
      3. Put the caret in the shortanswer text box. Press enter.
      4. Nothing happens. This is due to the code in question/qengine.js that prevents enter from submitting the form.

      Steps to reproduce:

      1. Now go to end of mod/quiz/locallib.php.
      2. Comment out the line $PAGE->requires->js_module('core_question_engine'); This should not be necessary because the quiz js_module says that it requires core_question_engine, and find_module knows about this module.
      3. Repeat the steps above (making sure that old JS is not being cached anywhere).
      4. Now, pressing enter submits the form, or at least toggles the flag.

      (See also http://moodle.org/mod/cvsadmin/view.php?conversationid=5976).

      Separately, and un-relatedly, the attached patch add a count of the number of YUI and other modules included on each page. It also provides a hidden display of far more detail. Please can you review it.

      The patch also includes, commented out, what I think the right solution to this bug is. However, that patch is based on logic, not the actual code. If you uncomment this, you get all sorts of errors.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                samhemelryk Sam Hemelryk
                Reporter:
                timhunt Tim Hunt
                Tester:
                Nobody
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  24/Nov/10