Add a message to the grade test confirmation dialog when questions are unanswered. #2819
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.
When the "Grade Test" button is clicked, JavaScript parses the
probstatus
inputs and determines what problems are in the test. Then it finds the answer inputs in the page and determines if there are any questions in a problem that are unanswered. If there are any problems with unanswered questions, then a message stating that is added to the confirmation dialog.This is to address the feature request in issue #2813.
Generally, this will work for most answers. However, there are a couple of cases that don't work right. These are cases where answer inputs are non-empty even if a student has not actively entered an answer.
Most notable is the case of an answer to a
draggableProof.pl
ordraggableSubset.pl
question. The JavaScript for those always fills in a non-empty answer as soon as the problem is loaded into the page.Another case is if a problem uses the deprecated
PopUp
method from theparserPopUp.pl
macro or the deprecated methods fromPGchoicemacros.pl
. For example, ifPopUp([ '?', 'a', 'b', 'c' ], 1)
is used. That will have the non-empty value?
for the default answer.Unanswered questions that use the
draggableProof.pl
anddraggableSubset.pl
macros could be determined server side, but the only way to do so would be to process the problem via PG. There were several suggestions in issue #2813 to use a server side set "flag" or have other server queries involved in this. Those really don't help other than in this case, and generally shouldn't be done. We really do not want to have a submission to the server that processes all problems in a test to determine if there are unanswered questions before submitting a test for grading in which all problems will again be processed. There was a suggestion to change the "preview test" button into a "save answers" button, but even that doesn't really help. It would not be reliable, because the information would only be there if the button were used first. There is no guarantee it would be used first, and this needs to have the ability to process the answers regardless.Note that attempting to correctly determine if a question that uses
parserPopUp.pl
orPGchoicemacros.pl
is unanswered cannot even be done by processing the problem. This just adds emphasis that those should not be used anymore.There may be some other cases that have non-empty answers without students actively answering a question, but I can't think of any at this point.
One thing to note is that if a problem has never even been displayed on the page (for example a
draggableProof.pl
problem that is on a page of the test the student never goes to) this approach will work correctly even for the above cases.