Skip to content
Snippets Groups Projects
Unverified Commit 364e582f authored by Varsha's avatar Varsha Committed by GitHub
Browse files

feat: redirect to exam on tab (#382)

parent 98ed45f7
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,9 @@ Please See the `releases tab <https://github.com/openedx/xblock-lti-consumer/rel
Unreleased
~~~~~~~~~~
9.5.3 - 2023-06-09
------------------
* Redirect to exam on same LTI proctoring launch tab once ready to start.
* Show a warning in Studio if an LTI 1.1 consumer has an invalid `lti_id`.
9.5.2 - 2023-05-24
......
......@@ -4,6 +4,7 @@ LTI consumer plugin passthrough views
import logging
import urllib
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied, ValidationError
from django.db import transaction
......@@ -835,4 +836,12 @@ def start_proctoring_assessment_endpoint(request):
user_id=request.user.id,
)
return render(request, 'html/lti_start_assessment.html', status=HTTP_200_OK)
context_url = "/".join([settings.LEARNING_MICROFRONTEND_URL, "course",
launch_data.context_id,
launch_data.context_label])
context = {}
context.update({
"context_url": context_url,
})
return render(request, 'html/lti_start_assessment.html', context, status=HTTP_200_OK)
{% load i18n %}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<meta http-equiv="refresh" content="5; url='{{ context_url }}'" >
<title>LTI</title>
</head>
<body>
<p>
<b>{% trans "Sending you back to your exam." %}</b>
</p>
<script>
setTimeout(function () {window.close()}, 5000);
</script>
<p>
<a href="javascript:window.close();">
<a href="{{ context_url }}">
{% trans "Return to exam." %}
</a>
</p>
......
......@@ -85,6 +85,9 @@ class TestLti1p3ProctoringStartProctoringAssessmentEndpoint(TestCase):
config_id=self.lti_config.config_id,
resource_link_id="resource_link_id",
proctoring_launch_data=proctoring_launch_data,
context_id="course-v1:testU+DemoX+Demo_Course",
context_title="http://localhost:2000",
context_label="block-v1:testU+DemoX+Demo_Course+type@sequential+block@1234",
)
self.launch_data_key = get_cache_key(
......@@ -293,4 +296,4 @@ class TestLti1p3ProctoringStartProctoringAssessmentEndpoint(TestCase):
)
self.assertEqual(response.status_code, 200)
self.assertIn('window.close', response.content.decode('utf-8'))
self.assertIn('Return to exam', response.content.decode('utf-8'))
......@@ -28,3 +28,6 @@ DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
# Platform name for LTI 1.1 and 1.3 claims testing
PLATFORM_NAME = "Your platform name here"
# Learning MFE URL for start assessment testing
LEARNING_MICROFRONTEND_URL = 'http://test.learning:2000'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment