Harvard-ATG / hxat

Contains the currently-in-development project by HarvardX to bring the annotation tool currently living in the edX platform to a more accessible LTI implementation.
5 stars 1 forks source link

multisession #90

Closed arthurian closed 7 years ago

arthurian commented 7 years ago

This PR adds support for maintaining session across multiple LTI launches. This will allow a user to launch several instances of the tool and interact with them like they would expect.

Notes:

Usage:

In views that require launch-specific session data (most views in the app), they will use request.LTI instead of request.session. This is a shortcut method for accessing the proper session dictionary. Instead of this:

resource_link_id = request.GET.get('resource_link_id')
is_staff = request.session['LTI_LAUNCH'][resource_link_id]['is_staff']

We can simply do this:

is_staff = request.LTI['is_staff']