Inserting paragraph break into Assignment Instructions breaks the LTI tool connection for External Tool Assignments

Description

If you have an Assignment which is using the External Tool assignment type, and you add a paragraph break to the Assignment Instructions field, it breaks the LTI tool launch. A single line or single paragraph of instructions seems to be fine. However, if you insert a second paragraph or line break, the LTI tool no longer works, and you get the following message:

External tool has finished with an error: OAuth validation fail key=12345 delta=2 error=Invalid signature ours= cYnnvB6Ne5Y/7X4SsqcefU0171E= yours=i8OLuW5wgM9bqn/FEEAYQ4zGHeI=

You can close this window / tab

(Screenshot of error below)

This is LTI 1.1 only - LTI 1.3 works.

I tested this with an assignment that was set up using Sticky Grader as the LTI tool, and it was working perfectly when I had a single line of text for the instructions. I was able to log in as a student and submit the assignment without any issues.

However, as soon as I edited that assignment to add a second line / paragraph break in the instructions, as shown below, the LTI launch resulted in the error message shown above.

Attachments

3

Activity

Show:

Andrea Schmidt July 29, 2024 at 10:05 PM

Verified on 23x: https://qa23-maria.nightly.sakaiproject.org/, build: df3fb799. Tested both 1.1 and 1.3 to make sure nothing broke with 1.3.

Andrea Schmidt July 21, 2024 at 1:53 PM

Verified on 25x: https://trunk-maria.nightly.sakaiproject.org/, build: 9f7c86fe

Tested both 1.1 and 1.3 to make sure nothing broke with 1.3.

Automation for Jira July 17, 2024 at 10:10 PM

A pull request has been created, "SAK-49988 LTI Assignments - Fix failed launch with multiple lines in description", you can see it at https://github.com/sakaiproject/sakai/pull/12739

Charles R Severance July 17, 2024 at 10:07 PM

In solving this it turned out that the way that HTML input type=”text” works is somewhat undefined for characters like \r and \n - per ChaptGPT:

For <input type="text"> elements, newlines and carriage returns are generally not applicable since these elements are typically used for single-line text input.

So we map these two characters to space, since there is no other reliable serialization pattern when transporting data through HTML forms.

It is ironic that this code is > 10 years old and we ever saw this until now. It is because the description field is rarely used in the real world. Sakai’s assignments do end up with pretty rich content in the description so this is where we ran into it first. Conveniently, when used in the Assignments tool, the RTE gives us HTML so the newlines would be ignored anyways.

Charles R Severance June 21, 2024 at 5:46 PM

- Thanks - I am getting to this one. I want to use it as an example for new developers to work through and fix.

Fixed

Details

Priority

23 Status

QA Verification Pass

22 Status

Please Merge

Components

Assignee

Reporter

Created April 22, 2024 at 3:56 PM
Updated July 29, 2024 at 10:05 PM
Resolved July 20, 2024 at 2:10 PM