Using Shortcodes to Pause and Resume user learning

Estimated reading time: 1 min

Tin Can State API Shortcodes

What does State API do?

This is a scratch area for Activity Providers on the LRS. It can be used to store user specific data related to specific activities. A perfect example would be bookmark. State API can be used to track which lesson of a course user was last on. It could be in turn used to resume the users session from where he left.

What are the example usage?

1. [set_state activityid="http://www.nextsoftwaresolutions.com/activity/course-01" stateid="bookmark" data="http://www.nextsoftwaresolutions.com/activity/lesson-01" ]: When a user visits the page with this shortcode, it will store the lesson url as the current state of bookmark for the activity.

2. [get_state activityid="http://www.nextsoftwaresolutions.com/activity/course-01" stateid="bookmark"]: This will fetch and display the bookmark url of the course anywhere this shortcode is used.

Example use: Pause and Resume

One can easily add these shortcodes on each training/lesson page of a course. And create a resume button on the Course Page.

Now everytime a user comes back to the course page, he can click on the Resume button and start back where he left.

Was this article helpful?
Dislike 1 2 of 3 found this article helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *

Shopping Cart
Scroll to Top
We are making major changes on payment options & license management. Please, click here to report any issues you face during the purchase.