The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December.
Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
Hello.
I'm trying to send the grade and a file back from LTI 1.3 to canvas. The grade is successfully being updated but the file isn't being shown. There is no file attachment and its "No preview available" in the speedgrader for teacher.
I'm using ltijs library..please check the code- it's "/grade" demo endpoint which sends score to canvas..
Hi @EklavyaAGARWAL,
It looks like the problem is in gradeObj. You've set the field name as https://canvas.instructure.com/lti/submission[content_items], though if I'm reading the examples in the AGS documentation correctly, content_items should be embedded in the https://canvas.instructure.com/lti/submission property:
const gradeObj = {
"userId": idtoken.user,
"scoreGiven": score,
"scoreMaximum": 100,
"activityProgress": 'Completed',
"gradingProgress": 'FullyGraded',
'https://canvas.instructure.com/lti/submission': {
"content_items": [
{
"type": "file",
"url": "https://portland-my.sharepoint.com/:b:/g/personal/eagarwal2-c_my_cityu_edu_hk/EVxBtqL4iNVDsIr_lBQAGI...",
"title": "Submission File",
"media_type": "application/pdf"
}
]
}
}
I hope this helps!
Thanks for your reply. I did that change and still it doesn't send the file back to the canvas production server.
Here is my simple code - server.zip
I'd be grateful if you could look into this!
Is there any other way to attach pdf to a student's submission without using the score API?
I fixed it. Seems like the location where the pdf was uploaded required some permissions. I used this https://www.lionkingeducation.co.uk/pdfs/Synopsis.pdf and it worked.
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in