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

Include all courses in Global search results

XMLWordPrintable

    • MOODLE_37_STABLE
    • MOODLE_37_STABLE
    • MDL-62869-include-all-courses-mycourse-fix-new
    • Hide

      Set up

      1. Configure your moodle to have multiple courses with some activities inside the courses (Course 1, Course 2, Course 3)
      2. Make sure that content across the courses has similar key words. That will help you to test by using just one word in your tests.
      3. As admin Ensure that Courses search area is enabled in admin/searchareas.php
      4. As admin index content of these courses.
      5. Enrol a User 1 to Course 1 only.
      6. Enable a Guest access for Course 2.
      7. Enable global search and index data from admin/settings.php?section=manageglobalsearch (as admin)

      Test 1

      1. As admin go to admin/settings.php?section=manageglobalsearch and set
      2. Searchable courses = Search within enrolled courses only
      3. Include all visible courses = No
      4. Login as User 1.
      5. Search for "<Common word for all courses and content>".
      6. Expected: only content and course information form Course 1 is displayed. No "My courses only" filter is displayed in the search form.

      Test 2

      1. As admin go to admin/settings.php?section=manageglobalsearch and set
      2. Searchable courses = Search within enrolled courses only
      3. Include all visible courses = Yes
      4. Login as User 1.
      5. Search for "<Common word for all courses and content>".
      6. Expected: only content form Course 1 is displayed. Course information of Course 1, Course 2 and Course 3 is displayed. There is "My courses only" in the search form.
      7. Tick "My courses only" and search.
      8. Expected: Only content and course information form Course 1 is displayed.

      Test 3

      1. As admin go to admin/settings.php?section=manageglobalsearch and set
      2. Searchable courses = Search within all courses the user can access
      3. Include all visible courses = No
      4. Login as User 1.
      5. Search for "<Common word for all courses and content>".
      6. Expected: Content form Course 1 and Course 2 is displayed. Course information of Course 1 and Course 2 is displayed. There is "My courses only" in the search form.
      7. Tick "My courses only" and search.
      8. Expected: Only content and course information form Course 1 is displayed.

      Test 4

      1. As admin go to admin/settings.php?section=manageglobalsearch and set
      2. Searchable courses = Search within all courses the user can access
      3. Include all visible courses = Yes
      4. Login as User 1.
      5. Search for "<Common word for all courses and content>".
      6. Expected: Content form Course 1 and Course 2 is displayed. Course information of Course 1, Course 2 and Course 3 is displayed. There is "My courses only" in the search form.
      7. Tick "My courses only" and search.
      8. Expected: Only content and course information form Course 1 is displayed.

      Test 5 (Clean up of My Courses search area)

      1. Before applying the patch, with global search enabled and information indexed.
      2. Make sure that there is some data in config table for My courses search area using SQL  "SELECT * FROM mdl_config_plugins WHERE plugin = 'core_search' AND name like 'core_course_mycourse_%'";
      3. Apply a patch and run upgrade script.
      4. Run a cron and make sure it processed all adhoc tasks from a queue (basically we are interested in "core\task\clean_up_deleted_search_area_task")
      5. Make sure that there is no data left in plugin config table for My courses search area using SQL  "SELECT * FROM mdl_config_plugins WHERE plugin = 'core_search' AND name like 'core_course_mycourse_%'";
      Show
      Set up Configure your moodle to have multiple courses with some activities inside the courses (Course 1, Course 2, Course 3) Make sure that content across the courses has similar key words. That will help you to test by using just one word in your tests. As admin Ensure that Courses search area is enabled in admin/searchareas.php As admin index content of these courses. Enrol a User 1 to Course 1 only. Enable a Guest access for Course 2. Enable global search and index data from admin/settings.php?section=manageglobalsearch (as admin) Test 1 As admin go to admin/settings.php?section=manageglobalsearch and set Searchable courses = Search within enrolled courses only Include all visible courses = No Login as User 1. Search for "<Common word for all courses and content>". Expected: only content and course information form Course 1 is displayed. No "My courses only" filter is displayed in the search form. Test 2 As admin go to admin/settings.php?section=manageglobalsearch and set Searchable courses = Search within enrolled courses only Include all visible courses = Yes Login as User 1. Search for "<Common word for all courses and content>". Expected: only content form Course 1 is displayed. Course information of Course 1, Course 2 and Course 3 is displayed. There is "My courses only" in the search form. Tick "My courses only" and search. Expected: Only content and course information form Course 1 is displayed. Test 3 As admin go to admin/settings.php?section=manageglobalsearch and set Searchable courses = Search within all courses the user can access Include all visible courses = No Login as User 1. Search for "<Common word for all courses and content>". Expected: Content form Course 1 and Course 2 is displayed. Course information of Course 1 and Course 2 is displayed. There is "My courses only" in the search form. Tick "My courses only" and search. Expected: Only content and course information form Course 1 is displayed. Test 4 As admin go to admin/settings.php?section=manageglobalsearch and set Searchable courses = Search within all courses the user can access Include all visible courses = Yes Login as User 1. Search for "<Common word for all courses and content>". Expected: Content form Course 1 and Course 2 is displayed. Course information of Course 1, Course 2 and Course 3 is displayed. There is "My courses only" in the search form. Tick "My courses only" and search. Expected: Only content and course information form Course 1 is displayed. Test 5 (Clean up of My Courses search area) Before applying the patch, with global search enabled and information indexed. Make sure that there is some data in config table for My courses search area using SQL  "SELECT * FROM mdl_config_plugins WHERE plugin = 'core_search' AND name like 'core_course_mycourse_%'"; Apply a patch and run upgrade script. Run a cron and make sure it processed all adhoc tasks from a queue (basically we are interested in "core\task\clean_up_deleted_search_area_task") Make sure that there is no data left in plugin config table for My courses search area using SQL  "SELECT * FROM mdl_config_plugins WHERE plugin = 'core_search' AND name like 'core_course_mycourse_%'";

      Moodle Global Search functionality currently allows users to search for content in either only courses the user is enrolled in, or in all courses the user can enrol in. The option to which method applies is set via a Moodle administration setting.

      We would like to have another admin option to support searching for all courses in Moodle (the same way it happens in /course/search.php) Following features should be implemented as part of this change:

      • Add a new Moodle Global Search administration setting “Include all courses” (checkbox)
      • When this option is enabled Global Search results returned to the user will include name and summary for those courses the user cannot access 
      • Add an API flag to core Moodle to allow plugins to declare if they support this additional functionality
      • Update Moodle core as required to support the required functionality

      Example:

      1. I can not access course 1, but a new setting  “Include all courses”  is enabled
      2. I search for "course 1", as long as other site settings allow us to see "course 1" (like if it is listed in course/index.php) we can list "course 1" and it's summary
      3. I search for "activity 1", we can not list "activity 1" nor "course 1" (even if we just show the course name and description)

      This proposed work will be sponsored by abias and Ulm Uni. Catalyst to carry out the work.

        1. After upgrade.php change.png
          After upgrade.php change.png
          119 kB
        2. T1S6.png
          T1S6.png
          68 kB
        3. T2S6.png
          T2S6.png
          60 kB
        4. T2S8.png
          T2S8.png
          72 kB
        5. T3S6.png
          T3S6.png
          49 kB
        6. T3S8.png
          T3S8.png
          72 kB
        7. T4S6.png
          T4S6.png
          60 kB
        8. T4S8.png
          T4S8.png
          67 kB
        9. T5S2.png
          T5S2.png
          178 kB
        10. T5S5.png
          T5S5.png
          67 kB

            dmitriim Dmitrii Metelkin
            dmitriim Dmitrii Metelkin
            Luca Bösch Luca Bösch
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Mathew May Mathew May
            Votes:
            6 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 - 2 hours, 30 minutes
                2h 30m

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