Add an Activity to all courses at one click

Picture of M Adil Mazhar
Add an Activity to all courses at one click

I want to add an activity to multiple courses but adding activities to different courses one by one is extremely boring & time consuming job.

Kindly confirm me if there's any tool/plugin with the help of which i can add single activity (i.e. URL) to multiple courses at one click.

I didn't found any such tool/plugin, so i've to develop a plugin myself. Please suggest me an easy way and some guidelines for developing that plugin.

Extremely thankful for helpful responses!

Average of ratings: -
Picture of Purnendu Dash
Re: Add an Activity to all courses at one click


Hope you’re doing well. It’s a nice experience to meet fellow Moodlers in this virtual space.  I’ve seen your problem; please allow me to try my hands on in solving this issue.

As far as your post goes, you need to develop a plug-in of your own such that you get access to all courses at one click.  I’d like to inform you that this kind of activity is slightly difficult in Moodle. And if you still wish to go for this, you’ve to enable some custom code which may break the structure of Moodle.

Also, you should keep in mind , at any time an activity is added in a course, values get inserted simultaneously in 2-4 tables that include mdl_course_modules, and mdl_context, mdl_course_sections. If you insert any wrong value in mdl_context table, your site may be completely down.  

I’ve tried to explain all pros and cons of such an action, now it’s up to you to choose.

Good Luck!



Average of ratings: Useful (1)
Picture of M Adil Mazhar
Re: Add an Activity to all courses at one click

Thanks a lot for your quick and kind response!

Your comment frightened me :P but felt really nice to read your detailed reply. Yes I've to develop my own block but being a newbie, getting many issues in the development of a simple block. Moreover didn't get any reliable and good support/guideline for developing blocks.

I think block is my exact requirement rather than tool (admin) or something else. If this is the case, can you please guide me in developing a new block? 

I tried following the only relevant material in this regard i.e. but didn't found it much helping. These guidelines are somehow confusing for me.

Waiting for any kind and quick response!

Thanks again for sharing your knowledge!

M. Adil


Average of ratings: -