Changes between Version 38 and Version 39 of BoltRef
- Timestamp:
- Oct 24, 2008, 4:13:21 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BoltRef
v38 v39 164 164 === Select === 165 165 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. 166 The '''select''' structure takes a set of units and a 'value function'. 168 167 The unit for which this value is greatest is shown. 169 168 The value function may be partly or entirely random. … … 175 174 176 175 {{{ 177 <?php 176 select( 177 name('name'), 178 valuator('func_name'), 179 unit1, 180 unit2, 181 ... 182 ); 183 }}} 184 Example: 185 {{{ 178 186 function value($student, $unit) { 179 187 return abs($student->verbal_level - $unit->verbal_level); 180 188 } 181 189 182 returnselect(190 select( 183 191 name('course'), 184 192 valuator('value'), 185 193 lesson( 186 name('lesson 1'),187 194 filename('bolt_sample_lesson1.php') 188 195 ), 189 196 lesson( 190 name('lesson 2'),191 197 filename('bolt_sample_lesson2.php') 192 198 ), 193 199 ); 194 ?> 195 196 }}} 197 200 }}} 198 201 199 202 … … 202 205 The '''random''' control structure selects randomly (without replacement) from a set of units. 203 206 {{{ 204 <?php 205 return random( 207 random( 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 217 Example: 218 {{{ 219 random( 206 220 name('foobar'), 207 221 number(2), 208 222 lesson( 209 name('lesson 1'),210 223 filename('bolt_sample_lesson1.php') 211 224 ), 212 225 lesson( 213 name('lesson 2'),214 226 filename('bolt_sample_lesson2.php') 215 227 ), 216 228 lesson( 217 name('lesson 3'),218 229 filename('bolt_sample_lesson3.php') 219 230 ), … … 221 232 ?> 222 233 }}} 223 224 If 'number()' is given, that many units are shown; the default is to show all the units.225 234 226 235 The 'without replacement' applies across multiple visits to the same structure … … 229 238 === Exercise set === 230 239 231 The 'exercise_set' structure specifies a set of exercises and a value 'number' (default one).232 Thisnumber of exercises is chosen randomly (without replacement) and administered.240 The 'exercise_set' structure specifies a set of exercises. 241 A number of exercises is chosen randomly (without replacement) and administered. 233 242 234 243 The navigation links on the answer page of the last exercise 235 244 may allow the student to review for and/or repeat the exercise set (see below). 236 245 237 Exercise sets may not be nested. 246 {{{ 247 exercise_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 {{{ 264 callback($student, $score); 265 }}} 266 where $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). 238 269 239 270 Example: … … 241 272 exercise_set( 242 273 name('exer_set'), 243 number(1),244 274 exercise( 245 275 name('exercise 1'), … … 250 280 filename('file_1.php') 251 281 ), 252 callback('my_func'),253 282 repeat(.3, basic_review(), REVIEW), 254 283 repeat(.7, int_review(), REVIEW|REPEAT), 255 284 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 === 267 290 268 291 The "repeat" items in an exercise set determine the student's options … … 301 324 || 1 || continue || 302 325 303 == Memory refresh==326 === Refresh specification === 304 327 305 328 If a '''refresh()''' argument is given to exercise_set(), … … 315 338 partway through refresh for set B. 316 339 317 == = Changing course documents ===340 == Changing course documents == 318 341 319 342 Course documents can change over time.