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

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 3.5.6, 3.6.4
    • 3.1.17, 3.4.8, 3.5.5, 3.6.3, 3.7
    • Questions
    • MOODLE_31_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE
    • MDL-65029-master
    • 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.

      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. 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.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Simey Lameze Simey Lameze
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.