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

Question engine cannot cope with a question variable called "0"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.5, 2.3.2, 2.4
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      The unit tests are a reasonable test of this, but to be on the safe side:

      1. Preview a couple of questions, including a shortanswer question using deferred feedback behaviour, and another qtype using a different behaviour.

      Show
      The unit tests are a reasonable test of this, but to be on the safe side: 1. Preview a couple of questions, including a shortanswer question using deferred feedback behaviour, and another qtype using a different behaviour.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull Master Branch:

      Description

      It is, of course, a really bad idea to use a question variable called 0. However, it turns out that the OU has a lot of Opaque questions (https://github.com/moodleou/moodle-qtype_opaque) that do just that, and it is impossible to change it now.

      Amazingly, the system can actually cope with such silly names, except for one place where we do a sloppy test for whether the name is NULL, so I will fix that.

      Also, interestingly, <input name="0" ... /> is valid HTML, so supporting this is not totally crazy.

        Gliffy Diagrams

          Activity

          Hide
          poltawski Dan Poltawski added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          poltawski Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Integrated (22, 23 & master), thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Integrated (22, 23 & master), thanks!
          Hide
          poltawski Dan Poltawski added a comment -

          Not done that extensive test since i'm not really sure what i'm tested, but I tried adding a number of qtypes and changed their bhaviours and previewed. No problems encountered.

          Show
          poltawski Dan Poltawski added a comment - Not done that extensive test since i'm not really sure what i'm tested, but I tried adding a number of qtypes and changed their bhaviours and previewed. No problems encountered.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Closing as fixed, many thanks for your awesome collaboration.

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Closing as fixed, many thanks for your awesome collaboration.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Nov/12