Changes between Version 38 and Version 39 of BoltRef


Ignore:
Timestamp:
Oct 24, 2008, 4:13:21 PM (16 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BoltRef

    v38 v39  
    164164=== Select ===
    165165
    166 The '''select''' structure takes a set of units and a 'value function',
    167 which returns the predicted benefit of showing the unit to the student.
     166The '''select''' structure takes a set of units and a 'value function'.
    168167The unit for which this value is greatest is shown.
    169168The value function may be partly or entirely random.
     
    175174
    176175{{{
    177 <?php
     176select(
     177   name('name'),
     178   valuator('func_name'),
     179   unit1,
     180   unit2,
     181   ...
     182);
     183}}}
     184Example:
     185{{{
    178186function value($student, $unit) {
    179187    return abs($student->verbal_level - $unit->verbal_level);
    180188}
    181189
    182 return select(
     190select(
    183191    name('course'),
    184192    valuator('value'),
    185193    lesson(
    186         name('lesson 1'),
    187194        filename('bolt_sample_lesson1.php')
    188195    ),
    189196    lesson(
    190         name('lesson 2'),
    191197        filename('bolt_sample_lesson2.php')
    192198    ),
    193199);
    194 ?>
    195 
    196 }}}
    197 
     200}}}
    198201
    199202
     
    202205The '''random''' control structure selects randomly (without replacement) from a set of units.
    203206{{{
    204 <?php
    205 return random(
     207random(
     208    name('name'),
     209    [ number(N), ]
     210    unit1,
     211    unit2,
     212    ...
     213);
     214}}}
     215 '''number''' :: how many units are to be shown (default: all of them).
     216
     217Example:
     218{{{
     219random(
    206220    name('foobar'),
    207221    number(2),
    208222    lesson(
    209         name('lesson 1'),
    210223        filename('bolt_sample_lesson1.php')
    211224    ),
    212225    lesson(
    213         name('lesson 2'),
    214226        filename('bolt_sample_lesson2.php')
    215227    ),
    216228    lesson(
    217         name('lesson 3'),
    218229        filename('bolt_sample_lesson3.php')
    219230    ),
     
    221232?>
    222233}}}
    223 
    224 If 'number()' is given, that many units are shown; the default is to show all the units.
    225234
    226235The 'without replacement' applies across multiple visits to the same structure
     
    229238=== Exercise set ===
    230239
    231 The 'exercise_set' structure specifies a set of exercises and a value 'number' (default one).
    232 This number of exercises is chosen randomly (without replacement) and administered.
     240The 'exercise_set' structure specifies a set of exercises.
     241A number of exercises is chosen randomly (without replacement) and administered.
    233242
    234243The navigation links on the answer page of the last exercise
    235244may allow the student to review for and/or repeat the exercise set (see below).
    236245
    237 Exercise sets may not be nested.
     246{{{
     247exercise_set(
     248    name('name'),
     249    [ number(N), ]
     250    exercise1,
     251    exercise2,
     252    ...
     253    [ callback('my_func'), ]
     254    [ repeat-spec1, ]
     255    [ repeat-spec2, ]
     256    [ ... ]
     257    [ refresh-spec ]
     258);
     259}}}
     260
     261 '''number''' :: the number of exercises to administer.
     262 '''callback''' :: a function to call on the completion of the exercise set.  It will be called as
     263{{{
     264callback($student, $score);
     265}}}
     266where $student is the student record and $score [0..1] is the score.
     267 '''repeat-spec''': A repeat specification (see below).
     268 '''refresh-spec''': A refresh specification (see below).
    238269
    239270Example:
     
    241272exercise_set(
    242273    name('exer_set'),
    243     number(1),
    244274    exercise(
    245275        name('exercise 1'),
     
    250280        filename('file_1.php')
    251281    ),
    252     callback('my_func'),
    253282    repeat(.3, basic_review(), REVIEW),
    254283    repeat(.7, int_review(), REVIEW|REPEAT),
    255284    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.
    261 This function is called with the following arguments:
    262 {{{
    263 function($student, $score);
    264 }}}
    265 where $student is the student record and $score [0..1] is the score.
    266 == Exercise review and repeat ==
     285    refresh(array(7, 14, 28))
     286);
     287}}}
     288
     289=== Repeat specification ===
    267290
    268291The "repeat" items in an exercise set determine the student's options
     
    301324|| 1 || continue ||
    302325
    303 == Memory refresh ==
     326=== Refresh specification ===
    304327
    305328If a '''refresh()''' argument is given to exercise_set(),
     
    315338partway through refresh for set B.
    316339
    317 === Changing course documents ===
     340== Changing course documents ==
    318341
    319342Course documents can change over time.