Mass Import Lessons

Mass Import Lessons

by Clint Wilson -
Number of replies: 1

I have a CSV list of roughly 150 tasks (topics in moodle terms). The csv is setup similar to this.


courseid, name, content


I can easily add any other columns, just do not want to manually add 150 topics, is there anyway to import?

I have looked at the database and it would appear that most everything is in mdl_assign and mdsl_assign_plugin_config, mdl_course_models, and mdl_course_sections. For a test I added one item to each of these tables and nothing changed, which confused me.

Any insight would be helpful, cause after this one, I have another one that is 365 topics long. 

Thank you,

Clint


Edit:

Release 3.3.3+ 

Build: 20171116

Version: 2017051503.01

Branch 33

Average of ratings: -
In reply to Clint Wilson

Re: Mass Import Lessons

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The course data is cached (to avoid having to make lots of database calls every time you load the main course page). The cache is cleared whenever something changes on a course (e.g. an activity is edited or a new activity is created). If you've created the data structures correctly, then doing something that will update the cache for the course (or purge all the caches via Site admin > Developer > Purge caches), should show the change.

If you're working with the code, then the function rebuild_course_cache($courseid) should be called.