如何在课堂中将topicId添加到作业中

时间:2019-04-10 09:01:01

标签: google-classroom

我正在尝试将topicId添加到分配中,但收到无效的参数错误。理想情况下,我本想以编程方式创建topicIds,但似乎不存在该功能。

Classroom API参考建议该方法可行(我指定的topicId已存在)。

“ topicId
字符串

与本课程相关的主题的标识符。必须与课程中的现有主题匹配。”

function postAssignmentWithTopic() {
// uses my Test Class 1
  var ClassID='36050082095'
  var ClassSource =  {
    title: "My test assignment #2",
    state: "PUBLISHED",
    workType: "ASSIGNMENT",
    topicId: "Section 2"
  };
  Classroom.Courses.CourseWork.create(ClassSource, ClassID)
}

在不包含topicId的情况下,此代码可以正常工作。

0 个答案:

没有答案