【问题标题】:Google Classroom Restful API - TurnIn AssignmentsGoogle Classroom Restful API - 上交作业
【发布时间】:2020-01-30 03:54:14
【问题描述】:

我正在尝试使用 Google Classroom 的 Rest 资源 (https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions#StudentSubmission) 来实现学生发布“简单问题”作业的答案(即:仅以字符串作为答案的作业)。

我已经设法使用 Rest 服务列出了学生的课程、课程作业和提交的内容。但是,当使用 Patch 方法 (https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/patch) 尝试更新提交数据时,我发现无法更新学生的答案。

到目前为止,我的补丁调用使用以下正文:

   {
      "courseId": "xxxxxxxx",
      "courseWorkId": "wwwwwwwww",
      "id": "sssssss",
      "userId": "wwwwwwwwwwwwwww",
      "creationTime": "2019-09-30T19:38:59.594Z",
      "updateTime": "2019-09-30T19:38:59.561Z",
      "state": "CREATED",
      "alternateLink": "https://classroom.google.com/c/aaa/sa/aaaa/submissions/student/aaaa",
      "courseWorkType": "SHORT_ANSWER_QUESTION",
      "shortAnswerSubmission": 
      {
         "answer":"Test Answer"
      }
    }

结果是错误 400 - Invalid JSON payload received..

有没有办法实现这一点 - 即:让第三方软件更新学生作业的答案?

提前致谢!

【问题讨论】:

  • 忘了提 - 我正在使用查询字符串 updateMask=shortAnswerSubmission
  • 显然 Patch 是一种仅供教师使用的方法,因此可以分配成绩。浏览了整个互联网,没有人用来更新学生的答案 - 只是设置 DraftGrade 和assignedGrade。然而,由于 API 描述,我仍然不确定是否有使用此服务的方法

标签: json rest google-classroom


【解决方案1】:

确认 Path 是一种仅供教师发布评价的方法。使用 Google Classroom 发送学生数据的唯一方法是使用普通作业通过附件(实际上是他们的链接)。

【讨论】:

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