Actually handle failure to find a problem from a grouping set gracefully. #2670
+77
−78
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.
Actually, this handles any failure to generate a new test version gracefully. This wraps the set version assignment call in an
eval
and catches any exceptions that occur in the process including issues from an instructor not setting up grouping sets correctly. If any exceptions do occur the user is shown the usual invalid set screen with a message stating, "Unable to generate a valid test version. This is usually caused by invalid usage of grouping sets or a database error. Please speak to your instructor to fix the error. A system administrator can obtain more details on this error from the logs." The actual exception is logged to the webwork2 application log file (logs/webwork2.log) so an instructor can ask a system administrator for details of the error. Note this does not add to the general webwork2 issue of showing exceptions in the user interface.Edit: I forgot to mention that if a test version is created in the process when an exception occurs, then it is immediately (and quietly) deleted.
This is one way to resolve issue #2669 and probably the best way without massively revising the GatewayQuiz module.