github SpiderUnderUrBed flashcard-rs
Hello, I am making a flashcard app with iced, and I am having a big issue with the logic, there are two pathways, either re-do the logic (to a extent) or try and fix the existing one. There are 6 varients of messages that you need to think about, SubmitCard, StartTest, SelectTest, SelectTopic, UpdateTest and UpdateTopic, although I dont know about select topic, here is what each does:
SubmitCard, you are done with writing a flashcard, you want to submit it, so it will be put into a global array called SubmittedCards
SelectTest, you select a topic to test yourself on,
StartTest, supposed to condense all the questions and awnsers associated with all topics that are selected into a single array which it will pass into Popup which is a enum that decides what is rendered in veiw
SelectTopic, you select a topic, and it will add it to the cards or remove it from the cards depending on the state.
Whatever is put in the array configurable_topics, is what you can select to ultimately show up in test. If you look at my code and try to run it, the current issue is, I only want to fix the one issue of it not displaying the correct cards per topic inconsistently, like, if i started a test once, before i create other topics, it works weirdly, everything else I can handle, if I create a topic after creating another topic, then start the test, then the newer question is loaded and the older one is removed, that IS NOT supposed to happen as long as both topics are configured which they are
Anyways, I would like help with my logic. Or to be told whats causing the issue, or ideas for a rework of the 6 relevant enum varients and their corresponding popups. (I would appreciate some code help as ofc its easier to visualize)