|  | 1 | == Identification of course elements == | 
                          |  | 2 |  | 
                          |  | 3 | A course can change over time. | 
                          |  | 4 | Elements (lessons, exercises, sets) may be added, deleted, or reordered. | 
                          |  | 5 |  | 
                          |  | 6 | A student has a "context" in a course - a sequential position, | 
                          |  | 7 | and a set of review items. | 
                          |  | 8 | What if the course changes, and these items change or disappear? | 
                          |  | 9 |  | 
                          |  | 10 | Each element may be given a "logical name". | 
                          |  | 11 | For items, this defaults to the file name. | 
                          |  | 12 |  | 
                          |  | 13 | A user's sequential position is stored in the DB as the logical name | 
                          |  | 14 | or last item viewed. | 
                          |  | 15 | On continuation, Bolt looks up that item. | 
                          |  | 16 |  | 
                          |  | 17 | == Implementation notes == | 
                          |  | 18 |  | 
                          |  | 19 | At the implementation level, an exercise has three functions: | 
                          |  | 20 |  | 
                          |  | 21 | * When invoked with $mode_show set, it shows the exercise. | 
                          |  | 22 | * 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. | 
                          |  | 23 | * 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. | 
                          |  | 24 |  | 
                          |  | 25 | Bolt's exercise primitives perform all these functions for you; | 
                          |  | 26 | however, you're free to implement your own exercises. |