#ToDo
Before starting to develop databases, we need to create the database format.
I think 2 tables are enough.
Exercise table
- ID (INT, UNIQUE, NOT NULL, auto-incremental) => Primary Key
- type (VARCHAR, NOT NULL) => Represents the type of exercise (Linear Algebra, Calculus etc)
- source (VARCHAR, NOT NULL) => Represents the author of the exercise
- exercise (BLOB or TEXT, NOT NULL) => Represents the exercise itself
- is_multiple_choice (BOOL, NOT NULL) => Represents if the exercise is multiple choice
- ID_solution (INT, UNIQUE, NOT NULL) => Foreign Key
Multiple choice table
- ID (INT, UNIQUE, NOT NULL, auto-incremental) => Primary Key
- ID_exercise (INT, UNIQUE, NOT NULL, auto-incremental) => Foreign Key
- options (VARCHAR or TEXT, NOT NULL) => Options to be chosen by the user
Solution table
- ID (INT, UNIQUE, NOT NULL, auto-incremental) => Primary Key
- solution (BLOB or TEXT, NOT NULL) => Solution for the exercise
Explanations
Probably you're asking: "Why the multiple choice table doesn't have some flag saying what is the right answer?". Well, since all the exercises will have a detailed solution, the author will say, in the beggining, what solution is correct.
โ ๏ธWarning โ ๏ธ
Probably, because options
will be a string with all options, some pattern will be developed to parse the options, but that's a back-end problem