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

Bad string interpolation in the question edit forms

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7.1
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      2.7 and master

      1. Install qtype_varnumericset.
      2. Create a question of that type, adding at least 6 answers to match
      3. Save the question, then try to edit it again.

      Or, just trust me that I have done those steps, and this is a correct fix.

      In master only

      Here it is a question how much you test now, and how much you assume will be caught by the Moodle 2.8 QA cycle if it is broken.

      A complete test would look like this. I suggest you pick an intelligent sample of this.

      • Preview a quiz.
      • Create then edit a category in the question bank.
      • Create, then edit, then preview, questions of these types (most changed first)
        • calculated
        • calculatedmulti
        • calculatedsimle
        • multianswer
        • numerical
        • essay
        • match
        • shortanswer
        • random short-answer match
      • Import/export questions in these format (again, most necessary to test first.)
        • Moodle XML
        • GIFT
        • webct
        • Blackboard
        • XHTML

      For most of those formats, there is a sample file inside the code, e.g. in question/format/blackboard_six/tests/fixtures

      Show
      2.7 and master Install qtype_varnumericset. Create a question of that type, adding at least 6 answers to match Save the question, then try to edit it again. Or, just trust me that I have done those steps, and this is a correct fix. In master only Here it is a question how much you test now, and how much you assume will be caught by the Moodle 2.8 QA cycle if it is broken. A complete test would look like this. I suggest you pick an intelligent sample of this. Preview a quiz. Create then edit a category in the question bank. Create, then edit, then preview, questions of these types (most changed first) calculated calculatedmulti calculatedsimle multianswer numerical essay match shortanswer random short-answer match Import/export questions in these format (again, most necessary to test first.) Moodle XML GIFT webct Blackboard XHTML For most of those formats, there is a sample file inside the code, e.g. in question/format/blackboard_six/tests/fixtures
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      This is a very subtle issue that was only exposed by qtype_varnumericset (add-on) in Moodle 2.7.

      The code was

      unset($this->_form->_defaultValues["$field[$key]"]);
      

      And it turns out that what this does is try to get the $key'th value from string $field, rather than what was expected:

      unset($this->_form->_defaultValues["{$field}[{$key}]"]);
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Jul/14