| 52 | |
| 53 | == Structures == |
| 54 | |
| 55 | === Database tables === |
| 56 | |
| 57 | || Table name || What it represents || |
| 58 | || bolt_user || A student, their demographic info, and project-defined attributes || |
| 59 | || bolt_course || A course, and the name of its course structure file || |
| 60 | || bolt_enrollment || A student taking a course, and the ID of their last view || |
| 61 | || bolt_view || A view of an item, created when we show the item, and finalized when the student clicks on something || |
| 62 | || bolt_result || The result of a single exercise || |
| 63 | || bolt_xset_result || The result of a completed exercise set || |
| 64 | || bolt_select_finished || The completion of a select structure || |
| 65 | || bolt_refresh || The refresh/repeat of an exercise set, either pending or in progress || |
| 66 | || bolt_question || A question asked by a student || |
| 67 | |
| 68 | Each table has a corresponding PHP class with names like BoltUser etc. |
| 69 | |
| 70 | === PHP "unit" class hierarchy === |
| 71 | |
| 72 | A "course structure" is a tree of objects of the following types: |
| 73 | |
| 74 | * \BoltUnit |
| 75 | * BoltItem |
| 76 | * BoltLesson |
| 77 | * BoltExercise |
| 78 | * BoltSet |
| 79 | * BoltRandom |
| 80 | * BoltExerciseSet |
| 81 | * BoltSelect |
| 82 | |
| 83 | === Course state === |
| 84 | |
| 85 | A '''course state''' represents a student's position in a course. |
| 86 | It consists of an array that maps unit names to "unit state" structures. |
| 87 | The contents of a unit state structure depends on the unit. |
| 88 | Typically it includes the name of the current child, |
| 89 | and its order in the unit's subunits. |
| 90 | |
| 91 | A course state is like a call stack, |
| 92 | and unit states are like stack frames. |
| 93 | One difference: a course state can include records for units |
| 94 | that the student is not currently in. |
| 95 | |
| 96 | Each BoltView record contains the course state when the view started. |
| 97 | |
| 98 | === BoltIter === |
| 99 | |
| 100 | This data structure is used within the Bolt scheduler. |
| 101 | It includes: |
| 102 | |
| 103 | '''top''':: the root of the course structure. |
| 104 | |
| 105 | '''state''':: the course state (from the latest BoltView record). |
| 106 | |
| 107 | '''xset''':: the xset we're currently in, if any. |
| 108 | |
| 109 | '''item''':: the current item |
| 110 | |
| 111 | '''frac_done''':: fraction of course completed so far |
| 112 | |
| 113 | |
| 114 | |