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

Convert cohort listing reports to Report builder

    XMLWordPrintable

Details

    • Improvement
    • Status: Waiting for integration review
    • Minor
    • Resolution: Unresolved
    • 4.1
    • None
    • Cohorts, Report builder
    • 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 "New 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 "New Category1 cohort" 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 "New Category1" in the field that just showed up next to it Press Apply Confirm that now the report only shows one row with the "New Category1 cohort" 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"

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              davidmatamoros David Matamoros
              pholden Paul Holden
              Paul Holden Paul Holden
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Carlos Castillo, David Matamoros, Mikel Martín Corrales, Paul Holden
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 5 hours, 30 minutes
                  1d 5h 30m