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

Create a toggle-all checkbox output component

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Note: Test on Boost and Classic

      Prerequisites
      1. A course with at least one teacher and at least 2 students.
      2. A Choice activity in a course with the following settings:
        • Has at least 2 options.
        • Publish results: Always show results to students.
        • Privacy of results: Publish full results, showing names and their choices.
        • Show column for unanswered: yes.
      Test
      1. Login as a teacher.
      2. Go to the choice activity.
      3. Below the Responses table, confirm that there is a Select all button.
      4. Click on it.
      5. Confirm that the checkboxes beside each participant in the responses table are checked.
      6. Confirm that its text becomes "Deselect all"
      7. Click on "Deselect all"
      8. Confirm that the checkboxes beside each participant in the responses table become unchecked.
      9. Check/uncheck the checkboxes right under each column header
      10. Confirm that when the column header checkbox gets checked, the checkboxes under the same column get checked.
      11. Confirm that when the column header checkbox gets unchecked, the checkboxes under the same column also get checked.
      12. Tick all of the items under a column.
      13. Confirm that the checkbox under the column header gets checked as well.
      14. Untick one or more items under a column.
      15. Confirm that the checkbox under the column header gets unchecked as well.
      16. Click the "Select all" button again
      17. Untick one of the items
      18. Confirm that the {Deselect all" button's label becomes "Select all"
      19. Check the state of the "With selected" select box.
      20. Confirm that when there are no items selected, the select box is disabled.
      21. Confirm that when there is at least one item selected, the select box becomes enabled.
      Show
      Note: Test on Boost and Classic Prerequisites A course with at least one teacher and at least 2 students. A Choice activity in a course with the following settings: Has at least 2 options. Publish results: Always show results to students. Privacy of results: Publish full results, showing names and their choices. Show column for unanswered: yes. Test Login as a teacher. Go to the choice activity. Below the Responses table, confirm that there is a Select all button. Click on it. Confirm that the checkboxes beside each participant in the responses table are checked. Confirm that its text becomes " Deselect all " Click on "Deselect all" Confirm that the checkboxes beside each participant in the responses table become unchecked. Check/uncheck the checkboxes right under each column header Confirm that when the column header checkbox gets checked, the checkboxes under the same column get checked. Confirm that when the column header checkbox gets unchecked, the checkboxes under the same column also get checked. Tick all of the items under a column. Confirm that the checkbox under the column header gets checked as well. Untick one or more items under a column. Confirm that the checkbox under the column header gets unchecked as well. Click the " Select all " button again Untick one of the items Confirm that the { Deselect all " button's label becomes "Select all" Check the state of the " With selected " select box. Confirm that when there are no items selected, the select box is disabled. Confirm that when there is at least one item selected, the select box becomes enabled.
    • Affected Branches:
      MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:
      MDL-65928-master-2
    • Story Points:
      2
    • Sprint:
      Sprint 2 - Experimental

      Description

      Who is this project for?
      • For Moodle devs!; and
      • Ultimately for Moodle users!
      What is the problem that you're trying to solve?
      • Andrew Nicols created the awesome core/checkbox-toggleall AMD module. However, to be able to use it, you will have to do various stuff first (e.g. import the AMD module, manually edit the HTML/attributes of the elements to add the required data attributes, etc).
      • It currently doesn't have support for toggling the state of action elements (e.g. buttons that perform actions on the selected items.
      • It currently doesn't support toggling of nested checkbox elements (e.g. master checkbox toggles all checkboxes, while another master checkbox that toggles a subset of those checkboxes)
      Why does it need solving?
      • It would help developers to easily use the checkbox_toggleall element!
      • We'll be able to provide a more consistent method of selecting/deselecting items on a list.
      How does your project tackle the problem?
      • The patch for this issue provides an easier way for developers to output a toggle-all checkbox that can control a group of checkboxes on a list. Developers will simply have to implement the following:
        1. Define master checkbox(es) - responsible for toggling the checkboxes in the list.
        2. Define slave checkboxes
        3. (Optional) Assign appropriate data attributes to action elements. Action elements are those who perform actions on the selected items.
      • The improvements on the core/checkbox-toggleall will also
        • enable support for toggling the state (enabled/disabled) of action elements. This will help us clean up the custom JS code for enabling/disabling the action elements scattered all throughout moodle.
        • allow master checkboxes to belong to multiple toggle groups. In other words, this means that master checkboxes can control one or more groups of checkboxes. This is particularly helpful for selecting multiple items belonging to different groups.

        Attachments

        1. choice-after.png
          choice-after.png
          102 kB
        2. choice-before.png
          choice-before.png
          50 kB
        3. MDL-65928_Boost.jpg
          MDL-65928_Boost.jpg
          41 kB
        4. MDL-65928_Boost (2).jpg
          MDL-65928_Boost (2).jpg
          42 kB
        5. MDL-65928_Classic.jpg
          MDL-65928_Classic.jpg
          46 kB
        6. MDL-65928_Classic (2).jpg
          MDL-65928_Classic (2).jpg
          39 kB

          Issue Links

            Activity

              People

              • Assignee:
                jpataleta Jun Pataleta
                Reporter:
                jpataleta Jun Pataleta
                Peer reviewer:
                Neill Magill
                Integrator:
                Andrew Nicols
                Tester:
                Anna Carissa Sadia
                Participants:
                Component watchers:
                Dan Marsden, Jake Dallimore, Jun Pataleta, Ryan Wyllie, Amy Groshek, David Scotson, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón, Jake Dallimore, Jun Pataleta, Ryan Wyllie, Barbara Ramiro, Jake Dallimore, Jun Pataleta, Ryan Wyllie
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Nov/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 13 minutes
                  1d 13m