Changes between Version 1 and Version 2 of BoltImpl


Ignore:
Timestamp:
Dec 17, 2007, 8:48:30 AM (17 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BoltImpl

    v1 v2  
    1 == Identification of course elements ==
     1= Implementation notes =
    22
    3 A course can change over time.
    4 Elements (lessons, exercises, sets) may be added, deleted, or reordered.
     3== Source code ==
    54
    6 A student has a "context" in a course - a sequential position,
    7 and a set of review items.
    8 What if the course changes, and these items change or disappear?
     5The Bolt source code is part of
     6[SourceCode the BOINC source code distribution].
     7The files related to Bolt are:
    98
    10 Each element may be given a "logical name".
    11 For items, this defaults to the file name.
     9Include files:
    1210
    13 A user's sequential position is stored in the DB as the logical name
    14 or last item viewed.
    15 On continuation, Bolt looks up that item.
     11 * [/trac/browser/trunk/boinc/html/inc/bolt.inc bolt.inc]: implementation of course document functions.
     12 * [/trac/browser/trunk/boinc/html/inc/bolt_db.inc bolt_db.inc]: Bolt-specific DB abstraction layer.
     13 * [/trac/browser/trunk/boinc/html/inc/db_conn.inc db_conn.inc]: General DB abstraction layer.
     14 * [/trac/browser/trunk/boinc/html/inc/bolt_ex.inc bolt_ex.inc]: Exercise API functions.
     15 * [/trac/browser/trunk/boinc/html/inc/bolt_util.inc bolt_util.inc]: Miscellaneous HTML.
    1616
    17 == Implementation notes ==
     17User-visible files:
    1818
    19 At the implementation level, an exercise has three functions:
     19 * [/trac/browser/trunk/boinc/html/user/bolt.php bolt.php]: List of courses.
     20 * [/trac/browser/trunk/boinc/html/user/boltcourse_sample.php bolt_course_sample.php]: Example course document.
     21 * [/trac/browser/trunk/boinc/html/user/bolt_course.php bolt_course.php]: Home page for a particular course.
     22 * [/trac/browser/trunk/boinc/html/user/bolt_sched.php bolt_sched.php]: Scheduler: makes sequencing decisions and adds navigation.
    2023
    21  * When invoked with $mode_show set, it shows the exercise.
    22  * When invoked with $mode_score set, it computes a score based on the responses stored in $_GET, and assigns the score to $score.  Its text output, if any, is ignored.
    23  * When invoked with $mode_answer, it shows and "answer sheet" based on the responses stored in $_GET.  If the response is correct and no answer sheet is to be shown, it sets $no_answer_sheet.
     24Administrative files:
    2425
    25 Bolt's exercise primitives perform all these functions for you;
    26 however, you're free to implement your own exercises.
     26 * [/trac/browser/trunk/boinc/html/ops/bolt_refresh.php bolt_refresh.php]: Periodic task to send refresh emails.
     27 * [/trac/browser/trunk/boinc/html/ops/bolt_setup_sample.php bolt_setup_sample.php]: Example script to create a course.
     28
     29== How exercises are implemented ==
     30
     31The following information is intended for those who want to add new exercise types.
     32
     33An exercise is a function that is called with three global variables:
     34
     35 * '''$bolt_ex_mode'''
     36 * '''$bolt_ex_index'''
     37 * '''$bolt_ex_score'''
     38
     39If '''$bolt_ex_mode''' is BOLT_MODE_SHOW, the function should display the exercise,
     40typically generating some "form" input items.
     41'''$bolt_ex_index''' is a sequential index (0, 1, ...) indicating the order of this
     42question in a file containing multiple questions;
     43it should be included in form variable names.
     44
     45If '''$bolt_ex_mode''' is BOLT_MODE_SCORE, the function should score the student's response
     46(based on $_GET values) and should store the result (a floating-point number in [0..1])
     47in '''$bolt_ex_score'''.
     48
     49If '''$bolt_ex_mode''' is BOLT_MODE_ANSWER, the function should display an "answer page"
     50that shows the students the correct answers,
     51and whether the student's responses were right or wrong.