Changes between Version 3 and Version 4 of BoltRef
- Timestamp:
- Dec 4, 2007, 5:44:22 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BoltRef
v3 v4 40 40 to use separate lesson files, selected in the course document. 41 41 42 == Creating exercises ==42 == Exercises == 43 43 44 A Bolt exercise is a PHP script.44 Exercises are PHP script that call Bolt API functions. 45 45 Here's an example consisting of a multiple-choice question: 46 46 {{{ … … 79 79 == Course documents == 80 80 81 The structure of a Bolt course is defined by a [RFC:4627 JSON] document. 81 The structure of a Bolt course is defined by a PHP script. 82 The script calls Bolt API functions to create a hierarchy of "units". 83 Each unit has a "name", used to identify the unit within the course 84 (it is now shown to students). 85 86 The basic types of units are lessons and exercises. 87 Each has accompanying filename. 88 For example, the following course consists of a single lesson: 89 {{{ 90 <?php 91 return lesson( 92 name('lesson 1'), 93 filename('lesson_1.php'); 94 ); 95 ?> 96 }}} 97 === Sequences === 82 98 Here's an example of a course with two lessons followed by an exercise: 83 99 {{{ 84 { 85 "name": "Identifying Sierra Conifers", 86 "description: "Learn to identify the major conifers of California's Sierra Nevada", 87 "items": [ 88 { 89 "type": "lesson", 90 "name": "Introduction", 91 "file": "intro.html" 92 }, 93 { 94 "type": "lesson", 95 "name": "The Linnaean hierarchy", 96 "file": "linnaean.html" 97 }, 98 { 99 "type": "exercise", 100 "file": "linnaean.php" 101 } 102 ] 103 } 100 <?php 101 return sequence( 102 name('course'), 103 lesson( 104 name('lesson 1'), 105 filename('bolt_sample_lesson1.php') 106 ), 107 lesson( 108 name('lesson 2'), 109 filename('bolt_sample_lesson2.php') 110 ), 111 exercise( 112 name('exercise 1'), 113 filename('bolt_sample_exercise1.php') 114 ), 115 ); 116 ?> 104 117 }}} 105 118