Moodle plugins directory: Search Courses (Autocomplete) | Moodle.org
Search Courses (Autocomplete)
Blocks ::: block_searchcourses
Maintained by Hittesh Ahuja
Just enter the first letter of the course you want to search and the auto complete box gives you a list of matching courses with the current word highlighted. The block also has a 'My Courses' feature, when enabled, lets you search only the courses the current user is registered on .
This block is best used on the 'My Home' page which allows centre positioning of blocks thereby giving you a wider space to see the autocomplete results.
Copyright : University of Bath
Latest release:
103 sites
17 downloads
19 fans
Current versions available: 3
Useful links
Contributors
Hittesh Ahuja (Lead maintainer)
Please login to view contributors details and/or to contact them
Few Things that I would really love to see added/changed.
1: Search listings does include Course ID, where not everyone uses Course ID's because they are not required by Default, so if this can be changed with Short Course Name (required by default), as though one can copy the short course name in course ID without having any trouble, but if left blank, it shows blank round brackets, e.g: "() My Course" and that looks kinda weird.
2: The Block Name "SEARCH COURSES (AUTOCOMPLETE)" is way too Long for it to adjust in a single line, if you can remove/delete the word "(AUTOCOMPLETE)", that would be lovely.
3: I can see a useful check-box option of searching within My Courses, That seems applicable to a LMS where users are subjected to Log-In/Register so to search within there enrolled courses, but this check-box isn't useful where Guests are allowed (or site is fully opened to Guests), can there be added an option to Hide/Disable the option of this check-box?
Thanks & Regards,
Usman
Many thanks for your comments.
I have changed the code on my GitHub so that it displays the course shortname in the brackets instead of the courseid number. Regarding (2), I am trying to not to confuse the block with any core blocks that moodle would have,hence the additional 'AutoComplete' for now. I am working on (3) at the moment.
Keep an eye on the github repository as its easier for me to update that than to upload the zip again.
Regards,
Hittesh Ahuja
Many thanks for the excellent block. We are using it quite successfully in our moodle instance. We did make a few changes to our version of the block however. We noticed that anyone could in theory access http://www.yourmoodlesite.com/blocks/searchcourses/results.php?query= and get a list of the courses on the site even without being logged in. So we added a isloggedin check to ensure that the user is logged in. It still does not prevent direct access to the script but at least it ensures that the user is logged in (in which case he has access to the courses list anyway).
We also noticed that checking the "My Courses" checkbox on Moodle 2.6 does not return any results. We figured this is because the enrol_get_my_courses function no longer likes modinfo as a valid field. Since we were not displaying this info anyway, we simply removed it from the list of fields and this seems to have the functionality restored as expected.
Once again, thank you for the excellent plugin. Hope the above info helps someone.
Regards
Ravi Alamuri
thanks for the contribution.
Hittesh
Block updated on GitHub so the result.php redirects to the login page for unauthorised access.
Hittesh
https://github.com/hitteshahuja/moodle-block_searchcourses/commit/d47fd66d47802ae360d2fbbebe17b3e5d9f595f4