硬编码示例值可能导致创建错误课程并邀请非预期收件人
原文依据:3 处可执行步骤直接使用固定课程资料和 `student@school.edu`,没有要求先用用户确认的课程 ID、课程属性和学生地址替换这些值,也没有在外部写入前设置确认点。
如果代理把命令当作可直接执行的指令,当前 Google Classroom 账号可能出现非预期课程,并向错误地址发送邀请;收件人可能获知课程存在,并在接受邀请后取得学生访问权限。
这是面向执行的步骤,而非警告或测试。第 24 行可在当前授权账号下直接创建名为“Introduction to CS”的课程;若代理照抄,示例属性会成为真实数据。第 25 行还要求发送学生邀请,但 `COURSE_ID` 和邮箱明显是待替换占位值,因此邀请通常会失败;若这些值碰巧有效,则可能写入错误课程或联系非预期账号。来源没有要求在创建或邀请前展示最终值并取得用户确认。用户可要求作者强制替换并确认课程属性、课程 ID 和收件人后再执行。
1. Create the course: `gws classroom courses create --json '{"name": "Introduction to CS", "section": "Period 1", "room": "Room 101", "ownerId": "me"}'`2. Invite a student: `gws classroom invitations create --json '{"courseId": "COURSE_ID", "userId": "student@school.edu", "role": "STUDENT"}'`3. List enrolled students: `gws classroom courses students list --params '{"courseId": "COURSE_ID"}' --format table`查看另外 2 个位置
Create a Google Classroom course and invite students.1. Create the course: `gws classroom courses create --json '{"name": "Introduction to CS", "section": "Period 1", "room": "Room 101", "ownerId": "me"}'`2. Invite a student: `gws classroom invitations create --json '{"courseId": "COURSE_ID", "userId": "student@school.edu", "role": "STUDENT"}'`3. List enrolled students: `gws classroom courses students list --params '{"courseId": "COURSE_ID"}' --format table`