kfl / staffeli_nt

Staffeli NT Technology
MIT License
8 stars 7 forks source link

Download submission comments when downloading submissions #49

Closed madsobitsoe closed 2 years ago

madsobitsoe commented 2 years ago

Implements #3 as default.

It could be an optional feature and definitely be improved with more error handling.

(And once again, sorry for the messy PR. I have no idea why github believes I'm "6 commits ahead" and includes already merged commits)

kfl commented 2 years ago

It would be good to document where the comments are dumped.

Also, I'd like the file to have a proper extension (if I read the code correct you are using the filename `comment``?)

What happen if the student hand in a file called comments?

madsobitsoe commented 2 years ago

I'm using the filename submission_comments.txt and dumping them to the same directory as grade.yml etc. So, if user abc123 has written submission comments, they will show up in assdir/abc123/submission_comments.txt.

"comment" is used as a key in the handins[uuid] object(s)/dictionaries.

grab_submission_comments then grabs the date, author and comment for each submission_comment belonging to that submission, and constructs a txt-file where the comments are sorted by date and annotated with name.

If a student hands in a file called comments, nothing will happen. If they hand in a file called submission_comments.txt, I believe it will be overwritten, iff they have written any submission comments in the absalon/canvas webinterface.

kfl commented 2 years ago

Sorry, I was misreading your code.

I would still like if you could add a small comment regarding the name submission_comments.txt somewhere in the README before I merge.

As a general policy, I think we should work hard not to overwrite the students' work. But I'm happy to merge this PR as is, if you then open an issue afterwards stating that we in rare circumstances can overwrite the students' works 😉

madsobitsoe commented 2 years ago

I had a lot of fun dancing with the python type system, but finally managed to jitterbug it into submission.

submission_comments.txt will be renamed submission_comments(n), where n is 1..\infty, until an unused filename is found.

I also added a tiny bit of documentation.

kfl commented 2 years ago

Thanks!