Skip to content

Commit

Permalink
feat: add support for LTI launch refactor in xblock-lti-consumer
Browse files Browse the repository at this point in the history
This commit updates the sample LTI proctoring integration to use the new LTI launch refactor in xblock-lti-consumer (openedx/xblock-lti-consumer#288) and the Proctoring Services implementation (openedx/xblock-lti-consumer#297).

As a reminder, this application currently serves as a mock implementation of the proctoring flow to demonstrate how we might use the xblock-lti-consumer library for proctoring. It is not intended to be deployed as-is or to serve as an actual proctoring flow implementation.

Here is a digest of important changes.

* The launch_proctoring, start_assessment, public_keyset, and access_token views are removed.
* The start_proctoring and end_assessment views are added.
* A signal handler for the LTI_1P3_PROCTORING_ASSESSMENT_STARTED is added.
* The lti AppConfig is modified to support the above signal.
  • Loading branch information
MichaelRoytman committed Nov 17, 2022
1 parent 0ce8e54 commit 31ac0db
Show file tree
Hide file tree
Showing 19 changed files with 120 additions and 442 deletions.
59 changes: 0 additions & 59 deletions edx_exams/apps/lti/api.py

This file was deleted.

6 changes: 6 additions & 0 deletions edx_exams/apps/lti/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@


class LtiConfig(AppConfig):
"""
AppConfig for lti Djangoapp.
"""
default_auto_field = 'django.db.models.BigAutoField'
name = 'edx_exams.apps.lti'

def ready(self):
from edx_exams.apps.lti.signals import handlers # pylint: disable=import-outside-toplevel,unused-import
7 changes: 0 additions & 7 deletions edx_exams/apps/lti/models.py

This file was deleted.

Empty file.
13 changes: 13 additions & 0 deletions edx_exams/apps/lti/signals/handlers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
edX Exams Signal Handlers
"""
from django.dispatch import receiver
from lti_consumer.signals.signals import LTI_1P3_PROCTORING_ASSESSMENT_STARTED


@receiver(LTI_1P3_PROCTORING_ASSESSMENT_STARTED)
def assessment_started(sender, **kwargs): # pylint: disable=unused-argument
"""
Signal handler for the lti_consumer LTI_1P3_PROCTORING_ASSESSMENT_STARTED signal.
"""
print(f"LTI_1P3_PROCTORING_ASSESSMENT_STARTED signal received with kwargs: {kwargs}")
7 changes: 2 additions & 5 deletions edx_exams/apps/lti/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

app_name = 'lti'
urlpatterns = [
path('start_proctoring', views.start_proctoring),
path('authenticate', views.authenticate),
path('start_assessment', views.start_assessment, name='start-assessment'),
path('end_assessment', views.end_assessment),
path('public_keyset', views.public_keyset),
path('end_assessment/<int:attempt_id>', views.end_assessment),
path('start_proctoring/<int:attempt_id>', views.start_proctoring, name='start_proctoring'),
]
11 changes: 11 additions & 0 deletions edx_exams/apps/lti/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""
LTI Utility Functions
"""
from django.conf import settings


def get_lti_root():
if hasattr(settings, 'LTI_ROOT_URL_OVERRIDE'):
return settings.LTI_ROOT_URL_OVERRIDE
else:
return settings.ROOT_URL
Loading

0 comments on commit 31ac0db

Please sign in to comment.