Moodle
  1. Moodle
  2. MDL-28652

Calculated question type: wild card names not displayed in edit form

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.2
    • Fix Version/s: 2.1.2
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      Within a course, open the question bank. (Need to be logged in as a teacher or admin.)
      Click "Create a new question..." -> "Calculated", then "Next".
      Enter data:
      Question name: Test
      Question text: Test

      {x} {y}
      ** Correct answer formula: {x}

      Grade: 100%
      Click "Save changes".

      EXPECTED: In the first and second section, respectively, the labels read "Wild card

      {x}

      " and "Wild card

      {y}".
      ACTUAL: The labels read "Wild card { {$a} } x" and "Wild card { {$a} } y".

      * Now select "will use a new shared dataset" next to "Wild card { {$a} } y", then click "Next page".

      EXPECTED: In the section "Item to add", second half, first field, the label reads "Shared wild card {y}

      ".
      ACTUAL: The label reads "Shared wild card".

      Now in the "Add" section, next to "Add item", click the "Add" button.

      EXPECTED: In the section "Set 1", the second label reads "Shared wild card

      {y}

      ".
      ACTUAL: The label reads "Shared wild card".

      Repeat this test for the calculatedmulti type.

      Show
      Within a course, open the question bank. (Need to be logged in as a teacher or admin.) Click "Create a new question..." -> "Calculated", then "Next". Enter data: Question name: Test Question text: Test {x} {y} ** Correct answer formula: {x} Grade: 100% Click "Save changes". EXPECTED: In the first and second section, respectively, the labels read "Wild card {x} " and "Wild card {y}". ACTUAL: The labels read "Wild card { {$a} } x" and "Wild card { {$a} } y". * Now select "will use a new shared dataset" next to "Wild card { {$a} } y", then click "Next page". EXPECTED: In the section "Item to add", second half, first field, the label reads "Shared wild card {y} ". ACTUAL: The label reads "Shared wild card". Now in the "Add" section, next to "Add item", click the "Add" button. EXPECTED: In the section "Set 1", the second label reads "Shared wild card {y} ". ACTUAL: The label reads "Shared wild card". Repeat this test for the calculatedmulti type.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      In the wizard forms for the calculated question type, pages "data set definitions" and "data set items", several labels are incorrect. They should display the name of the wildcards involved, but fail to do so. See details below.

      This is solved by the attached patch.

        Gliffy Diagrams

          Activity

          Hide
          Tim Hunt added a comment -

          Within a course, open the question bank. (Need to be logged in as a teacher or admin.)
          Click "Create a new question..." -> "Calculated", then "Next".
          Enter data:
          Question name: Test
          Question text: Test

          {x} {y}
          ** Correct answer formula: {x}

          Grade: 100%
          Click "Save changes".

          EXPECTED: In the first and second section, respectively, the labels read "Wild card

          {x}

          " and "Wild card

          {y}".
          ACTUAL: The labels read "Wild card { {$a} } x" and "Wild card { {$a} } y".

          * Now select "will use a new shared dataset" next to "Wild card { {$a} } y", then click "Next page".

          EXPECTED: In the section "Item to add", second half, first field, the label reads "Shared wild card {y}

          ".
          ACTUAL: The label reads "Shared wild card".

          Now in the "Add" section, next to "Add item", click the "Add" button.

          EXPECTED: In the section "Set 1", the second label reads "Shared wild card

          {y}

          ".
          ACTUAL: The label reads "Shared wild card"

          Repeat this test (with minor changes) with the calculatedmulti question type.

          Show
          Tim Hunt added a comment - Within a course, open the question bank. (Need to be logged in as a teacher or admin.) Click "Create a new question..." -> "Calculated", then "Next". Enter data: Question name: Test Question text: Test {x} {y} ** Correct answer formula: {x} Grade: 100% Click "Save changes". EXPECTED: In the first and second section, respectively, the labels read "Wild card {x} " and "Wild card {y}". ACTUAL: The labels read "Wild card { {$a} } x" and "Wild card { {$a} } y". * Now select "will use a new shared dataset" next to "Wild card { {$a} } y", then click "Next page". EXPECTED: In the section "Item to add", second half, first field, the label reads "Shared wild card {y} ". ACTUAL: The label reads "Shared wild card". Now in the "Add" section, next to "Add item", click the "Add" button. EXPECTED: In the section "Set 1", the second label reads "Shared wild card {y} ". ACTUAL: The label reads "Shared wild card" Repeat this test (with minor changes) with the calculatedmulti question type.
          Hide
          Tim Hunt added a comment -

          Thanks for submitting this fix. It looks good to me.

          Show
          Tim Hunt added a comment - Thanks for submitting this fix. It looks good to me.
          Hide
          Pierre Pichet added a comment -

          I agree with Tim comments.

          Show
          Pierre Pichet added a comment - I agree with Tim comments.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          Rajesh Taneja added a comment -

          Works Great.
          Thanks for fixing this Henning and Tim

          Show
          Rajesh Taneja added a comment - Works Great. Thanks for fixing this Henning and Tim
          Hide
          Eloy Lafuente (stronk7) added a comment -

          This has been sent upstream and is now available in all git & cvs servers. Many thanks for the hard work!

          Show
          Eloy Lafuente (stronk7) added a comment - This has been sent upstream and is now available in all git & cvs servers. Many thanks for the hard work!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: