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

Fix achievement issues #2281 and #2279 #2299

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

drgrice1
Copy link
Member

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

@drgrice1 drgrice1 force-pushed the achievement-item-problem-ids branch from b0071ec to 0ea994d Compare January 16, 2024 14:42
@drgrice1 drgrice1 force-pushed the achievement-item-problem-ids branch from 0ea994d to 7af4c8e Compare January 24, 2024 22:21
@pstaabp
Copy link
Member

pstaabp commented Jan 25, 2024

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

Copy link
Member

@pstaabp pstaabp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes the issues.

Instead of just storing a max problem id for each achievement 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.

This also restructures the way that achievement item data is obtained
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".

This fixes issue openwebwork#2281.
… button.

This fixes issue openwebwork#2279.

For now this just makes 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.
@drgrice1 drgrice1 force-pushed the achievement-item-problem-ids branch from 7af4c8e to 833a81e Compare February 2, 2024 20:46
@pstaabp pstaabp merged commit e1c4a15 into openwebwork:develop Feb 7, 2024
1 check passed
@drgrice1 drgrice1 deleted the achievement-item-problem-ids branch February 7, 2024 21:50
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

Successfully merging this pull request may close these issues.

3 participants