kfl / staffeli_nt

Staffeli NT Technology
MIT License
8 stars 8 forks source link

Feedback to group assignments should be treated correctly #30

Open kfl opened 3 years ago

kfl commented 3 years ago

Currently the feedback to group assignments is hard to find in the web interface for the students.

We should make sure that upload{,_single}.py gives the feedback in a correct manner. For instance by setting the group_comment parameter to true for feedback to group submissions.

madsobitsoe commented 2 years ago

This page: https://canvas.instructure.com/doc/api/submissions.html#method.submissions_api.update Says

Whether or not this comment should be sent to the entire group (defaults to false). Ignored if this is not a group assignment or if no text_comment is provided.

If I'm reading this correct, it is safe to set the group_comment parameter for all submissions. It will be ignored if the submission is individual.

I am a bit hesitant to test it, since working on live data is a pretty risky strategy, but in theory the fix should be easy.

// Edit It might be a bit more complicated.

We use the canvas-api python package documented here: https://canvasapi.readthedocs.io/en/stable/submission-ref.html

Our current code has two calls: submission.upload_comment("feedback.txt") , which uses this part of the API: https://canvas.instructure.com/doc/api/submissions.html#method.submissions_api.create_file We then use submission.edit(submission=('posted_grade' : grade) to actually set the posted grade on the assignment. submission.edit uses the submissions_api.update, i.e. the first link in this issue-comment.

We might have to attach a text_comment as well as setting group_comment=True, in order for Canvas not to ignore the group_comment parameter.

madsobitsoe commented 2 years ago

i looked into it a bit more. The upload_comment function calls the edit function on succesful upload, to attach the file to a comment. upload_comment does not pass **kwargs to edit, so it's not possible to set the group_comment parameter.

https://github.com/ucfopen/canvasapi/blob/2ac9979d17979932a3f43eb8737b7648566c1c68/canvasapi/submission.py#L147

I have created an issue on the canvasapi github. Meanwhile I think our best option to solve this issue is to either fork canvas-api or roll-our-own upload_file_and_attacht_to_comment function.