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

tool_usertours: Filters to exclude categories and courses

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_500_STABLE
    • MDL-74149-master
    • Hide
      1. Login as admin
      2. Using the interface in Site administration > Courses > Manage courses and categories, create 4 top-level categories: A, D, E, G.
      3. Inside category A, create two sub-categories B and C.
      4. Inside category C, create a sub-category H.
      5. Inside top-level category E, create sub-category F.
      6. Create a new course (default settings ok) inside category F called COURSE-F (use the same name for short name and full name).
      7. Create a new course (default settings ok) inside category H called COURSE-H.
      8. Go to Site Admin > Appearance > User tours configuration page
      9. Create a new tour
      10. Open the Tour filters section
        • EXPECTED: The new option Exclude categories should appear directly below the existing Category list.
        • EXPECTED: Because All is selected in Category list, Exclude categories list should list all the available categories including A, A / B, A / C, A / C / H, D, E, E / F, G. It does not have an All option.
      11. Change the category option by using ctrl-click to select A, D, and E.
        • EXPECTED: Because those categories are selected, only the categories inside those are available in the Exclude categories list: A / B, A / C, A / C / H, and E / F.
      12. Now select a category that does not have any categories within it, such as category H.
        • EXPECTED: The Exclude categories option should disappear, because it is no longer possible to exclude any categories.
      13. Change the selection back to select A, D, and E.
        • EXPECTED: As soon as you select a category that contains subcategories, the Exclude categories option should appear again.
      14. Look at the Courses dropdown
        • EXPECTED: It should have 3 options All courses (selected), Selected courses only, or All courses except selected.
        • EXPECTED: There is no Selected courses option shown.
      15. Change option to Selected courses only
        • EXPECTED: A Selected courses option should appear - this is actually the existing option there previously.
      16. Change option to 'All courses except selected*
        • EXPECTED: The Selected courses option should still be available, it will now work the opposite way.
      17. Now that we have tested the form, set the rest of the tour options at the top:
        • Set Name to My tour
        • Set Apply to URL match to /course/edit.php%
        • Tick the Tour is enabled button
      18. Initially, test the new exclude course feature by setting the Courses dropdown to Exclude selected courses only and choosing course COURSE-H.
      19. Press Save changes
      20. Click the View icon in the table row for the newly-created tour.
      21. Click the New step link
      22. Set Target type to Display in middle of the page
      23. Set title to Frog and content to Kermit (or any other preferred text)
      24. Press Save changes
      25. In another tab, go to course COURSE-F, and go to the Settings tab.
        • EXPECTED: After the page loads, the tour should appear (do not interact with it)
      26. Reload COURSE-F settings page.
        • EXPECTED: The tour should appear again.
      27. Now go to COURSE-H Settings tab.
        • EXPECTED: Tour does not appear.
      28. In the first tab, edit the tour settings. Change the Courses dropdown to All courses, but now in the Exclude categories list, choose category E. Save changes.
      29. In your other tab, go to course COURSE-F, and go to the Settings tab.
        • EXPECTED: User tour does not appear (course F is in category F, which is a child of excluded category E).
      30. Now go to COURSE-H Settings tab.
        • EXPECTED: Tour appears.
      Show
      Login as admin Using the interface in Site administration > Courses > Manage courses and categories , create 4 top-level categories: A, D, E, G. Inside category A, create two sub-categories B and C. Inside category C, create a sub-category H. Inside top-level category E, create sub-category F. Create a new course (default settings ok) inside category F called COURSE-F (use the same name for short name and full name). Create a new course (default settings ok) inside category H called COURSE-H. Go to Site Admin > Appearance > User tours configuration page Create a new tour Open the Tour filters section EXPECTED: The new option Exclude categories should appear directly below the existing Category list. EXPECTED: Because All is selected in Category list, Exclude categories list should list all the available categories including A, A / B, A / C, A / C / H, D, E, E / F, G. It does not have an All option. Change the category option by using ctrl-click to select A, D, and E. EXPECTED: Because those categories are selected, only the categories inside those are available in the Exclude categories list: A / B, A / C, A / C / H, and E / F. Now select a category that does not have any categories within it, such as category H. EXPECTED: The Exclude categories option should disappear, because it is no longer possible to exclude any categories. Change the selection back to select A, D, and E. EXPECTED: As soon as you select a category that contains subcategories, the Exclude categories option should appear again. Look at the Courses dropdown EXPECTED: It should have 3 options All courses (selected), Selected courses only , or All courses except selected . EXPECTED: There is no Selected courses option shown. Change option to Selected courses only EXPECTED: A Selected courses option should appear - this is actually the existing option there previously. Change option to 'All courses except selected* EXPECTED: The Selected courses option should still be available, it will now work the opposite way. Now that we have tested the form, set the rest of the tour options at the top: Set Name to My tour Set Apply to URL match to /course/edit.php% Tick the Tour is enabled button Initially, test the new exclude course feature by setting the Courses dropdown to Exclude selected courses only and choosing course COURSE-H. Press Save changes Click the View icon in the table row for the newly-created tour. Click the New step link Set Target type to Display in middle of the page Set title to Frog and content to Kermit (or any other preferred text) Press Save changes In another tab, go to course COURSE-F, and go to the Settings tab. EXPECTED: After the page loads, the tour should appear (do not interact with it) Reload COURSE-F settings page. EXPECTED: The tour should appear again. Now go to COURSE-H Settings tab. EXPECTED: Tour does not appear. In the first tab, edit the tour settings. Change the Courses dropdown to All courses , but now in the Exclude categories list, choose category E. Save changes. In your other tab, go to course COURSE-F, and go to the Settings tab. EXPECTED: User tour does not appear (course F is in category F, which is a child of excluded category E). Now go to COURSE-H Settings tab. EXPECTED: Tour appears.
    • Hide

      Code verified against automated checks.

      Checked MDL-74149 using repository: https://github.com/vietlx426/moodle-1.git

      More information about this report

      Built on: Fri Mar 21 09:14:13 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-74149 using repository: https://github.com/vietlx426/moodle-1.git main (0 errors / 0 warnings) [branch: MDL-74149-master | CI Job ] More information about this report Built on: Fri Mar 21 09:14:13 UTC 2025
    • Hide

      Launching automatic jobs for branch MDL-74149-master

      Built on: Fri Nov 15 04:38:24 AM UTC 2024

      Show
      Launching automatic jobs for branch MDL-74149 -master https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59214/ Behat (NonJS - boost and classic / --tags @tool_usertours) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59215/ Behat (Firefox - boost / --tags @tool_usertours) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59216/ Behat (Firefox - classic / --tags @tool_usertours) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59217/ App tests (stable app version) / --tags @tool_usertours) Built on: Fri Nov 15 04:38:24 AM UTC 2024

      On the user tour editing screen, there are filters by Category (which is a multi-select field containing all categories on the site and a default 'All' option) and Courses (which is an auto-complete field allowing selection of zero or more courses on the site).

      We propose adding two new filters, 'Exclude category' and 'Exclude courses', each to appear below the existing filter (so the order is: Category, Exclude category, Courses, Exclude courses).

      The user interface for these filters would be identical to the existing ones, with the exception that the text for the default value in the category multi-select would be 'None' instead of 'All'.

      The 'Exclude category' field, if anything other than 'None' is selected, would stop a tour appearing in a course that belongs to any of the selected categories (or their child categories).

      The 'Exclude courses' field, if any courses are selected, would stop a tour appearing in any of those selected courses.

       

      Here are some made-up example use cases for the category exclusion:

      • A Moodle system includes mainly student courses (in categories by subject area or year, etc). There are lots of different top-level categories. At top level there is also a category for staff training. We can set a tour that applies in every student category ('All') but use 'Exclude category' to remove the staff training category, without having to manually select dozens of student categories as you would at present.
      • Categories are organised by faculty and then numerous subdivisions for individual programmes etc. The Business faculty wants a tour that applies to all courses in their faculty, but wait! It turns out that the Law programme (a subcategory) don't like it and will sue somebody if we put the tour on their courses. Adding their category to 'Exclude category' gives an easy way to make the exception, and have the tour still apply even if new programmes are added (under Business) later.

      And for course exclusion:

      • A tour is set to apply generally and has been created to work in a 'standard' course that is set up the way the university expects. Across the system there are three single courses that have changed their websites to work in a different way, meaning the tour would fail to appear correctly or would have inaccurate text. Threats of violence have not convinced the teachers of these courses to make them work the normal way, but with this feature we can turn off the tour on those specific courses where it doesn't work.

       

      Note: This feature is desired by the Open University, so we intend to assign somebody to develop it.

        1. unit-tests-tidy.patch
          3 kB
          Sam Marshall
        2. fa17a23c-9f47-4d0a-92e2-852123beaf5f.png
          15 kB
          Viet Truong Quoc
        3. MDL-74149.png
          836 kB
          Ron Carl Alfon Yu

            vietlx426 Viet Truong Quoc
            quen Sam Marshall
            Sam Marshall Sam Marshall
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour, 40 minutes
                1d 1h 40m

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