usaco-guide
usaco-guide copied to clipboard
Searching Problems
Incomplete Features
Note that this list is not necessarily ordered by importance.
- [ ] Dark Mode #4152
- [ ] better mobile support?
- [ ] search by + display division (Bronze - Plat) of the module that contains the problem
- [ ] option to select a random (unsolved) problem from a division
- [ ] save searches + create problemsets
- [ ] add link to user solutions? ex. https://usaco.guide/problems/ys-montmort/user-solutions
- [ ] optimize algolia operations usage? https://github.com/cpinitiative/usaco-guide/issues/86#issuecomment-1873341366
- [ ] properly handle "search by status"? ie. separate search by status and search by name into two separate searching systems if we exceed 1000 problems / Algolia's limit on refinements: https://github.com/cpinitiative/usaco-guide/pull/4157#discussion_r1439093684
from https://github.com/cpinitiative/usaco-guide/issues/86#issuecomment-788536196 (note that this list may be a bit outdated):
okay so here was what I am thinking (am open to changes):
- tags should look a lot nicer. Perhaps we can do something like "category" on the e-commerce demo, or add a searchable list of tags, idk. in general tags UI needs to be improved
- there should be an option to increase the number of hits per page, as well as pagination
- difficulty / module division should be displayed
- should have option to filter by difficulty / module(s)
- should have option to show starred only
- show whether user solved the problem yet
we should also allow users to use problems page to create randomized problemsets to do. this would entail:
- all of the filtering functionality above
- have an option to randomize the problems & hide difficulty / tags / modules
- (far future) save searches / problemsets
Completed Features
- [x] search by + display tags
- [x] search by + display problem name
- [x] search by + display starred
- [x] search by + display source
- [x] search by + display module
- [x] show whether user solved the problem yet
- [x] search by + display difficulty (relative to module) #3320
- [x] option to increase the number of hits per page, as well as pagination #3394
- [x] option to hide difficulty / tags / modules #3394
- [x] edit problem status from search page
How should search mechanic for this work? Two search bars?
or should problems be considered as part of a module? Or should we have a dedicated "Problem Search" page (this is probably easiest)?
both seem fine (something like CSAcademy Archive? https://csacademy.com/contest/archive/)
okay let's do a dedicated page. What properties should they be able to search for?
- problem name
- tags
- has solution
- starred
- difficulty (relative to module)
- source
- ???
maybe search for difficulty only if division where the problem is located is specified
so search by division rather than difficulty? that seems reasonable
both I guess
how do we define "difficulty" though? Our difficulty labels were relative to module...
I think it's still useful to search by that
Before this is implemented, navbar needs to be updated:
- Dashboard
- Sections (a dropdown -> General/Bronze/Silver/Gold/Plat/Advanced)
- Problems List
- Contact Us
- search bar
- login/logout
oops this turned out to be more nontrivial than I thought. navbar is updated but configuring algolia + setting up problem search page may take some time.
https://github.com/thecodingwizard/usaco-guide/tree/feature/problems
Bring out of backlog? :o
oops I'll try to implement this soon but it might take some time now that school started :(
(Maybe I'll make a preliminary version that allows searching by name at least)
Request for searching by source (ex. USACO Plat) + difficulty.
Difficulty is questionable... (Wormhole sort is both easy and insane XD)
Also searching by source is already doable (just type out the source)
Difficulty is questionable... (Wormhole sort is both easy and insane XD)
Taking min difficulty could be okay. Also,
hide solution links on the problems page if the user has tags + solutions off
Hide tags as well?
Request for searching by source (ex. USACO Plat) + difficulty.
O also contest I guess (ex. Open 19)
So like in the problems page what if we had like three filter options, one to search by name, one by tag and one by difficulty, although I think difficulty is pretty relative based on the person.
You should be able to use all three filters at once (see https://react-instantsearch.netlify.app/examples/e-commerce/ or something like that)
I see...
So does each problem have this data (more specifically does each problem have its own tags and difficulty measure?)
- todo: fix updating problem tags
@thecodingwizard Can I get assigned to this?
okay so here was what I am thinking (am open to changes):
- tags should look a lot nicer. Perhaps we can do something like "category" on the e-commerce demo, or add a searchable list of tags, idk. in general tags UI needs to be improved
- there should be an option to increase the number of hits per page, as well as pagination
- difficulty / module division should be displayed
- should have option to filter by difficulty / module(s)
- should have option to show starred only
- show whether user solved the problem yet
we should also allow users to use problems page to create randomized problemsets to do. this would entail:
- all of the filtering functionality above
- have an option to randomize the problems & hide difficulty / tags / modules
- (far future) save searches / problemsets
Is this issue closed already? It seems like problem searching is already available.
no. it's missing features described above :(
Somehow this happened:
I don't think this has ever happened before. We may want to consider optimizing searches / operations usage if this continues to be a problem.
(cc @devo1ution)
oh shoot wait im so sorry...I think each individual refine call got counted as an operation so filtering to not attempted would immediately take ~1000 operations 😭 I've changed it to use setIndexUiState to combine all these operations into 1, so we shouldn't run into this issue in the future.
Sorry!
Also if we have to pay for a temporary upgrade (if thats a thing) I'm completely willing to 😓
Oh that makes sense, thanks for letting me know! Don't worry about it -- mistakes happen and this is totally fine as long as it's not likely to be a recurring issue.
Also if we have to pay for a temporary upgrade (if thats a thing) I'm completely willing to 😓
Thanks very kind of you but you really don't have to (CPI will generally pay for all development costs, including mistakes)! I was trying to see if it's possible to temporarily upgrade the plan, but we're on a legacy open-source plan so I don't even see the option to pay for more usage at the moment :p