| 79 | Bolt supplies functions for other types of questions, |
| 80 | such as inclusive multiple-choice and fill-in-the-blank. |
| 81 | An exercise can include multiple questions. |
| 82 | |
| 83 | At the implementation level, an exercise has three functions: |
| 84 | |
| 85 | * When invoked with $mode_show set, it shows the exercise. |
| 86 | * When invoked with $mode_score set, it computes a score based on the responses stored in $_GET, and assigns the score to $score. Its text output, if any, is ignored. |
| 87 | * When invoked with $mode_answer, it shows and "answer sheet" based on the responses stored in $_GET. If the response is correct and no answer sheet is to be shown, it sets $no_answer_sheet. |
| 88 | |
| 89 | Bolt's exercise primitives perform all these functions for you; |
| 90 | however, you're free to implement your own exercises. |
| 91 | |
| 119 | Course items can be grouped into '''sets'''; for example: |
| 120 | |
| 121 | {{{ |
| 122 | { |
| 123 | "type": "set", |
| 124 | "show_n": 1, |
| 125 | "order": "random", |
| 126 | "items": { |
| 127 | { |
| 128 | ... |
| 129 | } |
| 130 | } |
| 131 | } |
| 132 | }}} |
| 133 | |
| 134 | The attributes of a set include: |
| 135 | |
| 136 | * show_n: the number of items in the set to show |
| 137 | * order: whether to show the items sequentially or randomly |
| 138 | |
| 139 | Items (lessons, exercises, and sets) can include '''properties''', e.g.: |
| 140 | |
| 141 | {{{ |
| 142 | { |
| 143 | "type": "lesson", |
| 144 | "name": "The Linnaean hierarchy", |
| 145 | "file": "linnaean.html" |
| 146 | "properties": { |
| 147 | "verbal_level": 12, |
| 148 | "detail_level": 0.8 |
| 149 | } |
| 150 | }, |
| 151 | }}} |
| 152 | |
| 153 | When Bolt has a choice of items (e.g. when it encounters a set from which a |
| 154 | single item is to be shown) it calls, for each item, a course-supplied |
| 155 | '''matchmaking function''', passing to it the student object |
| 156 | (which includes demographics such as age) |
| 157 | and the item's properties (represented as a PHP object). |
| 158 | The matchmaking function returns a number representing the estimated |
| 159 | effectiveness of that item for that student, |
| 160 | and Bolt chooses the item with the highest value. |
| 161 | |