wiki:BoltImpl

Version 1 (modified by davea, 16 years ago) (diff)

--

Identification of course elements

A course can change over time. Elements (lessons, exercises, sets) may be added, deleted, or reordered.

A student has a "context" in a course - a sequential position, and a set of review items. What if the course changes, and these items change or disappear?

Each element may be given a "logical name". For items, this defaults to the file name.

A user's sequential position is stored in the DB as the logical name or last item viewed. On continuation, Bolt looks up that item.

Implementation notes

At the implementation level, an exercise has three functions:

  • When invoked with $mode_show set, it shows the exercise.
  • 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.
  • 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.

Bolt's exercise primitives perform all these functions for you; however, you're free to implement your own exercises.