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

    • Improvement
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 3.1.17, 3.4.8, 3.5.5, 3.6.3, 3.7
    • 3.5.6, 3.6.4
    • 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.

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

              timhunt Tim Hunt
              timhunt Tim Hunt
              Simey Lameze Simey Lameze
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              CiBoT CiBoT
              Safat Shahin, Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Raquel Ortega, Sabina Abellan, Sander Bangma, Sara Arjona (@sarjona), Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                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