Version 2 (modified by 17 years ago) (diff) | ,
---|
Implementation notes
Source code
The Bolt source code is part of the BOINC source code distribution?. The files related to Bolt are:
Include files:
- bolt.inc: implementation of course document functions.
- bolt_db.inc: Bolt-specific DB abstraction layer.
- db_conn.inc: General DB abstraction layer.
- bolt_ex.inc: Exercise API functions.
- bolt_util.inc: Miscellaneous HTML.
User-visible files:
- bolt.php: List of courses.
- bolt_course_sample.php: Example course document.
- bolt_course.php: Home page for a particular course.
- bolt_sched.php: Scheduler: makes sequencing decisions and adds navigation.
Administrative files:
- bolt_refresh.php: Periodic task to send refresh emails.
- bolt_setup_sample.php: Example script to create a course.
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.