Enhancement #0000021 - Build Assessment/Quiz/Survey Functionality
The assessment engine will consist of 5 steps:-
1. A user with 'instructor' role can access and modify the questions
2. Following questions types are to be supported initially
Future question types can be
3. When creating a question there should be and option to specify the grade/weightage for each choice.(At present we can fix the grade to be 100%, 50%, 0%).
4. Question should have an optional feedback field which can be shown to the taker of quiz/survey after submitting the quiz.
5. The UI should be intuitive and ajaxfied to provide simple interface to create questions.
6. There should be an option to preview each question individually.
1. Table name - question_types
Stores type of questions. i.e. multi choice, single choice, essay, true/false etc…
| Column_name | type | Description |
|---|---|---|
| id | integer | primary key |
| name | varchar | name of the type that will be shown in UI |
| display_type | varchar | some constant value that will be used in the code to identify the question type and render appropriate UI template e.g. MULTICHOICE, SINGLECHOICE, ESSAY, YESNO etc.. |
| created_at | date_time | created date |
| updated_at | date_time | updated date |
2. Table name - question_groups
There can be a single question with multiple sub questions. In such scenario the main question will be the stored in the question group and sub questions in the questions table.
| Column_name | type | Description |
|---|---|---|
| id | integer | primary key |
| text | text | the text of the question |
| user_id | integer | user to whom the question belongs to |
| created_at | date_time | created date |
| updated_at | date_time | updated date |
3. Table name - questions
This table stores the questions
| Column_name | type | Description |
|---|---|---|
| id | integer | primary key |
| text | text | the text of the question |
| help_text | varchar | the text that can be displayed as help to the user in the UI |
| feedback_text | text | the text that can be displayed when showing the results for the test. |
| question_group_id | integer | foreign key to question_groups table. Can be NULL if the question is a simple question i.e. |
| correct_answer_id | integer | foreign key to the answers table. Id of the answer which is correct one |
| question_type_id | integer | foreign key to the question_types table. Indicates type of question i.e. multi choice, single choice etc… |
| created_at | date_time | created date |
| updated_at | date_time | updated date |
4. Table name - answers
This table stores the answer choices
| Column_name | type | Description |
|---|---|---|
| id | integer | primary key |
| question_id | integer | foreign key to questions able. Indicates question to which the choice belongs to |
| text | text | the text that will be shown in the choice in UI |
| help_text | varchar | the text that can be displayed as help to the user in the UI |
| weight | integer | Indicates the score earned when this answer is selected. This value will be in % age |
| created_at | date_time | created date |
| updated_at | date_time | updated date |
5. Table name - questionnaires
This table stores the information about the quiz/survey
| Column_name | type | Description |
|---|---|---|
| id | integer | primary key |
| user_id | integer | foreign key to users table. Indicates user to whom the questionnaire belongs to |
| questionnaire_type | varchar | Type of questionnaire (quiz or survey) |
| introduction | text | an introductory text that can be displayed when quiz starts |
| title | varchar | title of the questionnaire |
| questions_per_page | integer | number of questions that will displayed on one page |
| attempts_allowed | integer | number of attempts that a user will be allowed to take the quiz/survey |
| state | varchar | indicates the state - draft/published |
| has_time_limit | boolean | whether the quiz is time bared or not |
| time_limit | integer | If the above field is true then this will contain the time value in minutes |
| created_at | date_time | created date |
| updated_at | date_time | updated date |
6. Table name - questionnaire_questions
This table stores the association between the questions and questionnaire.
| Column_name | type | Description |
|---|---|---|
| id | integer | primary key |
| questionnaire_id | integer | foreign key to questionnaires table. |
| question_id | integer | foreign key to questions table |
| display_order | integer | indicates the order of question. this will be used to order the questions in the UI |
| created_at | date_time | created date |
| updated_at | date_time | updated date |
7. Table name - response_sets
This table stores the basic details of the responses. As soon as the user starts taking the quiz an entry will be made in this table. The actual responses will be stored in the responses table.
| Column_name | type | Description |
|---|---|---|
| id | integer | primary key |
| questionnaire_id | integer | foreign key to questionnaires table. |
| user_id | integer | user who had given the response |
| access_code | varchar | access code to identify the response set. This will be random value and unique across the table |
| completed_at | date_time | time when the quiz/survey was completed |
| created_at | date_time | created date |
| updated_at | date_time | updated date |
8. Table name - responses This table stores the actual responses.
| Column_name | type | Description |
|---|---|---|
| id | integer | primary key |
| response_set_id | integer | foreign key to response_sets table. |
| question_id | integer | Id of the question for which the response was created |
| answer_id | integer | Id of the answer for that was selected as a response |
| response_group | integer | In case a question belongs to a question group all the responses should also be grouped logically. This field will be used for grouping. Responses for same question group will have common number here. |
| created_at | date_time | created date |
| updated_at | date_time | updated date |