RoadTripMoustache / kana_to_kanji

Simple application to learn Japanese kana (hiragana, katakana) and kanji
5 stars 1 forks source link

feat: Implement question related models #167

Open apomalyn opened 4 months ago

apomalyn commented 4 months ago

As a developer, I want a shared interface between all format and type of questions

Requirements

Implement the following:

KnowledgeUpdate spec I'm using OpenAPI spec for simplicity. ```yaml KnowledgeUpdate: properties: uid: type: ResourceUid description: Unique identifier of the resource concerned by this update grade: type: integer default: 3 minimum: 0 description: | Grade of the update, represent the facility to remember the correct answer. 3 -> was easy to remember 2 -> failed to remember right away but remembered the second time 1 -> was difficult to remember (2 errors before recognizing it) 0 -> completely forgotten (3 errors) isNew: type: boolean default: false description: Indicate if it's the first time the resource if shown required: - type - uid - grade ```
Question abstract class content I'm using OpenAPI spec for simplicity. ```yaml Question: properties: format: $ref: "#/components/schemas/QuestionFormat" instruction: $ref: "#/components/schemas/InstructionTypes" subject: description: Subject of the question type: string example: - "時" - "じ" - "ji" - "Time" subject_tts: description: String to use for the TTS of the subject. Only available if the subject is in Japanese type: string example: "じ" explanation: type: string description: Optional explanation to display after the question is answered knowledge_updates: type: array minimum: 1 items: $ref: "#/components/schemas/KnowledgeUpdate" skipped: type: boolean description: Indicate if the question was skipped or not default: false required: - format - subject - knowledge_updates ```
TextQuestion abstract class content I'm using OpenAPI spec for simplicity. ```yaml TextQuestion: description: Representation of a text based question allOf: - $ref: "#/components/schemas/Question" - properties: accepted_answers: description: | List of the accepted answers to the question type: array minimum: 1 items: type: string options: description: | List of boxes to build an answer. Those are used if the keyboard isn't available. If the instruction `spell` is passed, the maximum number of elements should be four (4). If `spell_kana` is passed, the options should be bite size meaning only one character by option. type: array items: properties: text: type: string tts: type: string description: Text to use for the TTS of this option required: - text required: - accepted_answers - options ```

What needs to be done

Implement the following:

Dependencies

Child of #160

Depends on: