cancel
Showing results for 
Search instead for 
Did you mean: 
MikeHowardCTL
Community Member

LTI assignment selection and Submissions api

Hello, I'm in the process to converting our assignments into using an external LTI tool with assignment selection. I'm trying to submit the user's assignment via the Submissions API as an `online_text_entry`, but I keep getting a `"message": "Invalid submission[submission_type] given"` error. I'm sure that the request parameters are correct

 

 

 

 

body: {
      submission: {
        submission_type: 'online_text_entry',
        body: submissionHTML,
        user_id: userID,
      },
    },

 

 

 

 

 
Is submitting this way not supported for assignments created with LTI external applications?
 
Labels (1)
0 Kudos
5 Replies
James
Community Champion

@MikeHowardCTL 

Are you including the Content-Type: application/json header and JSON.stringify your payload before sticking it in the body (if necessary -- some languages may automatically handle this)?

If I do not include the content-type header, then I get the Invalid submission[submission_type] given message. If I include the header, then it works for me.

Yes, the submission is JSON stringified and I'm using the correct content-type header. The code I'm using to send submissions works for assignments that aren't created using the LTI assignment selection placement. 

James
Community Champion

I think I misunderstood the initial post. I initially read this as you had a tool (perhaps launched as a standalone package) and wanted to populate a text entry in Canvas from it, not that the assignment itself was an external tool.

To confirm, is the assignment type an external tool or does it include online text entry? If it is an external tool, then it would make sense that you cannot specify an online text entry for the submission type. Have you tried your post with basic_lti_launch instead?

If the assignment type is an LTI, then you want to take advantage of the LTI Grading Services. Step 7 of the workflow for the Assignment Selection Placement says "After completing the tool-side assignment, tools may optionally return a grade and/or submission. See the Grading documentation for more details."

When you get there, I think you're looking for the Score Extension: Creating submission data section that says "The Score service has been extended to allow an external tool to submission data back to the Canvas Gradebook. This data is then exposed in the Submission Details and Speedgrader Views so that both students and teachers can see what was submitted to the external tool without leaving Canvas. Support for basic urls, text, and LTI links are supported."

Later on, there is an explanation of the Submission Details Return Extension.

So yes, this is an LTI tool.

I currently have a setup running that embeds an exam from a third party service into the rich text editor of a Canvas "online_text_entry" assignment. The third party service then sends the exam submission to our current app, which automatically grades the exam and sends the submission/grade to Canvas using the normal API.

We're currently rebuilding the setup into an LTI assignment selection app to create the assignments. I assumed we could use the same submission logic as the old tool to submit assignments to avoid complexity, as the app has to handle both the old setup and LTI setup as we gradually migrate new courses over to using LTI assignments.

It looks like I'll have to submit the assignments using the LTI Grading service. Thanks for your response!

 

Dusty851
Community Member

Selecting content to add to a variety of locations as LTI deep links: allowing a student to submit attachments to assignments.

 

navyarmyccu