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

Convert cohort listing reports to Report builder

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_401_STABLE
    • MDL-73141-master
    • Hide

      1. Setup

      1. Login as admin
      2. Create a course category called "Category1"

      2. Report is empty and tabs are shown

      1. Go to Site administration > Users > Cohorts
      2. Confirm 4 tabs are shown: "System cohorts", "All cohorts", "Add new cohort" and "Upload cohorts"
      3. Confirm you see "Nothing to display" on the "System cohorts" tab

      3. Create a new "System" type cohort

      1. Click on "Add new cohort" tab
      2. Add a new cohort with the name "System cohort" and context "System" and press "Save changes"
      3. Confirm the report shows "System cohort" under the "System Cohorts" Tab

      4. Create a new "Category" type cohort

      1. Click on "Add new cohort" tab
      2. Add a new cohort with the name "Category1 cohort" and context "Category1" and Press "Save changes"
      3. Confirm the report shows "Category1 cohort"
      4. Confirm that "Category: Category1" is shown on top of the tabs

      5. Check the content in cohort tabs

      1. Go to Site administration > Users > Cohorts
      2. Confirm "System cohorts" tab is selected and only "System cohort" is shown in the report
      3. Confirm that there is no column called "Category"
      4. Click on "All cohorts" tab
      5. Confirm that now there is a column called "Category"
      6. Confirm that both cohorts are shown in the report

      6. Apply filters

      1. Click on "Filters" button
      2. Set Name dropdown to "Contains" and type "Category1" in the field that just showed up next to it
      3. Press Apply
      4. Confirm that now the report only shows one row with the "Category1" cohort
      5. Click on "Reset all" and confirm report now shows both cohorts again

      7. Edit cohort name using the inplace editable element

      1. Click on "Edit cohort name" pencil icon on the "System cohort" row, change the name to "New System cohort" and press enter
      2. Confirm name has been changed

      8. Hide/Show cohort

      1. Click on the "Hide" icon for "New System cohort" and confirm the whole row has been dimmed
      2. Click on the "Show" icon for "New System cohort" and confirm the whole row is not dimmed anymore

      9. Ensure Edit icon works

      1. Click on "Edit" in the "Category1 cohort" row
      2. Change the Name to "New Category1 cohort" and Save changes
      3. Confirm Name has been changed

      10. Ensure Delete icon works

      1. Click on "Delete" in the "New Category1 cohort" row
      2. Click "continue" on the confirmation page
      3. Confirm that only "New System cohort" is shown on the report

      11. Assign members to cohort

      1. Confirm that "cohort size" column shows "0"
      2. Click on "assign" icon
      3. Add "Admin User" to the cohort and press "Back to cohorts"
      4. Confirm that "cohort size" column shows "1"
      Show
      1. Setup Login as admin Create a course category called "Category1" 2. Report is empty and tabs are shown Go to Site administration > Users > Cohorts Confirm 4 tabs are shown: "System cohorts", "All cohorts", "Add new cohort" and "Upload cohorts" Confirm you see "Nothing to display" on the "System cohorts" tab 3. Create a new "System" type cohort Click on "Add new cohort" tab Add a new cohort with the name "System cohort" and context "System" and press "Save changes" Confirm the report shows "System cohort" under the "System Cohorts" Tab 4. Create a new "Category" type cohort Click on "Add new cohort" tab Add a new cohort with the name "Category1 cohort" and context "Category1" and Press "Save changes" Confirm the report shows "Category1 cohort" Confirm that "Category: Category1" is shown on top of the tabs 5. Check the content in cohort tabs Go to Site administration > Users > Cohorts Confirm "System cohorts" tab is selected and only "System cohort" is shown in the report Confirm that there is no column called "Category" Click on "All cohorts" tab Confirm that now there is a column called "Category" Confirm that both cohorts are shown in the report 6. Apply filters Click on "Filters" button Set Name dropdown to "Contains" and type "Category1" in the field that just showed up next to it Press Apply Confirm that now the report only shows one row with the "Category1" cohort Click on "Reset all" and confirm report now shows both cohorts again 7. Edit cohort name using the inplace editable element Click on "Edit cohort name" pencil icon on the "System cohort" row, change the name to "New System cohort" and press enter Confirm name has been changed 8. Hide/Show cohort Click on the "Hide" icon for "New System cohort" and confirm the whole row has been dimmed Click on the "Show" icon for "New System cohort" and confirm the whole row is not dimmed anymore 9. Ensure Edit icon works Click on "Edit" in the "Category1 cohort" row Change the Name to "New Category1 cohort" and Save changes Confirm Name has been changed 10. Ensure Delete icon works Click on "Delete" in the "New Category1 cohort" row Click "continue" on the confirmation page Confirm that only "New System cohort" is shown on the report 11. Assign members to cohort Confirm that "cohort size" column shows "0" Click on "assign" icon Add "Admin User" to the cohort and press "Back to cohorts" Confirm that "cohort size" column shows "1"

      Moot Italy Visitors

      1. The branch used to demonstrate conversion to Report builder is at https://github.com/moodle/moodle/compare/master...dravek:MDL-73141-presentation (as mentioned during the presentation )

      This issue is about converting the Cohort listing page into using Report Builder.

      The idea is to use this issue to create a presentation for the Italian Moot and explain step by step how to convert the existing cohorts listing code to a system report explaining these ideas:

      • Create a new system report class and how to call it
      • Reuse existing Report Builder entities
      • Create custom columns (columns not present in the entity and that will just be used in this report)
      • Add filters to the report
      • Add conditions (fixed filters that cannot be modified from UI)
      • Use parameters
      • Add actions to the report (Show/Hide cohort, Edit cohort, Delete cohort, Add members to the cohort) and check permissions using callbacks
      • How to apply custom CSS to report rows
      • Override column names (in case column needs a different name than the one defined in the entity)

      The cohort entities added in MDL-72172 should provide most of the report data

        1. Screenshot_2022-04-12 Moodle Master Administration Users Accounts Cohorts.png
          Screenshot_2022-04-12 Moodle Master Administration Users Accounts Cohorts.png
          8 kB
        2. Screenshot from 2022-04-12 12-55-56.png
          Screenshot from 2022-04-12 12-55-56.png
          35 kB
        3. step_2_2.png
          step_2_2.png
          108 kB
        4. step_3_3.png
          step_3_3.png
          147 kB
        5. step_4_3.png
          step_4_3.png
          127 kB
        6. step_5_2.png
          step_5_2.png
          145 kB
        7. step_5_5.png
          step_5_5.png
          168 kB
        8. step_6_4.png
          step_6_4.png
          373 kB
        9. step_6_5.png
          step_6_5.png
          387 kB
        10. step_7_2.png
          step_7_2.png
          58 kB
        11. step_8_1.png
          step_8_1.png
          42 kB
        12. step_8_2.png
          step_8_2.png
          35 kB
        13. step_9_3.png
          step_9_3.png
          36 kB
        14. step_10_2.png
          step_10_2.png
          43 kB
        15. step_10_3.png
          step_10_3.png
          22 kB
        16. step_11_4.png
          step_11_4.png
          40 kB

            davidcarrillo David Carrillo
            pholden Paul Holden
            Paul Holden Paul Holden
            Jun Pataleta Jun Pataleta
            Huong Nguyen Huong Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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