wiki:BoltImpl

Version 3 (modified by Nicolas, 16 years ago) (diff)

Use correct TracLinks for sourcecode -- by the way, I thought you would separate bolt to another directory on svn...

Implementation notes

Source code

The Bolt source code is part of the BOINC source code distribution?. The files related to Bolt are:

Include files:

User-visible files:

Administrative files:

How exercises are implemented

The following information is intended for those who want to add new exercise types.

An exercise is a function that is called with three global variables:

  • $bolt_ex_mode
  • $bolt_ex_index
  • $bolt_ex_score

If $bolt_ex_mode is BOLT_MODE_SHOW, the function should display the exercise, typically generating some "form" input items. $bolt_ex_index is a sequential index (0, 1, ...) indicating the order of this question in a file containing multiple questions; it should be included in form variable names.

If $bolt_ex_mode is BOLT_MODE_SCORE, the function should score the student's response (based on $_GET values) and should store the result (a floating-point number in [0..1]) in $bolt_ex_score.

If $bolt_ex_mode is BOLT_MODE_ANSWER, the function should display an "answer page" that shows the students the correct answers, and whether the student's responses were right or wrong.