πΈοΈ External Material Development Guide for URL Connection
This page describes how to set up and develop external learning materials.
Setting Up URL Connected External Materialsβ
In the class, click the "Add Material" button, then click the URL Connected External Materials button.
After selecting as shown above and loading the material, the address entered in the external material URL will be loaded through an iframe. At this time, the URL is set up as follows.
https://example.com?extToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9β¦
Method for Granting Scores Using the Grading APIβ
By decoding the extToken passed along with the query parameter when the user accesses, the following payload will be obtained.
{
"user_id": 917678,
"uid": null,
"progress_url": "https://api-esp-proxy.elice.io/default/progress/external?token=eyJhbGciOiJIUz...",
"token_nonce": null,
"ts": 1696408550682,
"iss": "elice-api",
"tutor_user_id": 111 # This value is present only in tutoring mode
}
To complete the grading, send a request to progress_url
as described below.
-
Method: POST
-
Url: {progress_url}
-
Body
{
"score": 100
} -
Example Python code
progress_url = decoded_token["progress_url"]
response = requests.post(
progress_url,
json={"score": reqeust.score},
)
How to Check Tutoring Modeβ
By decoding the extToken passed along with the query parameter when the user accesses, the following payload will be obtained.
{
"user_id": 917678,
"uid": null,
"progress_url": "<https://api-esp-proxy.elice.io/default/progress/external?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOm51bGwsInVzZXJfaWQiOjEzMTg5NDA0LCJvcmdhbml6YXRpb25faWQiOjM0ODQsImNvdXJzZV9pZCI6Nzg4MzksImxlY3R1cmVfcGFnZV9pZCI6NzE2NjM2N30.ULsamRseUwE-6gFI5YwQscn4RwAXMBzpWggKKlv1-1o>",
"token_nonce": null,
"ts": 1696408550682,
"iss": "elice-api",
"tutor_user_id": 48374
}
If the tutor_user_id exists in the payload, it means tutoring mode; if it does not exist, it signifies student mode.