Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate hidden input existence when saving value in problemgrader.js.
This is the real problem that prevents the functionality of the problem grader and causes issue openwebwork#2215. These hidden inputs not existing for some problems in a test with non-consecutive problems causes a javascript error that prevents the comment from being saved. If the javascript error does not occur then the comment will be saved correctly. To test this create a test with problems 1, 2, 3, and 4, and delete problem 2 (for example). Then submit a version of the test, and open the problem grader in that version. Then go to problem 2 and set the score and add a comment for that problem. With the develop branch you will get the message Error saving score. document.gwquiz.elements[("probstatus" + s.dataset.problemId)] is undefined If you check the database, you will see that the score is saved, but the comment is not. With this branch the score and comment will be successfully saved (and you can verify this in the database). There is still an issue with indexing of the `probstatus` fields in that needs to be resolved. See my comment in openwebwork#2216 which gives an indication of what is involved. I am still investigating what needs to be done to fix this.
- Loading branch information