Skip to content

Commit

Permalink
Merge pull request #65 from Learnosity/LRN-39611/feature/hmac-signatu…
Browse files Browse the repository at this point in the history
…re-api-demo

 [Feature] Initialize question api and adding hmac256 to hash functio…
  • Loading branch information
bhavya-shukla-lrn authored Jun 28, 2023
2 parents 148f369 + 2797a8d commit c7fe09d
Show file tree
Hide file tree
Showing 7 changed files with 469 additions and 67 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [v0.3.3] - 2023-06-28
### Security
- Upgraded signature to match the security standard.

### Security
- Update dependencies

Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ Note: after installation, run this command in the SDK root folder:

pip install .

Then, if you're following the tutorial on this page, also run:

pip install .[quickstart]

### **Alternative 2: development install from a git clone**
To install from the terminal, run the following command:

Expand All @@ -92,10 +88,6 @@ To set up up your local development environment, use the following:
source .venv/learnosity-sdk-python/bin/activate
pip install -e .

Then, if you're following the tutorial on this page, also run:

pip install -e .[quickstart]

Note that these manual installation methods are for development and testing only.
For production use, you should install the SDK using the Pip package manager for Python, as described above.

Expand All @@ -115,7 +107,19 @@ From this point on, we'll assume that your web server is available at this local

http://localhost:8000/

Open this page with your web browser. This is a basic example of an assessment loaded into a web page with Learnosity's assessment player. You can interact with this demo assessment to try out the various Question types.
You can now access the APIs using the following URL [click here](http://localhost:8000).

<img width="50%" height="50%" src="docs/images/image-quickstart-index.png">

Following are the routes to access our APIs.

* Author API : http://localhost:8000/authorapi
* Questions API : http://localhost:8000/questionsapi
* Items API : http://localhost:8000/itemsapi
* Reports API : http://localhost:8000/reportsapi
* Question Editor API : http://localhost:8000/questioneditorapi

Open these pages with your web browser. These are all basic examples of Learnosity's integration. You can interact with these demo pages to try out the various APIs. The Items API example is a basic example of an assessment loaded into a web page with Learnosity's assessment player. You can interact with this demo assessment to try out the various Question types.

<img width="50%" height="50%" src="docs/images/image-quickstart-examples-assessment.png">

Expand Down Expand Up @@ -225,7 +229,7 @@ The following example HTML/Jinja template can be found near the bottom of the [s
<!-- Items API will render the assessment app into this div. -->
<div id="learnosity_assess"></div>
<!-- Load the Items API library. -->
<script src=\"https://items.learnosity.com/?v2021.2.LTS/\"></script>
<script src=\"https://items.learnosity.com/?latest-lts/\"></script>
<!-- Initiate Items API assessment rendering, using the signed parameters. -->
<script>
var itemsApp = LearnosityItems.init( {{ generated_request }} );
Expand All @@ -238,7 +242,7 @@ The following example HTML/Jinja template can be found near the bottom of the [s
The important parts to be aware of in this HTML are:

* A div with `id="learnosity_assess"`. This is where the Learnosity assessment player will be rendered to deliver the assessment.
* The `<script src="https://items.learnosity.com/?v2021.2.LTS"></script>` tag, which includes Learnosity's Items API on the page and makes the global `LearnosityItems` object available. The version specified as `v2021.2.LTS` will retrieve that specific [Long Term Support (LTS) version](https://help.learnosity.com/hc/en-us/articles/360001268538-Release-Cadence-and-Version-Lifecycle). In production, you should always pin to a specific LTS version to ensure version compatibility.
* The `<script src="https://items.learnosity.com/?latest-lts"></script>` tag, which includes Learnosity's Items API on the page and makes the global `LearnosityItems` object available. The version specified as `latest-lts` will retrieve the latest version supported. To know more about switching to specific LTS version visit [Long Term Support (LTS) version](https://help.learnosity.com/hc/en-us/articles/360001268538-Release-Cadence-and-Version-Lifecycle). In production, you should always pin to a specific LTS version to ensure version compatibility.
* The call to `LearnosityItems.init()`, which initiates Items API to inject the assessment player into the page.
* The variable `{{generated_request}}` dynamically sends the contents of our init options to JavaScript, so it can be passed to `init()`.

Expand Down
Binary file added docs/images/image-quickstart-index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c7fe09d

Please sign in to comment.