获取课堂作业状态

Get classwork status

使用 nodejs(最终反应本机),我正在检索尚未提交的作业。我从课堂作业 API 中得到了输出,但我找不到任何字段告诉您作业的状态(评分、分配、上交等)。是否有一个特定的端点我必须在每个课业上调用才能获得状态?作为参考,这是我得到的输出(id 值已被审查):

{

  courseId: '************',

  id: '****',

  title: 'HTWH Syllabus Acknowledgement Form',

  materials: [Array],

  state: 'PUBLISHED',

  alternateLink: 'https://classroom.google.com/c/.......',

  creationTime: '2020-08-26T22:10:25.522Z',

  updateTime: '2020-08-26T22:15:26.587Z',

  dueDate: [Object],

  dueTime: [Object],

  maxPoints: 5,

  workType: 'ASSIGNMENT',

  submissionModificationMode: 'MODIFIABLE_UNTIL_TURNED_IN',

  creatorUserId: '*******',

  topicId: '********'

}

您使用的 courses.courseWork.get in checking your course work status which will return a CourseWork 实例似乎不包含课程作业的提交状态。

您需要使用 courses.courseWork.studentSubmissions.list if you want to check the submission state of your course work per student. If you want to check a particular student, you can use courses.courseWork.studentSubmissions.get.

这将 return 一个 StudentSubmission instance, which contains a submission stateassignedGrade(如果适用)

响应示例:

示例:我创建了分配给 2 名学生的课程作业,然后使用 courses.courseWork.studentSubmissions.list

检查提交状态
{
  "studentSubmissions": [
    {
      "courseId": "2371163xxxx",
      "courseWorkId": "30629017xxxx",
      "id": "Cg4IwNPyqfMGEK_pxxxxx",
      "userId": "1043405157872289xxxxx",
      "creationTime": "2021-03-22T21:17:51.331Z",
      "updateTime": "2021-03-22T21:17:51.253Z",
      "state": "CREATED",
      "alternateLink": "xxxxxxxxxxxx",
      "courseWorkType": "ASSIGNMENT",
      "assignmentSubmission": {},
      "submissionHistory": [
        {
          ....
        }
      ]
    },
    {
      "courseId": "2371163xxxx",
      "courseWorkId": "30629017xxxx",
      "id": "Cg4I2ujEgvUIEK_pxxxxx",
      "userId": "1112235452378899xxxxx",
      "creationTime": "2021-03-22T21:17:44.380Z",
      "updateTime": "2021-03-22T21:17:44.354Z",
      "state": "CREATED",
      "alternateLink": "xxxxxxxxxxxx",
      "courseWorkType": "ASSIGNMENT",
      "assignmentSubmission": {},
      "submissionHistory": [
        {
          ....
        }
      ]
    }
  ]
}