Switch User Type

New Here ,
Jul 23, 2018

Copy link to clipboard

Copied

Is there an easy way to switch between learner and admin scope via the API?

Unfortunately, loResourceGrades/{id} is only offered as a learner-level operation and cannot be accessed by an admin user. Get /users/{id}/enrollments is only available to admins. Therefore, I have to log in as an admin to get a list of enrollments for a learner, then log in as a learner to get completion status for each module. Finally, I would need to log back in as an admin to mark a module as complete. It would be great to be able to do everything as one user without having to switch scopes back-and-forth.

Any ideas would be great. Thank you for any help!

TOPICS
Course instances, Course settings

Views

385

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

1 Correct Answer

Community Beginner , Aug 02, 2018
PRO_SOL Community Beginner , Aug 02, 2018
There is no need to switch between Learner and Admin Scope. If client needs to check loResourceGrade information in admin scope, what he just needs to do is to invoke the below api:GET /users/{id}/enrollments?include=loResourceGradesThe above api response includes loResourceGrades corresponding to courses enrolled.enrollment model has one of its relationship as loResourceGrades that's why loResourceGrades is included in the above enrollment endpoint. In General whichever comes in relationship ca...

Likes

Translate

Translate
Jump to answer Jump to answer
Community Beginner ,
Aug 02, 2018

Copy link to clipboard

Copied

There is no need to switch between Learner and Admin Scope.
If client needs to check loResourceGrade information in admin scope, what he just needs to do is to invoke the below api:
GET /users/{id}/enrollments?include=loResourceGrades
The above api response includes loResourceGrades corresponding to courses enrolled.
enrollment model has one of its relationship as loResourceGrades that's why loResourceGrades is included in the above enrollment endpoint. In General whichever comes in relationship can be included as above.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more