dmitry-viskov / pylti1.3

LTI 1.3 Advantage Tool
MIT License
120 stars 64 forks source link

How to get the role from launch data #145

Open rsajja79 opened 1 month ago

rsajja79 commented 1 month ago

I can see the launch data. and i has the name, email, etc. I want to see if the launch is initiated by an Instructor or a student. How can I get this information?

I see a field called "roles", but it doesnt specify the role of the launch requestor. what data should i be looking at?

hmoffatt commented 1 month ago

Role is the correct field. What do you see if not the role of the launcher?

rsajja79 commented 1 month ago

'https://purl.imsglobal.org/spec/lti/claim/roles': ['http://purl.imsglobal.org/vocab/lis/v2/institution/person#Instructor', 'http://purl.imsglobal.org/vocab/lis/v2/institution/person#Student', 'http://purl.imsglobal.org/vocab/lis/v2/membership#Instructor', 'http://purl.imsglobal.org/vocab/lis/v2/system/person#User']

this is the only "roles" data that is in the launch_data. There is no "role" field in the launch_data. This launch_data I'm getting it from launch_data = message_launch.get_launch_data() print(launch_data)

hmoffatt commented 1 month ago

Yes that is the field you are looking for