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

Implement way of sending Acos grading results to LTI platform #1166

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

murhum1
Copy link
Contributor

@murhum1 murhum1 commented Mar 16, 2023

Description

This, combined with acos-server/acos-aplus#8, fixes an issue where A+ was unable to send points from ACOS back to the LTI platform when A+ was used as an LTI tool.

Fixes #1154

Testing

What type of test did you run?

  • Accessibility test using the WAVE extension.
  • Django unit tests.
  • Selenium tests.
  • Other test. (Add a description below)
  • Manual testing.

Did you test the changes in

  • Chrome
  • Firefox
  • This pull request cannot be tested in the browser.

Copy link
Contributor

@markkuriekkinen markkuriekkinen left a comment

Choose a reason for hiding this comment

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

Great, thanks! I will add the "fixes #1154" link to the git commit message and merge this pull request.

Short description of the implementation as a reminder:

  • when the A+ front retrieves the exercise description from the exercise service, the HTTP GET request includes an extra parameter lti_launch_id if the user's current session includes LTI parameters from an LTI v1.3 launch (to A+ as the LTI Tool).
  • The Aplus protocol at the Acos server (Add support for A+ LTI acos-server/acos-aplus#8) is modified so that it will store the LTI launch id parameter in the user's browser in a hidden HTML <input> element.
  • Acos server forwards the LTI launch parameter to the A+ front when the exercise submission is sent to the Acos server.
  • When A+ receives the graded submission from the Acos server, A+ stores the LTI launch id in the submission meta_data field. The LTI launch id is then used to send the grade to the LTI Platform.

@@ -52,6 +52,12 @@ def _post_async_submission(request, exercise, submission, errors=None):
submission.feedback = form.cleaned_data["feedback"]
submission.grading_data = post_data

# Acos-submissions initialize this as an empty string for some reason; fix here
Copy link
Contributor

Choose a reason for hiding this comment

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

The Submission.meta_data field uses our old custom JSONField that is simply a normal TextField with some extra JSON parsing. Thus, its default value is an empty string. In the case of Acos exercises, no value is set to the submission.meta_data field before this point. The submission is created here:

submission = Submission.objects.create(exercise=self.exercise)

When the A+ LTI Tool v1.3 feature was added in v1.18,
there was no support yet for the LTI grading of Acos server
assignments. Now, those grades can be sent to the LTI Platform.

Short description of the implementation:

- When the A+ front retrieves the exercise description from
  the exercise service, the HTTP GET request includes an extra
  parameter `lti_launch_id` if the user's current session includes
  LTI parameters from an LTI v1.3 launch (to A+ as the LTI Tool).
- The Aplus protocol at the Acos server
  (acos-server/acos-aplus#8) is modified
  so that it will store the LTI launch id parameter in
  the user's browser in a hidden HTML  `<input>` element.
- Acos server forwards the LTI launch parameter to the A+ front
  when the exercise submission is sent to the Acos server.
- When A+ receives the graded submission from the Acos server,
  A+ stores the LTI launch id in the submission `meta_data` field.
  The LTI launch id is then used to send the grade to
  the LTI Platform.

Fixes apluslms#1154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

LTI Tool v1.3: add LTI grading support for Acos exercises (AJAX submission)
3 participants