Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTI 1.3 #1023

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

LTI 1.3 #1023

wants to merge 5 commits into from

Conversation

mpiraux
Copy link
Contributor

@mpiraux mpiraux commented Oct 15, 2024

This PR updates the LTI support of INGInious to LTI 1.3, along with a couple of internal changes.

The support of LTI 1.1 is dropped by these changes so all integrations must be updated when integrating this code into running instances.

I'll detail the contributions as they are integrated into the PR.

7a3a4d6 has been tested with a test instance of the syllabus and INGInious with the existing LTI code. I tried submitting code to a task and browsing submissions.

9b1d6e5 updates the basic features (i.e. not the Outcome service) to LTI 1.3. This has been tested with an ongoing patch to the syllabus and saLTIre.

11ebad4 implements the LTI Assignment and Grade service to report grades back to the LTI Platform as a modern replacement to the Outcome service. This has been tested with the test tools of IMS Global as I couldn't configure saLTIre properly so the message carrying the grade could be authenticated by the platform. I suppose IMS Global checks this properly.

262f9fd gives a try at making a clear separation between regular Flask sessions and LTI sessions. Both are still backed by the database. The UserManager becomes the access point to the session now. Tested with the syllabus, saLTIre and IMS Global.

@@ -68,7 +68,7 @@ def _get_signer(self, app):

def open_session(self, app, request):
# Check for cookieless session in the path
path_session = re.match(r"(/@)([a-f0-9A-F_]*)(@)", request.path)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to look into the code for other instances of this kind of check by searching for "/@" . I think I found all of them.

@@ -283,7 +289,7 @@ def flask_internalerror(e):
flask_app.register_error_handler(InternalServerError, flask_internalerror)

# Insert the needed singletons into the application, to allow pages to call them
flask_app.get_homepath = get_homepath
flask_app.get_path = get_path
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_path should now be used in all instances where get_homepath was used to build an URL. Templates still have access to get_homepath when a public URL is needed, such that I didn't have to go thru all that code (esp. layout.html) by hand.

@mpiraux mpiraux force-pushed the lti1.3 branch 4 times, most recently from 3591e25 to 609a552 Compare October 15, 2024 14:40
@mpiraux
Copy link
Contributor Author

mpiraux commented Oct 16, 2024

Looks like the CI is broken btw.

@anthonygego
Copy link
Member

Looks like the CI is broken btw.

Yep, we still have to fix that 😞

inginious/frontend/app.py Outdated Show resolved Hide resolved
""" {name: key} for the LTI customers """
return self._lti_keys if self._is_lti else {}
def lti_config(self):
""" LTI Tool config dictionary. Specs are at https://github.com/dmitry-viskov/pylti1.3/blob/master/README.rst?plain=1#L70-L98 """
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will be documentation part of this PR on this.

setup.py Show resolved Hide resolved
from pylti1p3.launch_data_storage.base import LaunchDataStorage


class MongoLTILaunchDataStorage(LaunchDataStorage):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be used to store only the LTI Launch ID in the user session and retrieve the rest from the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants