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

Questions try to put a unique id in the HTML when rendered, but it is not unique

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.1.17, 3.4.8, 3.5.5, 3.6.3, 3.7
    • Fix Version/s: 3.5.6, 3.6.4
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      The Behat coverage of the affected quesiton types is good enough to ensure that this does not cause regressions.

      Show
      The Behat coverage of the affected quesiton types is good enough to ensure that this does not cause regressions.
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-65029-master

      Description

      As part of the standard question renderer, the outer div that contains the whole question (the one that has class="que ..." get a supposedly unique id="" added.

      Unfortunately, the id that is used 'id' => 'q' . $qa->get_slot(), is not always unique. It works during a quiz attempt, where a page will show different questions all from the same question_usage. However, it does not work in places like the quiz manual grading report, where it shows the same question from lots of different attempts. (That is what causes MDL-52572.)

      So, we need to change it, and the natural thing to change it to is [... I forget. Simey Lameze and I worked it out in MDL-5311. I hope Simey still has his code and can finish this bit and make a patch.]

      However, the original id is used in various question types (for example https://github.com/moodle/moodle/blob/master/question/type/ddwtos/renderer.php#L45), so this change will need to be called out in question/type/upgrade.txt and the release notes.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Simey Lameze
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days, 2 hours, 30 minutes
                  3d 2h 30m