|
| 1 | +## README |
| 2 | + |
| 3 | +## Quiz |
| 4 | +### 1. Introduction |
| 5 | +This part of the experiment is specifically for assessment purposes. This allows for the creation of a quiz with multiple choice single answer questions. |
| 6 | +These can be |
| 7 | +* Pretest - Pre requisite quizzes |
| 8 | +* Posttest - Testing the learning |
| 9 | +* Learning Unit Quizzes - Quizzes to test the section's learning. |
| 10 | +The format for the same is discussed below. |
| 11 | + |
| 12 | +### 2. Target Audience |
| 13 | +This guide is meant for anyone creating a virtual lab and wanting to have a quiz section. |
| 14 | + |
| 15 | +### 3. Structure of quiz |
| 16 | +The data for the quiz needs to be added to a json file pertaining the following specifications. |
| 17 | +1. The quiz needs to have an array of objects, each object representing a question. As shown below |
| 18 | +``` |
| 19 | +"questions" : [ |
| 20 | + { |
| 21 | + "question" : "What is 1+2 ?", |
| 22 | + "answers" : |
| 23 | + { |
| 24 | + "a" : 1, |
| 25 | + "b" : 2, |
| 26 | + "c" : 3, |
| 27 | + "d" : 4 |
| 28 | + }, |
| 29 | + "correctAnswer" : c |
| 30 | + } |
| 31 | +] |
| 32 | +``` |
| 33 | +### 4. Quiz V2.0 (Enhancements done) |
| 34 | +The new format of quiz has multiple new additions. The details for which have been described below. |
| 35 | +The format of json would be as linked [here](./pretest.json) |
| 36 | + |
| 37 | +First we will look at the additional fields added |
| 38 | + |
| 39 | +### 4.1 Fields |
| 40 | +* Mandatory Fields |
| 41 | + * [version](#42-version) - Without which the enhanced quiz will not be rendered. |
| 42 | + * [levels](#44-levels) - Adds difficulty level to each question (Allows for filtering) |
| 43 | + |
| 44 | +* Optional Fields |
| 45 | + * [explanations](#43-explanations) - Adds an explanation to each answer. If wrong answer is choosen, only it's explanation pops up. If correct answer is choosen, all available explanations pop up. |
| 46 | + |
| 47 | +### 4.2 Version |
| 48 | +The very first field is absolutely necessary. This ensures that the quiz supports the new features. |
| 49 | +``` |
| 50 | +"version": 2.0 |
| 51 | +``` |
| 52 | + |
| 53 | +### 4.3 Explanations |
| 54 | +Just like we mention answers, we can have a section for explanation so that they show up after an answer is marked. This is optional and can completely be left out. The three ways of defining (Assuming there are 4 answers a, b, c, d): |
| 55 | + |
| 56 | +1. All answers have explanations |
| 57 | +``` |
| 58 | +"explanations": { |
| 59 | + "a" : "Explanation 1, |
| 60 | + "b" : "Explanation 2" |
| 61 | + "c" : "Explanation 3" |
| 62 | + "d" : "Explanation 4" |
| 63 | +}, |
| 64 | +``` |
| 65 | +2. Some answers have explanations |
| 66 | +``` |
| 67 | +"explanations": { |
| 68 | + "a" : "Explanation 1, |
| 69 | + "d" : "Explanation 4" |
| 70 | +}, |
| 71 | +``` |
| 72 | + |
| 73 | +3. No answers have explanations |
| 74 | +``` |
| 75 | +/* Can be excluded from json */ |
| 76 | +``` |
| 77 | + |
| 78 | + |
| 79 | +### 4.4 Levels |
| 80 | +Adds an ability to filter questions based on difficulty levels. This is mandatory and has to be mentioned for each question. |
| 81 | +The three available difficulty levels are: |
| 82 | +``` |
| 83 | +['beginner', 'intermediate', 'advanced'] |
| 84 | +``` |
| 85 | +Using any other will not work. The format for the same: |
| 86 | +``` |
| 87 | +"difficulty" : "beginner" |
| 88 | +``` |
| 89 | + |
| 90 | +### 5. Tips |
| 91 | +1. An extra functionality of explanation is the ability to add an Rich Text (HTML Formatted). It will work just like in html. |
| 92 | +This could be used for |
| 93 | + a. Adding hyper links |
| 94 | + b. Formatting text etc. |
| 95 | +``` |
| 96 | +"explanations": { |
| 97 | + "a" : "Explanation 1 <a href='www.google.com'>here</a>", |
| 98 | + "b" : "Explanation 2" |
| 99 | +}, |
| 100 | +``` |
| 101 | +> This can be done in either of explanation, answer and the question. |
| 102 | +An example for the same can be found here: source | website |
| 103 | + |
| 104 | +2. Multi Correct |
| 105 | +To mimic the functionality of multi correct questions, one can add options as part of the question itself, and the actual answer options can be like : |
| 106 | +``` |
| 107 | + "answers" : |
| 108 | + { |
| 109 | + "a" : "both i and ii", |
| 110 | + "b" : "All i, ii, iii, iv", |
| 111 | + "c" : "Only i", |
| 112 | + "d" : "None of the above" |
| 113 | + } |
| 114 | +``` |
| 115 | +An example for the same can be found here: source | website |
| 116 | + |
| 117 | +### 6. Manual Validation of Quiz Json (wrt version 2.0) |
| 118 | +This is till the automatic validation is set up. |
| 119 | +* The first field has to be version with 2 or 2.0 as value. |
| 120 | +* The questions needs to be an array of objects containing questions. |
| 121 | +* Each question object should hav a question field, answers field, difficulty field and correctAnswer field. |
| 122 | + * question : Should be a string |
| 123 | + * answer : Should be an object containing options, and each option should be a string. |
| 124 | + * difficulty : should be a string and should have values from ["beginner", "intermerdiate", "advanced"] |
| 125 | + * correctAnswer : Should be a string and it's value should be present in keys of one of the answer. |
| 126 | +* If explanation is present it has to be an object and needs to follow the description of answer object. |
| 127 | + |
| 128 | +### 7. Test Cases |
| 129 | +- [x] Using the mentioned quiz format |
| 130 | +- [x] Using the old quiz json format |
| 131 | +- [ ] Not including the version in json |
| 132 | +- [ ] Including incorrect version in json |
| 133 | +- [ ] Including correct version but following old format |
| 134 | +- [x] Difficulty not mentioned |
| 135 | +- [x] Incorrect difficulty level mentioned |
| 136 | +- [x] explanation not provided for all options |
| 137 | +- [x] explanation empty |
| 138 | +- [x] explanation object not defined |
| 139 | +- [x] HTML in quuestion (tags like hyper links, bold etc) |
| 140 | +- [x] HTML in answer (tags like hyper links, bold etc) |
| 141 | +- [x] HTML in explanation (tags like hyper links, bold etc) |
| 142 | +- [x] On wrong annswer only wrong answer is colored red |
| 143 | +- [x] On correct answer all red color resets |
| 144 | +- [x] Combination of filters working properly |
| 145 | +- [x] If all questions have same difficulty, filter option should be hidden. |
| 146 | +- [x] When questions are answered after filtering, marks should be counted out of filtewred questions, not total. |
| 147 | +- [x] On wrong answer only explanation of wrong answer is shown |
| 148 | +- [x] On correct answer all available explanations are shown |
| 149 | + |
| 150 | +### 8. TODO |
| 151 | +* Add automatic schema validation |
| 152 | +* Link to source files implementing the above tips. |
0 commit comments