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

Allow custom challenge order #73

Closed
piglei opened this issue Dec 13, 2023 · 4 comments
Closed

Allow custom challenge order #73

piglei opened this issue Dec 13, 2023 · 4 comments

Comments

@piglei
Copy link
Contributor

piglei commented Dec 13, 2023

Currently the challenges appear in alphabetical order, it would be better if we customize the order by prioritizing the easier challenges to the top. For example, the basic challenges could use this order:

# The basic syntax
- parameter
- return
- variable
- any
- kwargs
# Composite data types
- list
- dict
- tuple
# Other
- typealias
- union
- optional
- final

This would make the experience better as people go through the challenges from top to bottom.

@laike9m
Copy link
Owner

laike9m commented Dec 13, 2023

Agree this can be improved, but not at the cost of extra complexity. It seems that to change the order, we would always need to store it somewhere else, which is a no-go to me.

@piglei
Copy link
Contributor Author

piglei commented Dec 13, 2023

Agree this can be improved, but not at the cost of extra complexity. It seems that to change the order, we would always need to store it somewhere else, which is a no-go to me.

Yes, the order has to be stored somewhere, at least we might need to use flask's project `Config' object. One approach might be this:

  • Introduce a project config variable: challenge_order: List[challenge name].
  • When getting challenges, use the above list as an index.
  • If the challenge is missing from the index, put it to the bottom and use alphabetical order.
  • This means that if challenge_order is empty, the system would work normally as well.

@laike9m
Copy link
Owner

laike9m commented Dec 13, 2023

Thanks for proposing the solution. Though it may change in the future, at this point, I don't think this is something worth adding.

@piglei
Copy link
Contributor Author

piglei commented Dec 13, 2023

OK. I would love to contribute if you change your mind in the future. 😁

@laike9m laike9m closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2023
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

No branches or pull requests

2 participants