wiki:BoltTutorialExercises

Bolt Tutorial, part II: Exercises

Now let's add some exercises. Create a new course, with short name "conifer2".

Bolt exercises are implemented as PHP scripts that call Bolt-supplied functions for different types of questions. For example:

<?php
echo "Conifers are so named because:";
exclusive_choice(
    'They carry their seeds in cones',
    'They are cone-shaped',
    'They originated in the Coniceous era'
);
?>

exclusive_choice() defines a multiple-choice question.

Each exercise is represented in the course document by an exercise unit; for example,

exercise(
    filename('conifer_ex1.php')
)

Our course uses a new Bolt control structure, exercise_set:

function intro_exercises() {
    return exercise_set(
        name('Intro exercises'),
        exercise(
            filename('conifer_ex1.php')
        ),
        exercise(
            filename('conifer_ex2.php')
        ),
        repeat(.3, intro_lessons(), REVIEW),
        repeat(.7, intro_lessons(), REVIEW|REPEAT),
        repeat(1, null, REPEAT|NEXT),
        refresh(array(7, 14, 28))
    );
}

An exercise represents a set of exercises, which are shown in a random order. By default all the exercises are shown (if you want to show only N, add an entry number(N)). We'll explain the repeat and refresh entries later.

Start the course from the beginning. When you get to an exercise you'll see

You'll then see either

or

depending on whether you answered the question correctly.

Some notes:

  • In exclusive_choice(), the correct answer is always the first choice listed. Bolt randomly reorders the choices to remove any ordering effects.
  • The exercise page is used to generate both the exercise and the answer page.

Reviewing and repeating exercises

Suppose the student doesn't perform the exercise correctly, and you want to let them (or require them to) review the lessons and repeat the exercise.

In the above example, this is done as follows:

repeat(.3, intro_lessons(), REVIEW),
repeat(.7, intro_lessons(), REVIEW|REPEAT),
repeat(1, null, REPEAT|NEXT),

These entries mean that:

  • If the student's score on the exercise set (i.e., the average of the scores on the exercises in the set) is less than 30%, the student is required to do a review, then repeat the exercise set. The review consists of the unit returned by intro_lessons().
  • If the student's score is in [30%, 70%), they are given the option of doing a review or immediately repeating the exercise set.
  • If the student's score is in [70%, 100%), they are given the option of either repeating the exercise set or proceeding.
  • If the student's score is 100% they are only given the option of proceeding.

Refresh

Learning research suggests that long-term retention occurs only when material is "refreshed" at intervals of weeks or months. If an exercise set contains an entry

refresh(array(7, 14, 28))

then, on completion of the exercise set, a "refresh" is scheduled for the student. The student will be reminded of the refresh on the web site, or (if they have given approval) via email.

The array of numbers represents the intervals (in days) between refreshes. The first refresh will be scheduled for 7 days after the initial completion. The 2nd refresh will be scheduled for 14 days after the completion of the first refresh. The 3rd and subsequent refreshes will be scheduled 28 days after the completion of the previous refresh.

Continue to Part III

Last modified 15 years ago Last modified on Apr 6, 2009, 5:09:21 PM

Attachments (5)

Download all attachments as: .zip