Google 课堂课程的问题。courseWork.list “field_mask:未知字段掩码值:individual_students_options”
Posted
技术标签:
【中文标题】Google 课堂课程的问题。courseWork.list “field_mask:未知字段掩码值:individual_students_options”【英文标题】:Issue with Google Clas-s-room courses.courseWork.list "field_mask: Unknown field mask values: individual_students_options" 【发布时间】:2021-08-15 19:30:13 【问题描述】:我需要查询 courseWork.list 和 courseWork.get 的部分字段,因此我在文档中描述的字段中传递此值。但是courseWork(individualStudentsOptions)
API 调用返回错误:
"error":
"code": 400,
"message": "field_mask: Unknown field mask values: individual_students_options",
"status": "INVALID_ARGUMENT",
"details": [
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
"field": "field_mask",
"description": "Unknown field mask values: individual_students_options"
]
]
在其他实验中,例如courseWork(id)
一切正常,API 调用返回:
"courseWork": [
"id": "93359557635"
,
"id": "93359557700"
,
...
]
那么请帮我如何填写individualStudentsOptions的字段?
【问题讨论】:
【参考方案1】:你是怎么称呼这个 api 的?
这就是我们在这里的做法:
String studentUser = "student@gmail.com";
IndividualStudentsOptions individualStudentsOptions = new IndividualStudentsOptions();
ArrayList<String> studentIdList = new ArrayList<>();
studentIdList.add(studentUser);
individualStudentsOptions.setStudentIds(studentIdList);
CourseWork courseWork = new CourseWork()
.setCourseId(course.getId())
.setTitle("My course work")
.setDescription("desc")
.setMaxPoints(100.0)
.setDueDate(date)
.setDueTime(timeOfDay)
.setAssigneeMode("INDIVIDUAL_STUDENTS")
.setIndividualStudentsOptions(individualStudentsOptions)
.setWorkType("ASSIGNMENT")
.setState("PUBLISHED");
courseWork = service.courses().courseWork().create(course.getId(), courseWork).execute();
【讨论】:
以上是关于Google 课堂课程的问题。courseWork.list “field_mask:未知字段掩码值:individual_students_options”的主要内容,如果未能解决你的问题,请参考以下文章
在 Google 课堂 API 中使用学生副本发布课程作业时出现内部错误 可能的错误?