Changes between Version 37 and Version 38 of BoltRef


Ignore:
Timestamp:
Oct 24, 2008, 3:58:59 PM (16 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BoltRef

    v37 v38  
    99 * A '''course document''' describing the order in which lessons and exercises are shown.
    1010
    11 To use Bolt:
     11== Installing Bolt ==
     12
     13If you already have a BOINC or Bossa project, you already have Bolt.
     14Otherwise:
    1215 * [MakeProject create a BOINC project]; use '''make_project --web_only''' so that you don't have to compile any (irrelevant) programs. Similarly, you can [ToolUpgrade upgrade Bolt software] using '''upgrade --web_only'''.
     16
     17Then:
    1318 * In the boinc/db directory, run
    1419{{{
     
    8691image_rect(
    8792   image_filename,
    88    array(100, 60, 110, 70)
     93   array(xmin, xmax, ymin, ymax)
    8994);
    9095?>
    9196}}}
    9297This specifies a question where the student clicks on an image;
    93 a correct answer is a click in the indicated subrectangle.
     98a correct answer is a click in the indicated subrectangle
     99((0,0) is the upper left corner of the image).
    94100
    95101In addition to calling these functions,
    96 an exercise script can put text before or after the questions.
     102an exercise script can intersperse text among the questions.
    97103Example:
    98104{{{
     
    111117
    112118The structure of a Bolt course is defined by a PHP script called a '''course document'''.
    113 The script calls Bolt API functions to create a hierarchy of "units" of two types:
    114 
    115  * '''Basic units''': lessons and exercises
    116  * '''Control structures''' representing sets of units, together with rules the govern their use.
    117 
    118 The function '''lesson()''' specifies a lesson.
    119 For example, the following course consists of a single lesson:
     119The script calls Bolt API functions to create a hierarchy of '''units'''.
     120The API is as follows.
     121
     122=== Lesson ===
     123
     124To specify a lesson:
     125{{{
     126lesson(
     127    filename('lesson_1.php?arg=4'),
     128    [ title('The ecology of a conifer forest'), ]
     129);
     130}}}
     131
     132The parameters are:
     133
     134 '''filename''' ::  the file containing lesson content, optionally followed by a query string. The query string specified in filename() is passed in a global variable '''$bolt_query_string''', rather than in $_GET. To parse it, use
     135{{{
     136parse_str($bolt_query_string);
     137}}}
     138 '''title''' :: a name shown to students
     139
     140=== Exercise ===
     141
     142To specify an exercise:
     143{{{
     144exercise(
     145    filename('bolt_sample_exercise1.php')
     146    [ title('The ecology of a conifer forest'), ]
     147);
     148}}}
     149
     150The filename and title parameters are the same as for '''lesson()'''.
     151
     152=== Sequence ===
     153
     154A 'sequence' unit specifies a set of units that are shown in sequence:
     155{{{
     156sequence(
     157    name('course'),
     158    unit1,
     159    unit2,
     160    ...
     161);
     162}}}
     163
     164=== Select ===
     165
     166The '''select''' structure takes a set of units and a 'value function',
     167which returns the predicted benefit of showing the unit to the student.
     168The unit for which this value is greatest is shown.
     169The value function may be partly or entirely random.
     170
     171This structure can be used to implement
     172 * "experiments" where different lessons are compared;
     173 * "adaptive courses" where different lessons are shown to different types of students.
     174or a mixture of the two.
     175
    120176{{{
    121177<?php
    122 return lesson(
    123     name('lesson 1'),
    124     title('The ecology of a conifer forest'),
    125     filename('lesson_1.php?arg=4'),
    126     reading_level(11.0),
    127     detail_level(.5)
     178function value($student, $unit) {
     179    return abs($student->verbal_level - $unit->verbal_level);
     180}
     181
     182return select(
     183    name('course'),
     184    valuator('value'),
     185    lesson(
     186        name('lesson 1'),
     187        filename('bolt_sample_lesson1.php')
     188    ),
     189    lesson(
     190        name('lesson 2'),
     191        filename('bolt_sample_lesson2.php')
     192    ),
    128193);
    129194?>
    130 }}}
    131 
    132 The parameters of the lesson are:
    133 || name || the "logical name", used as an internal identifier but not visible to students; see "Names and state" below ||
    134 || title || a name shown to students ||
    135 || filename || the file containing lesson content, optionally followed by a query string. ||
    136 || reading_level, detail_level || optional attributes of the lesson ||
    137 
    138 The query string specified in filename() is passed in a global variable $bolt_query_string,
    139 rather than in $_GET.
    140 To parse it, use
    141 {{{
    142 parse_str($bolt_query_string);
    143 }}}
    144 
    145 Similarly, '''exercise()''' specifies an exercise:
    146 {{{
    147 <?php
    148 return exercise(
    149     name('exercise 1'),
    150     filename('bolt_sample_exercise1.php')
     195
     196}}}
     197
     198
     199
     200=== Random ===
     201
     202The '''random''' control structure selects randomly (without replacement) from a set of units.
     203{{{
     204<?php
     205return random(
     206    name('foobar'),
     207    number(2),
     208    lesson(
     209        name('lesson 1'),
     210        filename('bolt_sample_lesson1.php')
     211    ),
     212    lesson(
     213        name('lesson 2'),
     214        filename('bolt_sample_lesson2.php')
     215    ),
     216    lesson(
     217        name('lesson 3'),
     218        filename('bolt_sample_lesson3.php')
     219    ),
    151220);
    152221?>
    153222}}}
    154223
    155 There are various control structures; see below.
    156 The simples one is a 'sequence',
    157 which specifies a set of units that are shown in sequence.
    158 Here's an example of a course with two lessons followed by an exercise:
    159 {{{
    160 <?php
    161 return sequence(
    162     name('course'),
    163     lesson(...),
    164     lesson(...),
    165     exercise(...)
    166 );
    167 ?>
    168 }}}
     224If 'number()' is given, that many units are shown; the default is to show all the units.
     225
     226The 'without replacement' applies across multiple visits to the same structure
     227(e.g. because of review or refresh).
     228
     229=== Exercise set ===
     230
     231The 'exercise_set' structure specifies a set of exercises and a value 'number' (default one).
     232This number of exercises is chosen randomly (without replacement) and administered.
     233
     234The navigation links on the answer page of the last exercise
     235may allow the student to review for and/or repeat the exercise set (see below).
     236
     237Exercise sets may not be nested.
     238
     239Example:
     240{{{
     241exercise_set(
     242    name('exer_set'),
     243    number(1),
     244    exercise(
     245        name('exercise 1'),
     246        filename('file_1.php')
     247    ),
     248    exercise(
     249        name('exercise 1'),
     250        filename('file_1.php')
     251    ),
     252    callback('my_func'),
     253    repeat(.3, basic_review(), REVIEW),
     254    repeat(.7, int_review(), REVIEW|REPEAT),
     255    repeat(1, null, REPEAT|NEXT),
     256    refresh(array(7, 14, 28))
     257);
     258}}}
     259
     260 '''callback()''' specifies a function to be called when the exercise set is completed.
     261This function is called with the following arguments:
     262{{{
     263function($student, $score);
     264}}}
     265where $student is the student record and $score [0..1] is the score.
     266== Exercise review and repeat ==
     267
     268The "repeat" items in an exercise set determine the student's options
     269to review for and repeat the exercise set.
     270(
     271Each repeat item is a function call of the form
     272{{{
     273repeat(grade_threshold, review_unit, nav_flags);
     274}}}
     275The arguments are:
     276 * grade_threshold: the highest grade to which this item applies
     277 * review_unit: a unit that reviews the material assessed by for the exercise set.
     278 * nav_flags: a bitmask determining which navigation options will be presented:
     279  * REVIEW: show the review units, then repeat the exercise set
     280  * REPEAT: repeat exercise set immediately
     281  * NEXT: continue without repeating the exercise set
     282
     283A student's score on an exercise set is the average score of the selected exercises.
     284Call this Y;
     285the "selected repeat item" is the one with the least X such that Y < X.
     286
     287If there is no such repeat item, the student is not given an option
     288to repeat the exercise set; i.e., they see only a Next button.
     289
     290Otherwise let R be the selected repeat item.
     291If R.repeat_optional is true, a Next button is shown.
     292If R.review_optional is true, a "Repeat" button is shown.
     293If R.review_unit is present, a "Review" button is shown.
     294
     295Thus, in the example above, the student's options are:
     296
     297|| grade || options ||
     298|| [0, .3) || review and repeat exercise ||
     299|| [.3, .7) || review and repeat exercise, or repeat exercise ||
     300|| [.7, 1) || repeat exercise, or continue ||
     301|| 1 || continue ||
     302
     303== Memory refresh ==
     304
     305If a '''refresh()''' argument is given to exercise_set(),
     306then when the set is completed by a student it is added to
     307a "refresh schedule".
     308Each element in a refresh schedule specifies
     309The intervals (in days) are given as arguments to refresh().
     310
     311At a given point, one or more exercise sets may be due for refresh.
     312The student may choose any of them to view.
     313Bolt keeps track of the state independently for each set;
     314the student may begin refresh for set A while
     315partway through refresh for set B.
    169316
    170317=== Changing course documents ===
     
    268415they share a single state.
    269416
    270 == Control structures ==
    271 === Sequences ===
    272 
    273 Sequences were described above.
    274 
    275 === Select ===
    276 
    277 The '''select''' structure takes a set of units and a 'value function',
    278 which returns the predicted benefit of showing the unit to the student.
    279 The unit for which this value is greatest is shown.
    280 The value function may be partly or entirely random.
    281 
    282 This structure can be used to implement
    283  * "experiments" where different lessons are compared;
    284  * "adaptive courses" where different lessons are shown to different types of students.
    285 or a mixture of the two.
    286 
    287 {{{
    288 <?php
    289 function value($student, $unit) {
    290     return abs($student->verbal_level - $unit->verbal_level);
    291 }
    292 
    293 return select(
    294     name('course'),
    295     valuator('value'),
    296     lesson(
    297         name('lesson 1'),
    298         filename('bolt_sample_lesson1.php')
    299     ),
    300     lesson(
    301         name('lesson 2'),
    302         filename('bolt_sample_lesson2.php')
    303     ),
    304 );
    305 ?>
    306 }}}
    307 
    308 
    309 === Random ===
    310 
    311 The '''random''' control structure selects randomly (without replacement) from a set of units.
    312 {{{
    313 <?php
    314 return random(
    315     name('foobar'),
    316     number(2),
    317     lesson(
    318         name('lesson 1'),
    319         filename('bolt_sample_lesson1.php')
    320     ),
    321     lesson(
    322         name('lesson 2'),
    323         filename('bolt_sample_lesson2.php')
    324     ),
    325     lesson(
    326         name('lesson 3'),
    327         filename('bolt_sample_lesson3.php')
    328     ),
    329 );
    330 ?>
    331 }}}
    332 
    333 If 'number()' is given, that many units are shown; the default is to show all the units.
    334 
    335 The 'without replacement' applies across multiple visits to the same structure
    336 (e.g. because of review or refresh).
    337 
    338 === Exercise set ===
    339 
    340 The 'exercise_set' structure specifies a set of exercises and a value 'number' (default one).
    341 This number of exercises is chosen randomly (without replacement) and administered.
    342 
    343 The navigation links on the answer page of the last exercise
    344 may allow the student to review for and/or repeat the exercise set (see below).
    345 
    346 Exercise sets may not be nested.
    347 
    348 Example:
    349 {{{
    350 exercise_set(
    351     name('exer_set'),
    352     number(1),
    353     exercise(
    354         name('exercise 1'),
    355         filename('file_1.php')
    356     ),
    357     exercise(
    358         name('exercise 1'),
    359         filename('file_1.php')
    360     ),
    361     callback('my_func'),
    362     repeat(.3, basic_review(), REVIEW),
    363     repeat(.7, int_review(), REVIEW|REPEAT),
    364     repeat(1, null, REPEAT|NEXT),
    365     refresh(array(7, 14, 28))
    366 );
    367 }}}
    368 
    369  '''callback()''' specifies a function to be called when the exercise set is completed.
    370 This function is called with the following arguments:
    371 {{{
    372 function($student, $score);
    373 }}}
    374 where $student is the student record and $score [0..1] is the score.
    375 == Exercise review and repeat ==
    376 
    377 The "repeat" items in an exercise set determine the student's options
    378 to review for and repeat the exercise set.
    379 (
    380 Each repeat item is a function call of the form
    381 {{{
    382 repeat(grade_threshold, review_unit, nav_flags);
    383 }}}
    384 The arguments are:
    385  * grade_threshold: the highest grade to which this item applies
    386  * review_unit: a unit that reviews the material assessed by for the exercise set.
    387  * nav_flags: a bitmask determining which navigation options will be presented:
    388   * REVIEW: show the review units, then repeat the exercise set
    389   * REPEAT: repeat exercise set immediately
    390   * NEXT: continue without repeating the exercise set
    391 
    392 A student's score on an exercise set is the average score of the selected exercises.
    393 Call this Y;
    394 the "selected repeat item" is the one with the least X such that Y < X.
    395 
    396 If there is no such repeat item, the student is not given an option
    397 to repeat the exercise set; i.e., they see only a Next button.
    398 
    399 Otherwise let R be the selected repeat item.
    400 If R.repeat_optional is true, a Next button is shown.
    401 If R.review_optional is true, a "Repeat" button is shown.
    402 If R.review_unit is present, a "Review" button is shown.
    403 
    404 Thus, in the example above, the student's options are:
    405 
    406 || grade || options ||
    407 || [0, .3) || review and repeat exercise ||
    408 || [.3, .7) || review and repeat exercise, or repeat exercise ||
    409 || [.7, 1) || repeat exercise, or continue ||
    410 || 1 || continue ||
    411 
    412 == Memory refresh ==
    413 
    414 If a '''refresh()''' argument is given to exercise_set(),
    415 then when the set is completed by a student it is added to
    416 a "refresh schedule".
    417 Each element in a refresh schedule specifies
    418 The intervals (in days) are given as arguments to refresh().
    419 
    420 At a given point, one or more exercise sets may be due for refresh.
    421 The student may choose any of them to view.
    422 Bolt keeps track of the state independently for each set;
    423 the student may begin refresh for set A while
    424 partway through refresh for set B.
     417