Changes between Version 3 and Version 4 of BoltRef


Ignore:
Timestamp:
Dec 4, 2007, 5:44:22 PM (16 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BoltRef

    v3 v4  
    4040to use separate lesson files, selected in the course document.
    4141
    42 == Creating exercises ==
     42== Exercises ==
    4343
    44 A Bolt exercise is a PHP script.
     44Exercises are PHP script that call Bolt API functions.
    4545Here's an example consisting of a multiple-choice question:
    4646{{{
     
    7979== Course documents ==
    8080
    81 The structure of a Bolt course is defined by a [RFC:4627 JSON] document.
     81The structure of a Bolt course is defined by a PHP script.
     82The script calls Bolt API functions to create a hierarchy of "units".
     83Each unit has a "name", used to identify the unit within the course
     84(it is now shown to students).
     85
     86The basic types of units are lessons and exercises.
     87Each has accompanying filename.
     88For example, the following course consists of a single lesson:
     89{{{
     90<?php
     91return lesson(
     92    name('lesson 1'),
     93    filename('lesson_1.php');
     94);
     95?>
     96}}}
     97=== Sequences ===
    8298Here's an example of a course with two lessons followed by an exercise:
    8399{{{
    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
     101return 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?>
    104117}}}
    105118