Your Moodle version

Blocks: Search Courses (Autocomplete)

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




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

Comments RSS

Show comments
  • 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,
  • 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.

    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 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.


    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.

  • Picture of Hittesh Ahuja
    Sun, Apr 27, 2014, 9:52 AM

    Block updated on GitHub so the result.php redirects to the login page for unauthorised access.

  • Picture of Hittesh Ahuja
    Sun, Apr 27, 2014, 10:04 AM
  • Picture of Yoann Saludes
    Mon, Sep 1, 2014, 5:13 PM
    An upgrade to 2.7 would be marvelous ! smile
  • Picture of Usman Asar
    Fri, Dec 26, 2014, 3:31 AM
    +1 to Yoann's comments
  • Picture of Hittesh Ahuja
    Fri, Dec 26, 2014, 11:50 PM
    2.7 version now Available !! Happy Holidays everyone !
  • Picture of Usman Asar
    Sat, Dec 27, 2014, 5:11 AM
    Now I am thinking, if I could have wished for something else smile just kidding. many thanks for a very very quick turn around.
  • Picture of Narissa Bayler
    Wed, Jan 7, 2015, 7:23 AM
    Great block but each time the Enter key is pressed (when using IE10 - our default browser) the next block is docked. This continues until there are no blocks left after the search block. Any suggestions on how to fix this?
  • Picture of Hittesh Ahuja
    Thu, Jan 8, 2015, 5:06 AM
    @Narissa Bayler
    I cant seem to replicate the error on IE11.. I'm afraid I dont have a copy of IE10 so cant really test . Would you mind sending me some screenshots of the error ?
1 2
Please login to post comments