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

questions: Select or deselect all questions not working when there are selected or unselected question in the list

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.5.3, 3.6.1
    • Fix Version/s: None
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE

      Description

      An issue has been found when using the select all / deselect all button on the question bank list of questions when the first question on the list is selected/deselected. The logic is based on the state of the first question. This will bring unexpected results when clicking select all and deselect all.

      question/yui/src/qbankmanager/js/qbankmanager.js (line 110)
       
              // We base the state of all of the questions on the state of the first.
              if (this._firstCheckbox.get('checked')) {
                  categoryQuestions.set('checked', false);
                  this._header.setAttribute('title', M.util.get_string('selectall', 'moodle'));
              } else {
                  categoryQuestions.set('checked', true);
                  this._header.setAttribute('title', M.util.get_string('deselectall', 'moodle'));
              }

      Steps to replicate.
      1. Create a course.
      2. Turn editing on.
      3. Add a quiz activity.
      4. Add 3 questions.
      5. Go to Question bank page.
      Default:
      Select All: not ticked
      Q1: not ticked
      Q2: not ticked
      Q3: not ticked
      6. Tick Q1 only.
      7. Next, tick the "Select all" checkbox.
      Result: 
      Q1: From ticked to not ticked.
      Q2. not ticked (no change)
      Q3. not ticked (no change)
      Remarks: This should tick Q1, Q2, and Q3.
      8. Tick "Select all" checkbox. This should tick Q1, Q2, and Q3.
      9. Untick Q1 only. Then tick "Deselect all" checkbox.
      Result: Q1, Q2, and Q3 are ticked. They should all be deselected.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              jebarvia Joshua Ebarvia
              Participants:
              Component watchers:
              Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: