Fix achievement issues #2281 and #2279 #2299
Merged
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 achievement item modal dialogs for the 'Use Reward' buttons on the achievements page are generated, instead of just storing a max problem id for each set option, store the json encoded list of problem ids. Initially only the options for the first set are provided. The javascript then rebuilds the options list when a new set is selected that only includes the problem ids for that set.
Make the "Use Reward" button disabled if there are no sets that the achievement item can act one. With a little more effort a message could be shown when the button is clicked instead.
This also restructures the code that obtains the achievement item data from the database to be a bit more efficient. When this data is obtained gateway tests are no longer filtered out. The current code for each achievement item that does not act on gateway tests is already set up to filter these out. The achievement items that do act on gateway tests no longer need to load data from the database on their own. They can use the given list and filter out non-gateway sets.
There seems to have been a minor bug in the
ResurrectGW
achievement in that it showed all gateway sets to be possibly "resurrected" when it should only show gateway sets that are past due. That has also been fixed, so now it only shows past due gateway sets for "resurrection".