Rework the single problem grader interface. #2877
Open
+209
−128
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem grader is now always visible for users that have the permission to use it and in the case that they are acting for another user. This does mean that there is no way to open the problem grader when viewing your own problem. However, the problem grader is in a collapse. The state of the collapse is stored in local storage, and whenever you open another problem or change effective users, the collapse goes back to the state that it was in the last time that you had a page open that showed the problem grader.
Correct answers in feedback are now always shown with the reveal button, even when the problem grader is on the page. However, the reveal button is removed by JavaScript behind the scenes while the problem grader is expanded, and put back if the feedback button is not opened while the problem grader is open. So if you open a feedback button while the problem grader is open, the reveal button is not shown, and the correct answer is immediately visible. To summarize the reveal button visibility, the reveal button will not be shown anytime that a feedback button is opened while the problem grader is open, and in that case will never return until the page reloads, but any feedback button that is not opened while the problem grader is open will still show the reveal button, and as usual once the reveal button is used, it will never come back until the page is reloaded.
The problem grader is now below the problem in homework sets as it is in tests. With the collapse and the grader always in the page, I really do not want it above the problem as it currently is.
The original reason for the problem grader being on top was so that it would be close to the old results table with the answers. With that gone, that reason no longer applies.
This is as requested by @Alex-Jordan in #2872, and is an alternate approach to that pull request.
Also remove the code for the
output_hidden_infomethod in theProblem.html.eptemplate. This is because the answer to the question$c->can('output_hidden_info')is$ccan't. There is no such method anywhere in the code anymore.