fraz3alpha / running-challenges

An extension to allow you to complete challenges with your parkrun results
Other
36 stars 20 forks source link

Hide non-relevant challenges #93

Closed fraz3alpha closed 1 year ago

fraz3alpha commented 6 years ago

I was sure we already had this issue, but maybe it was only in our heads

There are many users outside of the UK for whom the 'Full Ponty' badge is not likely to be ever attempted - the Bushy Pilgramage may be, but we are stuck adding more non-UK country specific challenges until we have a way to hide the ones that aren't interesting/achievable to a given user.

Perhaps we could have a core set that are always shown, and then by default add in the user's country-specific set. You could always opt-in to including the others if you do a lot of international tourism, or live in two places and therefore run at lots of different events.

Each challenge would therefore need additional data including:

Additional options would be required to:

rboyatt commented 6 years ago

I've been thinking about how to add a 'localise challenges' option. Here's what I've been thinking of so far:

  1. Adding a new option that has three options 'All challenges', 'Specify challenges' and 'Customise according to my home parkrun'.
  2. A new challenges data structure in challenges.js holding reference to challenge function & associated data (i.e. decoupling definition of challenges from execution of challenge functions).
  3. Addition of new country data for each challenge.
  4. Modifying options.js to read list of challenges from that data structure and, if 'specify challenges' is selected then allowing user to enable/disable each one.
  5. Modification of generate_running_challenge_data to process that data structure and actually call the challenge functions (based on all/specify/customise choices as above).

I've started this in branch wip-localise-challenges in my fork.