Google课堂 - 获取课程的文件夹ID

时间:2016-10-18 02:33:35

标签: php string google-drive-api google-docs-api google-classroom

我很难确定如何检索与特定课程(ID)相关联的Google云端硬盘文件夹。

我的理解是这个值可以作为teacherFolder值:

见这里: https://developers.google.com/classroom/reference/rest/v1/courses

"id": string,
"name": string,
"section": string,
"descriptionHeading": string,
"description": string,
"room": string,
"ownerId": string,
"creationTime": string,
"updateTime": string,
"enrollmentCode": string,
"courseState": enum(CourseState),
"alternateLink": string,
"teacherGroupEmail": string,
"courseGroupEmail": string,
"teacherFolder": {
  object(DriveFolder)
},

但这是作为包含以下内容的对象返回的:

{
  "id": string,
  "title": string,
  "alternateLink": string,
}

我正在尝试将Google云端硬盘文件夹与Google课堂中的课程相关联(按课程ID),以便我可以将资源上传到相应的文件夹。

请指出正确的方向。

(我希望通过php实现这一点。)

1 个答案:

答案 0 :(得分:0)

基于documentation

资源:课程

{
"id": string,
"name": string,
"section": string,
"descriptionHeading": string,
"description": string,
"room": string,
"ownerId": string,
"creationTime": string,
"updateTime": string,
"enrollmentCode": string,
"courseState": enum(CourseState),
"alternateLink": string,
"teacherGroupEmail": string,
"courseGroupEmail": string,
"teacherFolder": {
object(DriveFolder)
},
"courseMaterialSets": [
{
object(CourseMaterialSet)
}
],
"guardiansEnabled": boolean,
}

您可以查看包含课程所有相关学分的CourseMaterialSet属性。

CourseMaterialSet

  

课程“关于”页面上显示的一组资料。这些材料可能包括课程大纲,时间表或与课程整体相关的其他背景信息。

{
"title": string,
"materials": [
{
object(CourseMaterial)
}
],
}

CourseMaterial

  

作为材料集的一部分附加到课程的材料。

{

// Union field material can be only one of the following:
"driveFile": {
object(DriveFile)
},
"youTubeVideo": {
object(YouTubeVideo)
},
"link": {
object(Link)
},
"form": {
object(Form)
},
// End of list of possible types for union field material.
}

希望这有帮助。