Fix an issue on the problem set detail page with user problem versions. (hotfix) #1883
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 where clause was incorrect when obtaining all merged problem versions for a fixed version of a gateway quiz. It was selecting merged problems where the version was allowed to be anything when it should have been selecting only the specified version.
The result of this error is that if you edit a set version for a user (by going to the classlist editor, clicking on the sets for a user, and clicking on a particular test version on that page), then the data that is displayed for that set version is actually a mix of data from multiple versions. Fortunately the data is saved to the correct version, but this leads to very unexpected results in viewing.
To see this in action on the develop branch (or webwork2 2.17) create a gateway quiz with at least two problems and take two versions of the quiz. Then go edit version 2 and change the source_file for problem 2 on that version (choose a source_file name that doesn't exist to make this really evident). Then go edit version 1 of the quiz. You will see the source_file that you just picked displayed for problem 2. If you look in the database you will see that none of the data for version 1 has changed, and the data for version 2 has changed as was intended.
This gets worse with more quiz versions.
This was my mistake when I made all of the database changes in the last release.
This may be a rather dangerous bug, and I would say should be considered for a hotfix.