Skip to content

Commit a5a7d9f

Browse files
committed
docs(quiz): documentation for the shared_models app
1 parent 0c0ad23 commit a5a7d9f

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Shared Models App
2+
3+
## Overview and Motivation
4+
The `shared_models` app is designed to hold the models and serializers that need to be used across multiple apps. This is to allow them to all access the same underlying models that don't belong to a single app, rather than having their own versions of these models and accessing each other's at random.
5+
6+
## Models
7+
### Quiz
8+
There are three shared quiz models:
9+
* Question - a model representing a generic quiz question. Questions come in three types (represented by the `question_type` field): multiple choice, numerical answer and short answer.
10+
* Tag - a model representing a generic tag which can be attached to many Questions (and each Question may have many associated Tags). Example Tags would include the subject and unit of study the question pertains to, as well as the topic within that subject/unit. Tags will be able to be created and modified by admins for regular users to use to tag their questions.
11+
* Answer - a model representing an answer associated with a particular Question. Each Question can have multiple associated answers. Each answer can be marked as being correct or incorrect. For the three different types of Question, the intended use of the Answer model varies:
12+
* For multiple choice questions, each Answer will appear as an option for the user taking the quiz to select. One or more Answers will be correct, and the remaining Answers will be incorrect.
13+
* For numerical answer questions, no options will be displayed, and the user must enter a numerical value into a text field. Each of the Answers associated with such a Question should have `is_correct = True`, and if the user's input matches any of these answers, they will be marked correct. Answers which have `is_correct = False` will not do anything and hence **should not be added** to numerical answer questions.
14+
* For short answer questions, the user will be given an extended text field to enter their answer into. Due to the nature of this question, automated marking is not possible, and so the user will have to self-mark their response. Upon submitting their answer, all Answers associated to the Question with `is_correct = True` will be displayed for the user to compare their response to. As with numerical answer questions, Answers with `is_correct = False` will not do anything and hence **should not be added**.
15+
16+
### Statistics
17+
* QuestionResponse - a model representing a response to a Question submitted by a User, stored in the database for statistics purposes. The QuestionResponse model contains all of the necessary data for the following statistics to be surmised, as per the client's requirements:
18+
* How long the User took to complete the Question
19+
* How many Users in total have attempted a given Question
20+
* How many Users have gotten the Question right and how many have gotten it wrong
21+
* The average score (across all Users) for a given Question
22+
* The average score (across all Users) for a given Tag (i.e. subject and topic)
23+
24+
## Serializers
25+
The `shared_models` app provides serializers for each of the above models.
26+

0 commit comments

Comments
 (0)