Your Moodle version

Blocks: My enrolled courses

block_my_enrolled_courses
Maintained by Picture of DualCube Team DualCube Team, Picture of Arindam Ghosh Arindam Ghosh
My Enrolled Courses block enables users to show or hide the courses they are enrolled in. The block contains links to the courses enrolled, the visibility of which can be changed from the settings panel, as per requirement. You can hide the ones you are done with and change their visibility again, if need be. One click on a course link will redirect to that particular course page.
993
1

MY Courses

My Enrolled Courses block enables users to show or hide the courses they are enrolled in. The block contains links to the courses enrolled, the visibility of which can be changed from the settings panel, as per requirement.  You can hide the ones you are done with and change their visibility again, if need be. One click on a course link will redirect to that particular course page.

This block can be added to any page of a Moodle site. It is perfectly compatible with Moodle versions 2.4, 2.5, 2.6 and 2.7.

How to access the settings page of the block?

Go to My Enrolled Courses block, click on Show/Hide and you'll land on the Settings panel of the block.

On settings page, the left column - 'Visible courses'- contains all the enrolled courses and the ones you want to see in the block. The right column i.e. 'Hidden courses' contains the courses you don't wish to see in the list of courses in the block.

How to hide a course?

To make a 'visible' course 'hidden', select Courses from the 'Visible courses' list, and then click 'Hide courses'.

How to make a course Visible?

To make a course 'visible' again, the user have to select courses from the 'Hidden courses' list and then click 'Show courses'. Your 'Hidden' course will reappear in the block.

Screenshots

Screenshot
Screenshot

Contributors

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

Comments RSS

Show comments
  • Picture of David Mudrák
    Thu, Aug 21, 2014, 9:46 PM
    Hi Arindam. Thanks for sharing the block with the community.

    I noticed that the recommended boilerplate was not used in the version.php file. The boilerplate is recommended at the beginning of
    each file and makes explicit the GPL license. You may want to review http://docs.moodle.org/dev/Coding_style#Files to learn more
    about the boilerplate comments.

    Your styles file does not contain specific CSS selectors. So the defined styles may affect other parts of Moodle outside your plugin
    scope (once they are concatenated with other plugins).

    I noticed that you create functions in the global PHP scope without the valid frankenstyle prefix (e.g. in your functions.php file).
    This is strongly discouraged in order to prevent collisions with (current and/or future) core code or some other plugin. See
    http://docs.moodle.org/dev/Coding_style#Functions_and_Methods for details.

    What's the point of the unset($_POST); code in your showhide.php file?

    You do not seem to check for the sesskey value. This makes your plugin vulnerable against CSRF attacks.

    As you seem to select records from the block_my_enrolled_courses table always by the userid, it would make sense to have an index
    for this column, too.

    It is encouraged to follow Moodle’s coding style as outlined in: http://docs.moodle.org/dev/Coding_style and
    http://docs.moodle.org/dev/Coding The code checker plugin can be quite helpful in fine tuning your code and can be found at:
    https://moodle.org/plugins/view.php?plugin=local_codechecker You may wish to consider using that tool to further improve your
    plugin.

    For now, I am going to mark this plugin as needing more work until we get these issues resolved. Thanks for your patience with the
    review and approval process.
  • Picture of David Mudrák
    Thu, Aug 28, 2014, 5:51 PM
    Thanks for providing the updated version with issues fixed. I am going to approve the plugin now. The only suggestion I have is performance wise. In the block_my_enrolled_courses_visible_in_block() you call $DB->get_record() inside a foreach loop. It is much more effective to load all hidden courses for the current user in a single $DB->get_records() call before checking them inside the loop. That may become significant when users are enrolled in many courses. Also note, the common practise is to have a file locallib.php to hold the plugin functionality, you may wish to rename your current functions.php library.

    You are cleared to land now, welcome to the Plugins directory.
  • Picture of DualCube Team
    Mon, Sep 1, 2014, 7:47 PM
    Hi David,

    Thanks a lot for the approval. It really feel great to finally have our plugin available for donwload! Also your suggestions are much appreciated, we will surley keep them in mind going forward.

    Thanks and Regards,
    Arindam,
    DualCube
  • Picture of Thomas Schoeftner
    Tue, Dec 16, 2014, 5:52 PM
    Thanks a lot for this really great block - it's very useful for my institution smile
  • Picture of DualCube Team
    Tue, Dec 16, 2014, 6:01 PM
    Hi Thomas,

    Thanks heaps for your appreciation and encouraging words. Please do not hesitate to reach out to us in case you need any assistance or face any issues.

    Thanks and Regards,
    Arindam
Please login to post comments