1
votes

I am trying to update our system to the new school year and I've noticed that the previous admin has removed some user profiles (teachers) without reassigning the courses they own to existing teachers.

These courses are causing a lot of issues when trying to automate tasks (apparently, they cannot be modified in any way, cannot be set to ACTIVE or ARCHIVED and their ownerId cannot be modified to a new one.

I'm trying to find a workaround and I thought of creating a dummy user and replacing its id with the removed teachers ids, then patch the courses to replace the owner.

However, when testing up through the Directory API:

Field UserKey:

<string userId>

Field RequestBody:

{
  "id": <string newId>
}

I get an error.

 "code": 400,
 "message": "Value set through a parameter is inconsistent with a value set in the request."

So... My questions are: a) Is there a way to change an user's ID number through Google App Script? b) If not... Is there any way in that I can get assign those courses to new users? c) If that can't be done either... can those courses even be removed? d) Is there any other solution to this issue?

Thanks a lot for you help.

1

1 Answers

0
votes

A) You can't change the user's ID.

B) After the owner of the course is deleted, you can't make any change to the course.

C) Yes, you can delete the course (even without owner) using the Courses.Delete request [1]. You only need the course ID.

[1] https://developers.google.com/classroom/reference/rest/v1/courses/delete