Skip to content

Commit

Permalink
Include autograding settings on editing audit event
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospri committed Oct 18, 2024
1 parent 1206448 commit 8b07077
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lms/validation/_lti_launch_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ class ConfigureAssignmentSchema(_CommonLTILaunchSchema):
)

@pre_load
def _decode_auto_grading_config(self, data, **_kwargs):
def _load_auto_grading_config(self, data, **_kwargs):
"""Load auto grading config.
"form" location doesn't accept Nested fields we'll accept the value as json and deserilize it here.
"""
auto_grading_config = data.get("auto_grading_config")

if auto_grading_config and isinstance(auto_grading_config, str):
Expand Down
3 changes: 3 additions & 0 deletions lms/views/lti/basic_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ def edit_assignment_callback(self):
data={
"old_url": assignment.document_url,
"old_group_set_id": assignment.extra.get("group_set_id"),
"old_auto_grading_configuration": assignment.auto_grading_config.asdict()
if assignment.auto_grading_config
else None,
},
)
)
Expand Down
1 change: 1 addition & 0 deletions tests/unit/lms/views/lti/basic_launch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def test_edit_assignment_callback(
data={
"old_url": assignment.document_url,
"old_group_set_id": assignment.extra.get.return_value,
"old_auto_grading_configuration": assignment.auto_grading_config.asdict.return_value,
},
)
pyramid_request.registry.notify.has_call_with(LTIEvent.return_value)
Expand Down

0 comments on commit 8b07077

Please sign in to comment.