Moodle
  1. Moodle
  2. MDL-24394

Match question type: should be able to use the multilang filter on the answers

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.9, 2.0, 2.1.4, 2.2.1
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      0. Make sure you have the multi-lang filter enabled on your site, and applying to Content and headings.

      1. Create a match question and enter the following subquestions and answers:

      • Portugese: PT
      • Chinese: <b class="shouldbestripped">ZH</b>
      • Current lanauage: <span lang="en" class="multilang">EN</span><span lang="cz" class="multilang">CS</span><span lang="fr" class="multilang">FR</span>

      (Feel free to alter that last one so it works in your favourite langauge.)

      2. Save the question and re-edit it. Verify that the <b> tags have been stripped out, but that the third answer has not been damaged.

      3. Preview the question, and verify that it works. That is, you should see three choices like PT, ZH and EN, randomly shuffled, in the drop-down menus.

      Show
      0. Make sure you have the multi-lang filter enabled on your site, and applying to Content and headings. 1. Create a match question and enter the following subquestions and answers: Portugese: PT Chinese: <b class="shouldbestripped">ZH</b> Current lanauage: <span lang="en" class="multilang">EN</span><span lang="cz" class="multilang">CS</span><span lang="fr" class="multilang">FR</span> (Feel free to alter that last one so it works in your favourite langauge.) 2. Save the question and re-edit it. Verify that the <b> tags have been stripped out, but that the third answer has not been damaged. 3. Preview the question, and verify that it works. That is, you should see three choices like PT, ZH and EN, randomly shuffled, in the drop-down menus.
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      1208

      Description

      Things have changed since this problem was originally reported, but the situation now is:

      1. You should be able to enter match answers that work with the multilang filter, but no other HTML. That is, the answers are PARAM_TEXT. This is currently working.

      2. Questions with multilang syntax in the answers should work. That was broken.

      Original description:

      The in_array() check in line 246 (1.9) / 264 (2.0) of questiontype.php doesn't align with what's added to the array in the next line. I think it's probably fairly rare that people have tags in this field, but it leads to unexpected behavior with some answers added twice or not being treated as equal. I can get the same answer three times in the drop-down menu along with the expected unpredictable grading if I add the following answers (tested with the most recent 2.0):

      <b>a</b>

      <i>a</i>

      a

        Issue Links

          Activity

          Adriane Boyd created issue -
          Petr Škoda made changes -
          Field Original Value New Value
          Affects Version/s 2.0 [ 10122 ]
          Affects Version/s 2.0.2 [ 10421 ]
          Tim Hunt made changes -
          Fix Version/s 1.9.10 [ 10407 ]
          Adriane Boyd made changes -
          Attachment match-duplicate-answers.patch [ 21576 ]
          Martin Dougiamas made changes -
          Fix Version/s 1.9.11 [ 10410 ]
          Fix Version/s 1.9.10 [ 10407 ]
          Martin Dougiamas made changes -
          Workflow jira [ 39076 ] MDL Workflow [ 46802 ]
          Martin Dougiamas made changes -
          Fix Version/s 1.9.12 [ 10536 ]
          Fix Version/s 1.9.11 [ 10410 ]
          Martin Dougiamas made changes -
          Workflow MDL Workflow [ 46802 ] MDL Full Workflow [ 75033 ]
          Martin Dougiamas made changes -
          Fix Version/s STABLE backlog [ 10463 ]
          Fix Version/s 1.9.12 [ 10536 ]
          Tim Hunt made changes -
          Labels triaged
          Tim Hunt made changes -
          Status Open [ 1 ] Peer review in progress [ 10013 ]
          Tim Hunt made changes -
          Summary Match question type: generated list of answers without duplicates mishandles answers with tags Match question type: should be able to use the multilang filter on the answers
          Fix Version/s 2.1.5 [ 11553 ]
          Fix Version/s 2.2.2 [ 11552 ]
          Fix Version/s STABLE backlog [ 10463 ]
          Testing Instructions 0. Make sure you have the multi-lang filter enabled on your site, and applying to Content and headings.

          1. Create a match question and enter the following subquestions and answers:

          * Portugese: PT
          * Chinese: <b class="shouldbestripped">ZH</b>
          * Current lanauage: <span lang="en" class="multilang">EN</span><span lang="cz" class="multilang">CS</span><span lang="fr" class="multilang">FR</span>

          (Feel free to alter that last one so it works in your favourite langauge.)

          2. Save the question and re-edit it. Verify that the <b> tags have been stripped out, but that the third answer has not been damaged.

          3. Preview the question, and verify that it works. That is, you should see three choices like PT, ZH and EN, randomly shuffled, in the drop-down menus.
          Description The in_array() check in line 246 (1.9) / 264 (2.0) of questiontype.php doesn't align with what's added to the array in the next line. I think it's probably fairly rare that people have tags in this field, but it leads to unexpected behavior with some answers added twice or not being treated as equal. I can get the same answer three times in the drop-down menu along with the expected unpredictable grading if I add the following answers (tested with the most recent 2.0):

          <b>a</b>

          <i>a</i>

          a

          Things have changed since this problem was originally reported, but the situation now is:

          1. You should be able to enter match answers that work with the multilang filter, but no other HTML. That is, the answers are PARAM_TEXT. This is currently working.

          2. Questions with multilang syntax in the answers should work. That was broken.

          Original description:

          The in_array() check in line 246 (1.9) / 264 (2.0) of questiontype.php doesn't align with what's added to the array in the next line. I think it's probably fairly rare that people have tags in this field, but it leads to unexpected behavior with some answers added twice or not being treated as equal. I can get the same answer three times in the drop-down menu along with the expected unpredictable grading if I add the following answers (tested with the most recent 2.0):

          <b>a</b>

          <i>a</i>

          a

          Affects Version/s 2.2.1 [ 11456 ]
          Affects Version/s 2.1.4 [ 11452 ]
          Tim Hunt made changes -
          Status Peer review in progress [ 10013 ] Development in progress [ 3 ]
          Tim Hunt made changes -
          Status Development in progress [ 3 ] Waiting for integration review [ 10010 ]
          Pull Master Diff URL https://github.com/timhunt/moodle/compare/master...MDL-24394
          Pull Master Branch MDL-24394
          Pull from Repository git://github.com/timhunt/moodle.git
          Pull 2.1 Branch MDL-24394_21
          Pull 2.2 Diff URL https://github.com/timhunt/moodle/compare/MOODLE_22_STABLE...MDL-24394_22
          Pull 2.1 Diff URL https://github.com/timhunt/moodle/compare/MOODLE_21_STABLE...MDL-24394_21
          Pull 2.2 Branch MDL-24394_22
          Sam Hemelryk made changes -
          Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
          Integrator samhemelryk
          Currently in integration Yes [ 10041 ]
          Sam Hemelryk made changes -
          Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
          Eloy Lafuente (stronk7) made changes -
          Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
          Eloy Lafuente (stronk7) made changes -
          Status Testing in progress [ 10011 ] Problem during testing [ 10007 ]
          Tim Hunt made changes -
          Link This issue testing discovered MDL-31100 [ MDL-31100 ]
          Tim Hunt made changes -
          Link This issue testing discovered MDL-31101 [ MDL-31101 ]
          Eloy Lafuente (stronk7) made changes -
          Status Problem during testing [ 10007 ] Integration review in progress [ 10004 ]
          Eloy Lafuente (stronk7) made changes -
          Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
          Rajesh Taneja made changes -
          Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
          Tester rajeshtaneja
          Rajesh Taneja made changes -
          Status Testing in progress [ 10011 ] Tested [ 10006 ]
          Eloy Lafuente (stronk7) made changes -
          Status Tested [ 10006 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Currently in integration Yes [ 10041 ]
          Integration date 12/Jan/12

            People

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

              Dates

              • Created:
                Updated:
                Resolved: