Google Classroom API Create Material

a 夏天 提交于 2019-12-06 15:07:54

问题


I am aware that there are multiple questions essentially asking the same thing, but part of the problem I've identified is a lack of detail in the questions, so I'm going to try here, since I think I've exhausted all possibilities.

In the newer Google Classroom, there is a Classwork Tab/Page. This is new, and replaced an older "About" page. In this page, as a regular web user, you can create various materials, including one simply called "Material." This is done by clicking the create button and choosing "Material".

These materials contain any combination of title, description, and attached files/links.

However, when using the API, while I can access any OTHER type of Classwork via: Classroom.Courses.CourseWork, no attempts to find these items (or create them via the API) has been successful. I've successfully created Assignments (a variant of CourseWork using:


Classroom.Courses.CourseWork.create({
    "creatorUserId":'me',
    "state":'draft',
    "courseId":cid,
    "title":'test item',
    "workType":"ASSIGNMENT",
    "materials": [],

  }, 'myClassCode');

}

The enum for workType according to the API only contains:

I've tried omitting the workType (receive error saying I need to include it), using various guesses like MATERIAL, NONE, ABOUT, and null (all receive errors for invalid types).

I can query the list of CourseWork and find all of my entries that are questions or assignments but have found no access to the other items, which are current and active in the Classwork page for the class.

It's possible that this simply isn't accessible via the API, but I'd like to confirm. Any advice would be appreciated.

I am running as SuperUser and everything else seems to be working fine.


回答1:


You are right, at the moment it is not possible to create course materials through Google Classroom API.

Indeed, there is a feature request for it already:

https://issuetracker.google.com/issues/127591179

I suggest you to give it a star to increase visibility and get updates on the implementation status of the feature.



来源:https://stackoverflow.com/questions/57528327/google-classroom-api-create-material

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!