iafisher / drill

Spaced-repetition quizzes on the command line
MIT License
2 stars 0 forks source link

Optional ID numbers for dependencies #5

Closed iafisher closed 5 years ago

iafisher commented 5 years ago

The idea is you could have

{
    "id": "france-capital",
    "text": "What is the capital of France?",
    "answer": "Paris"
},
...
{
    "text": "What world-famous Gothic cathedral is located on the Île de la Cité in Paris?"
    "answer": "Notre Dame",
    "depends": ["france-capital"]
},

so that some questions must be asked before others.

iafisher commented 5 years ago

In general dependency resolution can be solved with topological sorting, which might be annoying to implement in practice. However, if I apply certain restrictions, e.g. not allowing transitive dependencies (so if A depends on B then nothing can depend on A nor can B depend on anything), then I think that dependency resolution is as simple as swapping out-of-order questions.