You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
As I was browsing through the code, I was looking for a way to comment on an assignment with text and an attachment in one step. I was able to do it in two steps with calls to edit() and upload_comment() separately. Have I missed something? If not would you consider a PR for something that appears to be a small fix? I would then be able to do something like this
submission.upload_comment('myfile.txt', text_comment='Here is my file')
to get
Regards,
Olav
The text was updated successfully, but these errors were encountered:
Lots of weirdness around how uploading files to a submission works.
(see for example ucfopen#496ucfopen#554ucfopen#631).
This isn't really a fix for any of those. This is just a quick hack
to make it work for my use case. At present, a call to
Submission.upload_comment() to upload a file to attach to a comment,
includes an implicit call to Submission.edit() that creates an empty
comment (i.e, no text) on the submission, or, attached the file to any
previous comment.
This doesn't seem to fit with the description in the Canvas API
documentation and is never what you actually want. This change
removes that implicit call to .edit().
To comment on a submission and attache a file, first call
.upload_comment() to upload the file, and then call .edit() including
your comment text, grade etc. as well as the file id returned by
.upload_comment().
Hi
As I was browsing through the code, I was looking for a way to comment on an assignment with text and an attachment in one step. I was able to do it in two steps with calls to edit() and upload_comment() separately. Have I missed something? If not would you consider a PR for something that appears to be a small fix? I would then be able to do something like this
to get
Regards,
Olav
The text was updated successfully, but these errors were encountered: