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,
|
|
|
|
debug tinyint not null,
|
|
|
|
-- if nonzero, print debug info everywhere
|
2007-11-29 02:56:10 +00:00
|
|
|
attrs text not null,
|
|
|
|
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,
|
|
|
|
doc_file varchar(255) not null,
|
|
|
|
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,
|
|
|
|
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
|
2007-12-07 23:23:25 +00:00
|
|
|
action integer not null,
|
2007-12-12 04:43:04 +00:00
|
|
|
-- what the user clicked
|
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,
|
2007-12-19 16:31:41 +00:00
|
|
|
-- for exercise answer views,
|
|
|
|
-- this always refers to the original exercise show
|
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
|
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,
|
2007-12-19 16:31:41 +00:00
|
|
|
-- the original display of exercise
|
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,
|
|
|
|
-- where "completed" means the student clicked Next on the final answer page.
|
|
|
|
-- This is slightly redundant -
|
|
|
|
-- it could be reconstructed from the individual exercise results -
|
|
|
|
-- but this way makes it easier for analytics to treat exercise sets as units.
|
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-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
|
2007-12-18 20:28:08 +00:00
|
|
|
score double not null,
|
2007-12-27 18:37:22 +00:00
|
|
|
view_id integer not null,
|
|
|
|
-- the answer page of last exercise in set
|
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
|
2007-12-27 18:37:22 +00:00
|
|
|
set_result_id integer not null,
|
|
|
|
-- most recent result for this 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
|
2007-10-30 22:31:13 +00:00
|
|
|
primary key (id)
|
|
|
|
);
|