daniel-lerch / vocup

Vocabulary trainer.
https://www.microsoft.com/p/vocup/9n6w2h3qjqmm
GNU Affero General Public License v3.0
9 stars 3 forks source link

Add an option to question both mother tongue to foreign language and reverse randomly #53

Closed jdelange22 closed 2 months ago

jdelange22 commented 3 months ago

Like the title says. Now you only have the option to translate from mother language to foreign language or the other way around. It would also be nice to have an option to do both options at once. So e.g. from English to French and French to English in the same run, asking words to translate from these options at random. This helps when it is needed to practice words in both directions.

jdelange22 commented 3 months ago

I'm currently implementing en testing this feature for myself. If you're interested let me know.

daniel-lerch commented 3 months ago

That's a great idea. Feel free to make a draft or discuss your architecture ideas here first. I will not merge this draft immediately though because adding another PracticeMode is a breaking change for Vocup's horrible legacy file format.

I have been working on a new file format for a long time already and when I pick up this work again or you're interested in implementing parts of it, we can bring this feature in the upstream version.

jdelange22 commented 3 months ago

Well, the idea I had was simple: add another value to PracticeMode. This is indeed breaking, but only when it's value is set to the new "random" mode and then saved. Opening this book in an older version of Vocup throws an error. Opening older books in the version of Vocup that has support of the new PractiveMode is not an issue as I've seen. Then in the PracticeDialog I used a simple Random to trigger either one of the existing PracticeModes and keep track of this mode value locally instead of referring to the PracticeMode of the book. This was the least breaking method I could think of.

daniel-lerch commented 3 months ago

That's a good idea. A transient third PracticeMode or even a bool to save whether practice direction should be randomly chosen is only one CheckBox for a user to tick and does not require breaking changes. Feel free to create a pull request with that implementation.

On the long run, I would like to be able to save such settings like random practice direction but that's something for the all new file format I have started implementing on the vhf2 branch.

jdelange22 commented 3 months ago

Just to verify: a third option added to PracticeMode is only breaking when the 3rd option is actually being saved in the current file format and afterwards being opened in an older version right? Isn't this to be considered an edge case? In my opinion a third mode is more user friendly then a tickbox that isn't persistant in the vocabulary file when saved while a new PracticeMode value is persistant. Like to hear your thoughts.

daniel-lerch commented 3 months ago

Even though it is an edge case, it is still a breaking change. What we could do, however is to increase the file version counter to 2. Then a third PracticeMode would still be a breaking change but Vocup will show a message that a newer version is required to open this file.

jdelange22 commented 3 months ago

@daniel-lerch true about still being breaking. The file version update is indeed an option to prevent results being deleted if a user opens the file in the older version. I will create a PR when I've added the file version change.

daniel-lerch commented 2 months ago

@jdelange22 Because we are making a breaking file format change anyhow, I decided to implement an entirely new file format based on JSON file inside a ZIP archive. I had started implementing this years ago but also tried to change the data model which were too many changes at once. This time I didn't change the data model and am almost done (see vhf2 branch). Once this is done, I will release all your changes along the new file format as Vocup 2.0.0.

Please let me know whether you are interested in leaving some comments regarding the new data model and its implementation.

jdelange22 commented 2 months ago

@daniel-lerch this is fine. I'll take a look at the changes you made in the vhf2 branch. If in the mean time I'll stumble upon something else I'll let you know.