| 340 | | == Changing course documents == |
| 341 | | |
| 342 | | Course documents can change over time. |
| 343 | | In fact, that's the whole point of Bolt: |
| 344 | | to constantly study the effectiveness of course materials, |
| 345 | | and change the course based on the results of that study. |
| 346 | | |
| 347 | | If a course changes while students are in the middle of it, |
| 348 | | Bolt recovers as gracefully as possible. |
| 349 | | For each student, Bolt maintains a "course state" - a set of data, |
| 350 | | for each control structure that the student has visited in the course, |
| 351 | | describing the student's "position" in that control structure. |
| 352 | | When a student clicks the Next button, or resumes the course after an interval, |
| 353 | | Bolt uses the course state to decide what item to display next. |
| 354 | | |
| 355 | | For example, suppose your course has a sequence with 3 elements, |
| 356 | | with logical names (red, yellow, blue). |
| 357 | | and a student is on the third. |
| 358 | | The course state for the sequence consists of two items: (blue, 2). |
| 359 | | 'blue' is the logical name of the third element, and the index number 2 |
| 360 | | (indicates that the student has completed 2 units in the sequence). |
| 361 | | |
| 362 | | If the student resumes the course, Bolt will find their place in |
| 363 | | the sequence first by looking up the logical name; |
| 364 | | if it is not found, then it will use the index number. |
| 365 | | For example: |
| 366 | | * If you change the sequence to (red, blue, green, yellow) then the student will be shown the units blue, green, and yellow. |
| 367 | | * If you change the sequence to (red, yellow, green) then the student will be shown the unit 'green'. |
| 368 | | * If you change the sequence to (red, yellow) then the student will have finished the sequence. |
| 369 | | |
| | 377 | === Course document notation explained === |
| | 378 | |
| | 379 | If you're familiar with PHP you may wonder how Bolt's notation works. |
| | 380 | The answer is that it uses get_func_args() and PHP's ability to |
| | 381 | identify variable types at runtime. |
| | 382 | There's a PHP class hierarchy underlying it; |
| | 383 | units are represented by classes like BoltExercise, BoltSequence, etc., |
| | 384 | all of which are derived from BoltUnit. |
| | 385 | So |
| | 386 | {{{ |
| | 387 | sequence( |
| | 388 | name("foo"), |
| | 389 | lesson(filename("blah.php")) |
| | 390 | ); |
| | 391 | }}} |
| | 392 | is equivalent to |
| | 393 | {{{ |
| | 394 | new BoltSequence( |
| | 395 | "foo", |
| | 396 | array(new BoltLesson("blah.php")) |
| | 397 | ); |
| | 398 | }}} |
| | 399 | == Changing course documents == |
| | 400 | |
| | 401 | Course documents can change over time. |
| | 402 | In fact, that's the whole point of Bolt: |
| | 403 | to constantly study the effectiveness of course materials, |
| | 404 | and change the course based on the results of that study. |
| | 405 | |
| | 406 | If a course changes while students are in the middle of it, |
| | 407 | Bolt recovers as gracefully as possible. |
| | 408 | For each student, Bolt maintains a "course state" - a set of data, |
| | 409 | for each control structure that the student has visited in the course, |
| | 410 | describing the student's "position" in that control structure. |
| | 411 | When a student clicks the Next button, or resumes the course after an interval, |
| | 412 | Bolt uses the course state to decide what item to display next. |
| | 413 | |
| | 414 | For example, suppose your course has a sequence with 3 elements, |
| | 415 | with logical names (red, yellow, blue). |
| | 416 | and a student is on the third. |
| | 417 | The course state for the sequence consists of two items: (blue, 2). |
| | 418 | 'blue' is the logical name of the third element, and the index number 2 |
| | 419 | (indicates that the student has completed 2 units in the sequence). |
| | 420 | |
| | 421 | If the student resumes the course, Bolt will find their place in |
| | 422 | the sequence first by looking up the logical name; |
| | 423 | if it is not found, then it will use the index number. |
| | 424 | For example: |
| | 425 | * If you change the sequence to (red, blue, green, yellow) then the student will be shown the units blue, green, and yellow. |
| | 426 | * If you change the sequence to (red, yellow, green) then the student will be shown the unit 'green'. |
| | 427 | * If you change the sequence to (red, yellow) then the student will have finished the sequence. |
| | 428 | |
| | 429 | |
| | 430 | |