Skip to content

Commit

Permalink
Keep record of the grading service URL relevant for this assignment o…
Browse files Browse the repository at this point in the history
…n every launch
  • Loading branch information
marcospri committed Sep 4, 2024
1 parent 47a4f62 commit aab8710
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions lms/services/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ def get_assignment_for_launch(self, request, course: Course) -> Assignment | Non
"https://purl.imsglobal.org/spec/lti/claim/resource_link", {}
).get("id")

# Keep record of the grading service URL relevant for this assignment if available
assignment.lis_outcome_service_url = request.lti_params.get(
"lis_outcome_service_url"
)

# Always update the assignment configuration
# It often will be the same one while launching the assignment again but
# it might for example be an updated deep linked URL or similar.
Expand Down
1 change: 1 addition & 0 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def lti_v11_params():
"lis_person_name_family": "TEST_FAMILY_NAME",
"lis_person_name_full": "TEST_FULL_NAME",
"lis_person_contact_email_primary": "EMAIL",
"lis_outcome_service_url": "GRADING URL",
"lti_message_type": "basic-lti-launch-request",
"context_id": "DUMMY-CONTEXT-ID",
"context_title": "A context title",
Expand Down
5 changes: 1 addition & 4 deletions tests/unit/lms/services/assignment_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,7 @@ def test_get_assignment_for_launch_existing(
)
assert assignment.is_gradable == misc_plugin.is_assignment_gradable.return_value
assert assignment.course_id == course.id
assert (
assignment.lti_v13_resource_link_id
== pyramid_request.lti_params.v13.get("")
)
assert assignment.lis_outcome_service_url == "GRADING URL"

def test_get_assignment_for_launch_set_v13_context_id(
self, lti_v13_pyramid_request, svc, course
Expand Down

0 comments on commit aab8710

Please sign in to comment.