cancel
Showing results for 
Search instead for 
Did you mean: 
pasquinit
Community Participant

Export assignment comments for course

Jump to solution

Is there a way to export the comments made on assignments? I'm looking for a way to access the feedback that I've given to students throughout the semester for help in composing narrative comments. 

The last time I saw this addressed was back in 2016, so I'm wondering if there is any change.

2 Solutions

Accepted Solutions
Steve_Watts
Community Champion

Hi  @pasquinit 
Are you talking about annotations added to the submitted document itself in the doc viewer, or text comments added using the text box on the righthand side in the Speedgrader? For the text comments, each submission has a "Download submission comments" link. However this involves going to each submission in turn and downloading them one by one, which is obviously not practical when you have a large class. I don't think there is a method to download them in bulk from within the course but you could write some code using the Canvas API that would do it. This requires a bit of programming skill - one of my colleagues created a script that exports comments from a specific assignment as a spreadsheet. Unfortunately he no longer works here so I can't fully explain how his code works but if you look at the documentation for the API it might give you some ideas.

View solution in original post

I'm not really an expert in the API but looking at my colleague's code, it seems to be making this call:
/api/v1/courses/ COURSE_ID /assignments/ ASSIGNMENT_ID /submissions
to get the submissions for a specified assignment, then looping through the data set that's returned to create a table with username, submission date, grade, comment etc for each submission in the data.

The documentation here might be helpful: https://canvas.instructure.com/doc/api/submissions.html 

View solution in original post

10 Replies
Steve_Watts
Community Champion

Hi  @pasquinit 
Are you talking about annotations added to the submitted document itself in the doc viewer, or text comments added using the text box on the righthand side in the Speedgrader? For the text comments, each submission has a "Download submission comments" link. However this involves going to each submission in turn and downloading them one by one, which is obviously not practical when you have a large class. I don't think there is a method to download them in bulk from within the course but you could write some code using the Canvas API that would do it. This requires a bit of programming skill - one of my colleagues created a script that exports comments from a specific assignment as a spreadsheet. Unfortunately he no longer works here so I can't fully explain how his code works but if you look at the documentation for the API it might give you some ideas.

View solution in original post

pasquinit
Community Participant

Thanks for getting back to me.

Yes. I'm thinking about the text comments that appear next to the speedgrader window, and you're right, that process of one-by-one download would be too time consuming to be useful. 

If you have a copy of the API call that produced a spreadsheet for an individual assignment to share, I think that I could probably work on the filter to give me all of the comments for a particular student.

I'm not really an expert in the API but looking at my colleague's code, it seems to be making this call:
/api/v1/courses/ COURSE_ID /assignments/ ASSIGNMENT_ID /submissions
to get the submissions for a specified assignment, then looping through the data set that's returned to create a table with username, submission date, grade, comment etc for each submission in the data.

The documentation here might be helpful: https://canvas.instructure.com/doc/api/submissions.html 

View solution in original post

pasquinit
Community Participant

It sounds like this is what I am hoping to do at the assignment level. Then it would be about looping over all assignment_id within the course to get all comments on all assignments. 

The task after that would come down to sorting the data appropriately as I would like it grouped by student, not by assignment_id.  I don't think that will cause much trouble.

Thank you for sharing.

bsiever
Community Member

Hi Tom,  

I needed to retrieve comments too, so I used the University of Central Florida's Python API (GitHub - ucfopen/canvasapi: Python API wrapper for Instructure's Canvas LMS ).

Here's a link to the script I used: http://siever.info/canvas/GetAllComments.py

To use it you have to:

  1. Install Python and the UCF Python API as described at https://github.com/ucfopen
  2. Get an API key
  3. Edit the script with the URL you use, your course ID, and your API key.
  4. Run the script (For me, "python GetAllComments.py" at a command prompt)
tawnya_means1
Community Member

I need to do something similar, but not for comments. I need to pull the rubric elements along with the score for that element. 

Context: we have the same assignment across multiple terms with different rubrics. For our accreditation data collection, we need to go back through about 30 sections and pull how the students were scored for each element of the particular rubric attached to two different assignments. All this data can be dumped into a spreadsheet which we will then analyze.

I know that Outcomes is the ideal way to do this, but since the assignments were not originally set up this way, I am looking for a more efficient way than having a student worker go through an read each assignment rubric and transfer the scores to a spreadsheet.

I would appreciate any ideas!

Hi Tawnya, 

I suspect that it's possible to use the Python API (described in my post abore) for this as well, but it may be a little trickier than merely extracting comments was.  If you don't feel comfortable trying this (or don't have the time), you may be able to either find a student who has a fair amount of Python programming experience or perhaps someone at your school who does Canvas support. (They may find knowing the Python API to be handy for other needs as well)

  Bill

Thanks Bill!

mikegdye
Community Member

Do you know how to export the output I see in the reminal to a csv file? I got it all to work (thank you!), but I am new to python and linux and scripts. I used the script you shared here: https://community.canvaslms.com/t5/Question-Forum/Export-assignment-comments-for-course/m-p/176457, more specifically, here: http://siever.info/canvas/GetAllComments.py .

 

Thanks for any help - I am using debian buster, python3, pip3