【问题标题】:Google Classroom - Get Folder ID for CourseGoogle 课堂 - 获取课程的文件夹 ID
【发布时间】:2016-10-18 02:33:35
【问题描述】:

我很难弄清楚如何检索与特定课程 (ID) 关联的 Google Drive 文件夹。

我的理解是这个值可以作为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 Classroom 中的课程相关联的 Google Drive 文件夹(通过课程 ID),以便我可以将资源上传到相应的文件夹。

请指点我正确的方向。

(我希望通过 php 来实现。)

【问题讨论】:

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


    【解决方案1】:

    来自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 属性,该属性包含课程的所有相关材料。

    课程材料集

    出现在课程“关于”页面上的一组材料。这些材料可能包括与整个课程相关的教学大纲、时间表或其他背景信息。

    {
    "title": string,
    "materials": [
    {
    object(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.
    }
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多