openwebwork / webwork2

Course management front end for WeBWorK
http://webwork.maa.org/wiki/Main_Page
Other
143 stars 165 forks source link

Fix achievement issues #2281 and #2279 #2299

Closed drgrice1 closed 7 months ago

drgrice1 commented 7 months ago

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".

pstaabp commented 7 months ago

Just so things link, this fixes #2279 and #2281