Skip to content

The Question model should contain a mandatory field type #11

Description

@ZelenyMartin

Currently we have just a single-choice and multi-choice question and we can handle them without explicit knowledge of what type the question is.

I suggest to distinguish the single-choice and multi-choice question by a field type: single-choice and type: multi-choice. This would be also useful later for some browser-based GUI client where single-choice answer could be sent directly by clicking to the button, but multi-choice will have toggle buttons and a "Send" button for the final answer.

Later I also thought about introducing another question types:

  • open answer with exact match (just an idea)
  • open answer with case insensitive match (just an idea)
  • open answer with regular expression match (just an idea)
  • ordering of options (possible to implement)

Example of ordering question:

name: Quiz with ordering question
questions:
  - text: Order this roman numbers from lowest to highest
    type: ordering  # <--- this is a new field
    time_limit: 30
    options:
      - answer: V
      - answer: L
      - answer: C
      - answer: D

The order of the options list is the correct order, so the quiz-server will shuffle the list before sending it to the clients (the same shuffle for every client).

Every question type will need it's own Pydantic model (perhaps a child of some base question model).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions