🕸️URL Development Guide for External Data Integration

This page explains how to configure and develop external learning materials.

Configuring URL Connection External Resources

Click the "Add Materials" button in the class, then click the URL Connection External Resources button.

  • Material Type: Select Use as Learning Material.

  • External Resource URL: Enter the accessible URL of the developed material. This URL must be accessible from external sources.

  • User Information Transfer: Change to Transfer UID.

After selecting the above options and loading the material, the URL entered in the external resource URL through an iframe. At this time, the URL is set as follows:

https://example.com?extToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…

Scoring Method Using the Grading API

When a user accesses and decodes the extToken passed as a query parameter, the following payload is 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  # Only available in tutoring mode
}

Among the values, when a request is sent to the progress_url as shown below, grading is completed.

  • Method: POST

  • Url: {progress_url}

  • Body

    {
      "score": 100
    }
  • Python code example

    progress_url = decoded_token["progress_url"]
    
    response = requests.post(
        progress_url, 
        json={"score": reqeust.score},
    )

Checking Tutoring Mode

When a user accesses and decodes the extToken passed as a query parameter, the following payload is 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 tutor_user_id exists in the payload, it is in tutoring mode. If it doesn't exist, it is in student mode.

Last updated