Closed moui72 closed 7 years ago
To consider:
perhaps replies should also be deletable by their authors and by the relevant faculty.
also, questions with no replies should maybe be deletable by their authors, and questions in general should likely be deletable by the relevant faculty
I started thinking about implementing this, but I don't think it can move forward without design. A couple of thoughts:
I can't add labels, but this should probably have needs-design
Yes. Added. I'll also see if I can grant you more access to the repo.
Sorry for the delay on this - it was a lot of work. But the first pass is up and ready to test on openlabdev.org/webwork-playground. (Jenna's comp, for reference: https://www.dropbox.com/s/v1yosvl4yozxwal/OLWW_LAYOUT_PROBLEMPOSTV4-EDITQuestion.png?dl=0)
so far edit functionality seems good, but I noticed an issue with the 'delete' button: when I edit a reply and then click 'delete' it will render the question without ANY replies. a page refresh restores them, though. I am assuming this has to do with the ajax request after delete not returning the list of replies and then populating the DOM with nothing.
@moui72 Good find, and thanks for the detailed report. Looks like I messed up the routine that marks the reply as being removed (in the client) after deletion (from the server). This should now be fixed.
perfect!
one thing I noticed, but this may be more of something to @jspevack to consider, is that you can have several responses in "edit mode" at a time -- but, functionality is properly localized/contextualized, so there is no behavior issues.
do we like this as is or do we want other edits to "close" when another is "opened"?
what do you think, @bree-z
I was trying to test out @moui72 's observation and have found that none of my edits save properly.
I've tried while logged in as Test Student and Test Faculty, and have tried editing my own questions and other users' questions. Here's what happens:
I click edit, make some edits, and click save. The button says "Saving," but my edits don't appear. If I click "Edit" again, they're there. If I reload, I still don't see them and if I click edit after reloading, they're not not there.
I'm seeing the same thing in Firefox (54.0.1) and Chrome (60.0.3112.78) on OS X 10.12.5.
While editing the question (logged in as Test Faculty):
After clicking Save:
Thanks for the screenshots. Looking at the JS console, I see that the server is returning a 403 Forbidden.
In the case of questions, WordPress is doing something odd with user permissions. I've overridden them with some custom logic.
In the case of responses, the permission check I'd written validated against question authorship. I'm unsure why I originally did this. It seems correct that the response author ought to be able to edit an item, not the question author. Right?
(ready to test on openlabdev.org)
Thanks, Boone! This looks good to me.
And re response permission checks, I agree that a response author should be the one who can edit a response.
Thanks @bree-z for catching what I missed. I was logged in as super user and not thinking about permissions.
I think this is all set
Thank you both!
I realize that this is likely a feature that is already in the pipeline, and that it may be something that we don't have time to implement for the current version, but I just thought I'd make an issue so we don't forget about it.
I'd imagine that questions and replies should be editable both by their authors and by the relevant faculty