= Bolt reference manual = A Bolt course consists of: * '''Lessons''': any web-based teaching material * '''Exercises''', used for reinforcement and/or assessment. * A '''course document''' describing the order in which lessons and exercises are shown. == Lessons == A '''Lesson''' contains instructional material. It may be either an HTML or PHP file. It may contain embedded audio, video, Flash, or any other content. Some restrictions: * It shouldn't contain enclosing or
tags (Bolt will supply these, as well as navigational header and footer). * It shouldn't contain any hyperlinks (Bolt will supply navigational links). If a lesson is implemented as a PHP script, information about the student is available to it in a global variable $student, This information may be used to customize the page. The available information is: {{{ $student.sex; // 0=unknown, 1=male, 2=female $student.age; // in years $student.country; }}} For example, suppose you want to use a larger font for students over 50: {{{ if ($student.age > 50) { echo " "; } }}} Note: an alternative way to vary content based on student attributes is to use separate lesson files, selected in the course document. == Exercises == Exercises are PHP script that call Bolt API functions. Here's an example consisting of a multiple-choice question: {{{ }}} Each time the question is shown, the choices are shown in a random order. The correct choice is the first element of the array. Here's an example that shows an image; a correct answer is a click in the indicated subrectangle. {{{ "; bolt_image_rect( 'dog.jpg', array(100, 60, 110, 70) ); ?> }}} Bolt supplies functions for other types of questions, such as inclusive multiple-choice and fill-in-the-blank. An exercise can include multiple questions. == Course documents == The structure of a Bolt course is defined by a PHP script. The script calls Bolt API functions to create a hierarchy of "units". Each unit has a "name", used to identify the unit within the course (it is now shown to students). The basic types of units are lessons and exercises. Each has accompanying filename. For example, the following course consists of a single lesson: {{{ }}} Attributes can be associated with units, e.g.: {{{ }}} === Sequences === Course documents can also have various 'control structures'. The most basic of these is a 'sequence', which contains a set of units that are shown in sequence. Here's an example of a course with two lessons followed by an exercise: {{{ }}} === Random === The '''random''' control structure selects randomly from a set of units. {{{ }}} === Select === {{{ verbal_level - $unit->verbal_level); } return select( name('course'), valuator(value), lesson( name('lesson 1'), filename('bolt_sample_lesson1.php') ), lesson( name('lesson 2'), filename('bolt_sample_lesson2.php') ), ); ?> }}} == Memory refresh == Bolt offers a ''memory refresh'' system that periodically repeats exercises and, if necessary, lessons. Memory research suggests that this is necessary for students to shift learning to long-term memory. This mechanism works as follows: * A sequence of ''inter-refresh intervals'' is defined. For example, (7, 28) means that an exercise should be repeated 7 days after it is first taken, and then every 28 days thereafter. * Bolt provides a function that returns the set of items, for a given student, for which refresh is due. Your course can use this function to implement a "Review now" button on web pages. * Bolt provides a "review mode" in which the student is presented with exercises due for review.