Using the Google Classroom API method userProfile, I can get various information about a user, including their name and email address, but not whether they are a student or teacher. How can I determine whether a user is a student or teacher?
标签:
google-classroom
相关问题
- Google Apps Script to turn in, grade, and return a
- How to change course owner using Classroom.Courses
- GSuite - Google Classroom API - List all courses i
- Google Classroom - Programmatically create assignm
- Google Classroom API Create Material
相关文章
- Google Classroom API Create Material
- List more than 30 students in a class in Google Cl
- New Feature - Update Responses
- Copying Images between Google Form quizzes
- Permission denied using Classroom.Courses.CourseWo
- How can I distinguish between students and teacher
- Google Classroom iOS Share Button?
- How to implement OAuth in google classroom
Classroom api dosent provide global role for a teacher or a student its vary from course to course so you can just call student/teacher api after that you will get json output and you find a special permission for teacher "Create Course" it will help you to recognized that the person is teacher.
in case of student this array will be null.
Classroom does have the concept of teachers and students, however the distinction between teachers and students is only meaningful relative to a particular course (it’s possible for a user to be a “teacher” of one course and a “student” of another) and so you might not be able to use these categories to apply access controls in the way you were expecting.
For example, if alice@school.edu is a member of a particular course’s courses.teachers collection, and bob@school.edu is a member of courses.students, then you can use this information to decide that bob@school.edu should not see certain content created by alice@school.edu. (For example, you might not want to show Bob the answers to a quiz that Alice has created on your website, just the questions.)
However, because by default all users can create courses, you probably do not want to show alice@school.edu sensitive information created by teachers of other courses, information intended for teachers that you provide (for example, if you are a textbook publisher), or giving her domain-wide admin features.
If you need to distinguish between “real-world” teachers and students, we recommend that you do this via a mechanism entirely separate from Classroom, such as checking that the user’s email address appears in: