Suggestion: allow csv's to update course assignments for admins

Suggestion: allow csv's to update course assignments for admins

by Dennis Felix -
Number of replies: 5

We have a handful of teachers in our organization that help with the general setup and maintenance of Moodle. They have been added to the Site Administrator list, but they are also active teachers. When processing our lists for course assignments to give them the role of editing teachers (very long lists), the upload process doesn't assign their role and gives the error "Cannot update admin accounts". Adding these teachers to the courses manually would be tedious. I have removed them from the admin list and spent some time filtering the long csv checking which ones needed to be redone and then reuploaded the file as a workaround.

I understand the reasoning to not allow admins to be edited via csv, but the assignment of teaching roles in courses should be allowed via this method.

Kind regards

Average of ratings: -
In reply to Dennis Felix

Re: Suggestion: allow csv's to update course assignments for admins

by Colin Fraser -
Picture of Documentation writers Picture of Testers
I believe it is. Assuming your Teachers are already enrolled, the courses they have a Role in, they can be deleted from, via csv file. Admins can be assigned as Teachers, so I don't know why the error message is being thrown up, unless the assumption is that they already have the "go anywhere, do anything" capability in every course so why change it? Given that Admins are not assigned a Role, specifically in a course, and their names do not appear as Teachers of courses, I don't think Moodle would refuse them a known Role in a course. I suspect there is something in your csv structure that is not fully compliant, you might want to review this Moodle Doc.
In reply to Colin Fraser

Re: Suggestion: allow csv's to update course assignments for admins

by Dennis Felix -
Hi, here is a screenshot of the error. At first sight I do not believe anything is wrong with how the CSV is built up, but I will check with the guide.

In reply to Dennis Felix

Re: Suggestion: allow csv's to update course assignments for admins

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
There is no enrolments field in Moodle. One should use these fields:

course1,type1,role1,group1,enrolperiod1,enrolstatus1,course2,type2,role2,group2,enrolperiod2,enrolstatus2
In reply to Renaat Debleu

Re: Suggestion: allow csv's to update course assignments for admins

by Dennis Felix -
This works for every other teacher (which are hundreds) and for these teachers when removed from the Admin list so the enrolments field is not of importance here. In fact, they are not mentioned in the CSV file, which is pretty short column-wise:

username;course1;type1

edit: I would like to add that the "enrolments" field you see in the screenshot is shown by Moodle and not added by us via the CSV. Maybe it's added via plugin by the previous Moodle admin, but I can't confirm that.
In reply to Dennis Felix

Re: Suggestion: allow csv's to update course assignments for admins

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Personally, I would take a somewhat different approach to this anyway.

I would recommend separating admin functionality from teaching and give those with admin requirements a separate admin account to perform those actions.