Create Course-Categorys with a csv-file

Create Course-Categorys with a csv-file

by Moritz Grey -
Number of replies: 3

Hey Everybody, 

is it possible to create Course-Categorys with help a CSV-FILE.

I have only find information to bulk-uploads for coursers, but NOT for Course-Categorys. 


Hanks Everyone for help. 


MG 


 

Average of ratings: -
In reply to Moritz Grey

Re: Create Course-Categorys with a csv-file

by Anton Tremetzberger -
Picture of Particularly helpful Moodlers
Hello Moritz,

I have already replied to you in the German-speaking forum, maybe it's also interesting for english speaking community: it's not the same like uploading a csv, but an other possibility is using the webREST interface and you don't need access to the command line on the server. You have to use the function "core_course_create_categories", you also need a webREST-user and a token.

You need to know the ID of the parent course category (= parent) and the name/ID-number of the new course categorie. E.g. for creating the category "1.term" in the parent course category 10 its like:
https://mymoodle//webservice/rest/server.php?wstoken=XYZ&moodlewsrestformat=json&wsfunction=core_course_create_categories&categories[0][name]=1.term&categories[0][parent]=10&categories[0][idnumber]=01term

You can use some scripts to create more webREST-calls (e.g. we are using the tool wget for reading several lines from one script-generated file).

It is a little bit tricky, but if you have more entries it could also be a good solution.

br, Anton
Average of ratings: Useful (2)