Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test with bad group still leads to version creation, except missing data #2669

Open
Alex-Jordan opened this issue Feb 13, 2025 · 1 comment

Comments

@Alex-Jordan
Copy link
Contributor

If you have a test named myTest, where a problem is defined like group:mySet. But suppose there is no set named mySet. You will get an error screen about no problems being available in mySet. (And maybe you would get the same message if mySet exists but has zero problems in it.)

OK, fine. But your user will still get assigned to mySet,v1. And mySet,v1 has been partly created, but not completely. After navigating away from the above error screen, a user can try to go to version 1 of the test. Now they will get a different error message complaining about the set not have a close date. But the real issue is that lots of things about the version were not initialized. The initialization process was aborted midway without cleaning up after itself.

@drgrice1
Copy link
Member

@glarose says:

	# sanity check: if the group set hasn't been defined or doesn't
	# actually contain problems (oops), then we can't very well assign
	# this problem to the user.  we could go on and assign all other
	# problems, but that results in a partial set.  so we die here if
	# this happens.  philosophically we're requiring that the instructor
	# set up the sets correctly or have to deal with the carnage after-
	# wards.  I'm not sure that this is the best long-term solution.
	# FIXME: this means that we may have created a set version that
	# doesn't have any problems.  this is bad.  but it's hard to see
	# where else to deal with it---fixing the problem requires checking
	# at the set version-creation level that all the problems in the
	# set are well defined.  FIXME

That comment was added to the code in 2005 with a commit message of "Gateway update: deal with missing problem groups in gateway tests slightly more gracefully."

drgrice1 added a commit to drgrice1/webwork2 that referenced this issue Feb 13, 2025
…lly.

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.

This is one way to resolve issue openwebwork#2669 and probably the best way without
massively revising the GatewayQuiz module.
drgrice1 added a commit to drgrice1/webwork2 that referenced this issue Feb 18, 2025
…lly.

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.

This is one way to resolve issue openwebwork#2669 and probably the best way without
massively revising the GatewayQuiz module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants