Search code examples
moodlemoodle-api

Add one or multiple modules to multiple courses


I need to add a course module (assign for example) to a list of existing courses. There are too many courses for doing this in each one of them. I haven't found a way to do it through moodle interface. Is there any function in Moodle API that allows to do that? Or should I do that through database?

My guess is that I need to add one module as a reference and copy it to other courses.


Solution

  • Try installing moosh

    https://moosh-online.com/

    It's a command line tool that allows you to perform lots of common tasks.

    For example, to add an assign activity to a course with id 2

    moosh activity-add assign 2