cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
m_weintraub
Community Participant

How to upload comments on an assignment submission automatically?

Jump to solution

Hi.  I'm very new to Canvas and the community.  

I have a question based on our existing process, which we've ported into Canvas. 

We have an assignment where the students upload a file, say .xslx or accdb.  We grade the assignment using a google form and then have a script that assembles a report (pdf) that we want to upload in lieu of comments.  We have about 400 students in the course, so manual uploads are painful.  I'm looking for a built in way, either through the GUI or through an API, to do this.

I did read a post about uploading based on the same file name, but that's not going to work here.  I can make the report have the same name, but not the same file type.  So it doesn't seem like this route will work.  

I also saw there is a feature proposal to do something like this.  I don't need a feature if there's an API call I can use.

Any thoughts/insights?

Thanks,

    Mike

1 Solution

Accepted Solutions
James
Community Champion

 @m_weintraub ,

If you are wanting it to show up in DocViewer as their submission, then you're not going to have much luck. You may be able to fake creation an annotated PDF, but this doesn't happen through the API so it's not so easy to do. It took a lot of work just to figure out how to download an annotated submission through the API.

If you can accept uploading the PDF as a submission (assignment) comment, then there is definitely a way to do this. Check out the Grade or comment on multiple submissions endpoint of the Submissions API and the Upload a file endpoint of the Submission Comments API.

You first upload the PDF file and then you attach it to a PUT call to grade or comment on the submission using the comment[file_ids][] array. You can also use the Submissions API endpoint to assign a grade automatically as well. You can even leave a comment "See attached file for more information" or something like that.

There's a single-submission version as well, but the multiple submissions endpoint allows you to save API calls.

Those submissions get processed in the background before they get entered into the system, but my experience is that we're normally talking seconds, not minutes. 

View solution in original post

4 Replies
chofer
Community Coach
Community Coach

Hello  @m_weintraub  Welcome to the Canvas Community.  Thank you for posting your question.  I am not sure of an answer for you.  However, I wanted to let you know that I am going to share your question with the Canvas Developers‌ group here in the Community in hopes that your question will get some additional exposure.  If you are not yet following this group, please use the link that I have provided.  You will see two buttons at the top right corner of the group's page: "Follow" and "Actions".  Click on both of these.  After you click on "Actions", you will need to select "Join group".  I hope this will be of help to you, Michael.  Good luck!

m_weintraub
Community Participant

Thanks, Chris.  I followed your suggestion.  Hopefully someone will have an answer.  

Best,

   Mike

James
Community Champion

 @m_weintraub ,

If you are wanting it to show up in DocViewer as their submission, then you're not going to have much luck. You may be able to fake creation an annotated PDF, but this doesn't happen through the API so it's not so easy to do. It took a lot of work just to figure out how to download an annotated submission through the API.

If you can accept uploading the PDF as a submission (assignment) comment, then there is definitely a way to do this. Check out the Grade or comment on multiple submissions endpoint of the Submissions API and the Upload a file endpoint of the Submission Comments API.

You first upload the PDF file and then you attach it to a PUT call to grade or comment on the submission using the comment[file_ids][] array. You can also use the Submissions API endpoint to assign a grade automatically as well. You can even leave a comment "See attached file for more information" or something like that.

There's a single-submission version as well, but the multiple submissions endpoint allows you to save API calls.

Those submissions get processed in the background before they get entered into the system, but my experience is that we're normally talking seconds, not minutes. 

View solution in original post

m_weintraub
Community Participant

This looks perfect.  James, thanks.  I'll give it a try.  Being able to submit the grade as well is a help.  Students will appreciate it.  I very much appreciate the help!