79 | | At the implementation level, an exercise has three functions: |
80 | | |
81 | | * When invoked with $mode_show set, it shows the exercise. |
82 | | * 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. |
83 | | * 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. |
84 | | |
85 | | Bolt's exercise primitives perform all these functions for you; |
86 | | however, you're free to implement your own exercises. |
| 224 | == Implementation notes == |
| 225 | |
| 226 | At the implementation level, an exercise has three functions: |
| 227 | |
| 228 | * When invoked with $mode_show set, it shows the exercise. |
| 229 | * 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. |
| 230 | * 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. |
| 231 | |
| 232 | Bolt's exercise primitives perform all these functions for you; |
| 233 | however, you're free to implement your own exercises. |
| 234 | |