Select Moodle version:

Blocks: Search Courses (Autocomplete)

block_searchcourses
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
Maintained by: Picture of Hittesh Ahuja Hittesh Ahuja

Screenshots

screenshot

Contributors

Picture of Hittesh Ahuja
Hittesh Ahuja (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • MD shot of me from his iphone4
    Mon, Jul 29, 2013, 10:52 AM
    Thanks Hittesh, this works great!
  • Picture of Hittesh Ahuja
    Tue, Jul 30, 2013, 6:20 PM
    smile
  • Picture of Thomas Schoeftner
    Tue, Oct 15, 2013, 5:59 PM
    Just a quick question - will this block also work with version 2.4?
  • Picture of Hittesh Ahuja
    Tue, Oct 15, 2013, 10:32 PM
    @Thomas, yeah it should work with 2.4
  • Picture of Usman Asar
    Sun, Feb 9, 2014, 11:25 PM
    Lovely Plug-in Hittesh, Have waited for it for long to work with latest versions of Moodle.

    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
  • Picture of Hittesh Ahuja
    Mon, Feb 10, 2014, 4:57 PM
    Hi 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
  • Picture of Usman Asar
    Mon, Feb 17, 2014, 3:23 PM
    Many Thanks Hittesh, Much Appreciated.
  • Picture of Ravi Alamuri
    Mon, Mar 17, 2014, 7:29 PM
    Hello Hittesh,

    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

  • Picture of Hittesh Ahuja
    Tue, Apr 8, 2014, 4:33 AM
    interesting find on the results.php page, I shall update that so you only get the results when you are logged in. I shall dig deeper in the 'my courses' link so see what i can do to fix it.

    thanks for the contribution.

    Hittesh
Please login to post comments