2007-11-29 02:56:10 +00:00
|
|
|
create table bolt_user (
|
2008-01-01 18:07:13 +00:00
|
|
|
user_id integer not null,
|
2007-11-29 02:56:10 +00:00
|
|
|
birth_year integer not null,
|
2008-01-01 18:07:13 +00:00
|
|
|
sex tinyint not null,
|
2008-02-01 23:11:09 +00:00
|
|
|
flags integer not null,
|
2007-11-29 02:56:10 +00:00
|
|
|
attrs text not null,
|
2008-10-23 20:35:39 +00:00
|
|
|
-- project-defined. Use serialized PHP object
|
2007-11-29 02:56:10 +00:00
|
|
|
primary key (user_id)
|
|
|
|
);
|
|
|
|
|
2007-10-30 22:31:13 +00:00
|
|
|
create table bolt_course (
|
|
|
|
id integer not null auto_increment,
|
|
|
|
create_time integer not null,
|
|
|
|
short_name varchar(255) not null,
|
|
|
|
name varchar(255) not null,
|
|
|
|
description text not null,
|
2008-02-01 23:11:09 +00:00
|
|
|
hidden tinyint not null,
|
2008-02-13 19:02:44 +00:00
|
|
|
bossa_app_id integer not null,
|
|
|
|
-- on completion, go to this Bossa app
|
2007-10-30 22:31:13 +00:00
|
|
|
primary key (id)
|
|
|
|
);
|
|
|
|
|
|
|
|
create table bolt_enrollment (
|
|
|
|
create_time integer not null,
|
|
|
|
user_id integer not null,
|
|
|
|
course_id integer not null,
|
2007-12-12 04:43:04 +00:00
|
|
|
last_view_id integer not null,
|
2008-01-31 23:43:37 +00:00
|
|
|
-- ID of last study phase view
|
2007-12-12 04:43:04 +00:00
|
|
|
mastery double not null
|
2007-10-30 22:31:13 +00:00
|
|
|
);
|
|
|
|
|
2007-12-18 23:37:26 +00:00
|
|
|
-- Represents a view of an item;
|
2007-12-12 04:43:04 +00:00
|
|
|
-- created when we show the item,
|
|
|
|
-- and finalized when the user clicks on something to leave the page
|
2007-12-18 23:37:26 +00:00
|
|
|
-- A special view is used to represent the end of a course;
|
|
|
|
-- its mode is BOLT_MODE_FINISHED.
|
2007-12-12 04:43:04 +00:00
|
|
|
--
|
2007-10-30 22:31:13 +00:00
|
|
|
create table bolt_view (
|
|
|
|
id integer not null auto_increment,
|
|
|
|
user_id integer not null,
|
|
|
|
course_id integer not null,
|
|
|
|
item_name varchar(255) not null,
|
2007-12-12 04:43:04 +00:00
|
|
|
-- name of the item
|
2007-12-07 23:23:25 +00:00
|
|
|
state text not null,
|
2007-12-12 04:43:04 +00:00
|
|
|
-- course state
|
2007-12-07 23:23:25 +00:00
|
|
|
mode integer not null,
|
2007-12-18 23:37:26 +00:00
|
|
|
-- distinguishes exercise show/answer
|
2008-01-28 15:48:09 +00:00
|
|
|
phase integer not null,
|
|
|
|
-- distinguishes study/review/refresh
|
2007-12-07 23:23:25 +00:00
|
|
|
action integer not null,
|
2008-01-17 18:09:30 +00:00
|
|
|
-- what the user clicked to leave page
|
2007-10-30 22:31:13 +00:00
|
|
|
start_time integer not null,
|
|
|
|
end_time integer not null,
|
2007-12-12 04:43:04 +00:00
|
|
|
prev_view_id integer not null,
|
2008-01-17 18:09:30 +00:00
|
|
|
-- for exercise answer views;
|
|
|
|
-- refers to the original exercise view
|
2007-12-12 04:43:04 +00:00
|
|
|
fraction_done double not null,
|
2007-12-07 23:23:25 +00:00
|
|
|
result_id integer not null,
|
2007-12-12 04:43:04 +00:00
|
|
|
-- if this was an exercise show, link to result record
|
2007-12-07 23:23:25 +00:00
|
|
|
refresh_id integer not null,
|
2007-12-12 04:43:04 +00:00
|
|
|
-- if unit was flagged for review, link to review record
|
2008-01-17 18:09:30 +00:00
|
|
|
-- ?? remove?
|
2007-12-07 23:23:25 +00:00
|
|
|
primary key (id)
|
|
|
|
);
|
|
|
|
|
2008-01-04 22:59:21 +00:00
|
|
|
-- represents the result of a single exercise
|
2007-12-18 20:28:08 +00:00
|
|
|
--
|
2008-01-04 22:59:21 +00:00
|
|
|
create table bolt_result (
|
2007-12-07 23:23:25 +00:00
|
|
|
id integer not null auto_increment,
|
2008-01-04 22:59:21 +00:00
|
|
|
create_time integer not null,
|
|
|
|
user_id integer not null,
|
|
|
|
course_id integer not null,
|
2007-12-07 23:23:25 +00:00
|
|
|
view_id integer not null,
|
2008-01-17 18:09:30 +00:00
|
|
|
-- the display of exercise
|
2008-06-26 20:53:51 +00:00
|
|
|
item_name varchar(255) not null,
|
2007-12-07 23:23:25 +00:00
|
|
|
score double not null,
|
|
|
|
response text not null,
|
2007-12-19 16:31:41 +00:00
|
|
|
-- the query string containing user's responses
|
2007-12-07 23:23:25 +00:00
|
|
|
primary key(id)
|
|
|
|
);
|
|
|
|
|
2008-01-03 17:37:38 +00:00
|
|
|
-- represents the result of a completed exercise set,
|
2008-01-28 22:42:05 +00:00
|
|
|
-- where "completed" means the last exercise was scored.
|
2008-01-17 18:09:30 +00:00
|
|
|
-- In theory this could be reconstructed from the individual exercise results,
|
|
|
|
-- but this table makes it easier for analytics
|
2007-12-18 20:28:08 +00:00
|
|
|
--
|
2008-01-03 17:37:38 +00:00
|
|
|
create table bolt_xset_result (
|
2007-12-18 20:28:08 +00:00
|
|
|
id integer not null auto_increment,
|
2008-01-30 19:29:51 +00:00
|
|
|
create_time integer not null,
|
2008-01-03 17:37:38 +00:00
|
|
|
user_id integer not null,
|
|
|
|
course_id integer not null,
|
2008-01-17 18:09:30 +00:00
|
|
|
start_time integer not null,
|
|
|
|
end_time integer not null,
|
2008-01-03 17:37:38 +00:00
|
|
|
name varchar(255) not null,
|
2008-06-19 20:56:36 +00:00
|
|
|
-- logical name of exercise set unit
|
2007-12-18 20:28:08 +00:00
|
|
|
score double not null,
|
2008-01-17 18:09:30 +00:00
|
|
|
-- weighted average score
|
|
|
|
view_id integer not null,
|
|
|
|
-- the view of the answer page of last exercise in set
|
|
|
|
primary key(id)
|
|
|
|
);
|
|
|
|
|
|
|
|
-- represents the completion of a select structure
|
|
|
|
--
|
2008-01-31 23:43:37 +00:00
|
|
|
create table bolt_select_finished (
|
2008-01-17 18:09:30 +00:00
|
|
|
id integer not null auto_increment,
|
|
|
|
user_id integer not null,
|
|
|
|
course_id integer not null,
|
|
|
|
end_time integer not null,
|
|
|
|
name varchar(255) not null,
|
|
|
|
-- logical name of the select unit
|
2008-06-19 20:56:36 +00:00
|
|
|
selected_unit varchar(255) not null,
|
|
|
|
-- name of selected subunit
|
2007-12-27 18:37:22 +00:00
|
|
|
view_id integer not null,
|
2008-01-17 18:09:30 +00:00
|
|
|
-- the view of the last item
|
2007-12-18 20:28:08 +00:00
|
|
|
primary key(id)
|
|
|
|
);
|
|
|
|
|
2008-01-03 17:37:38 +00:00
|
|
|
-- represents a refresh/repeat of an exercise set,
|
|
|
|
-- either pending (not due yet),
|
|
|
|
-- due but not started, or in progress.
|
|
|
|
--
|
2007-12-07 23:23:25 +00:00
|
|
|
create table bolt_refresh (
|
|
|
|
id integer not null auto_increment,
|
2008-01-03 17:37:38 +00:00
|
|
|
create_time integer not null,
|
|
|
|
user_id integer not null,
|
|
|
|
course_id integer not null,
|
|
|
|
name varchar(255) not null,
|
|
|
|
-- logical name of result set unit
|
|
|
|
last_view_id integer not null,
|
|
|
|
-- if refresh is in progress, the last view
|
2008-01-31 23:43:37 +00:00
|
|
|
xset_result_id integer not null,
|
|
|
|
-- most recent result for this exercise set
|
2007-12-07 23:23:25 +00:00
|
|
|
due_time integer not null,
|
2008-01-03 17:37:38 +00:00
|
|
|
-- when refresh will be due
|
2008-08-14 21:05:02 +00:00
|
|
|
count integer not null,
|
|
|
|
-- index into intervals array
|
2007-10-30 22:31:13 +00:00
|
|
|
primary key (id)
|
|
|
|
);
|
2008-01-17 18:09:30 +00:00
|
|
|
|
|
|
|
create table bolt_question (
|
|
|
|
id integer not null auto_increment,
|
|
|
|
create_time integer not null,
|
|
|
|
user_id integer not null,
|
|
|
|
course_id integer not null,
|
|
|
|
name varchar(255) not null,
|
|
|
|
-- logical name of item where question was asked
|
2008-10-30 22:58:33 +00:00
|
|
|
mode integer not null,
|
|
|
|
-- distinguishes exercise show/answer
|
2008-01-17 18:09:30 +00:00
|
|
|
question text not null,
|
|
|
|
state integer not null,
|
|
|
|
-- whether question has been handled
|
|
|
|
primary key (id)
|
|
|
|
);
|