• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Switch User Type

New Here ,
Jul 23, 2018 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

524

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Beginner , Aug 02, 2018 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=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 ca

...

Votes

Translate

Translate
Community Beginner ,
Aug 02, 2018 Aug 02, 2018

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources