· 8 years ago · Jun 04, 2018, 03:42 AM
1DROP TABLE IF EXISTS `question_bank`;
2CREATE TABLE `question_bank` (
3 `id` bigint(33) NOT NULL AUTO_INCREMENT,
4 `satker_id` int(11) NOT NULL,
5 `topic` varchar(255) NOT NULL,
6 `level` int(1) DEFAULT '0' COMMENT 'tingkat kesulitan soal',
7 `type` int(1) NOT NULL DEFAULT '1' COMMENT '1:multiple choice, 2:essay',
8 `salt` varchar(255) NOT NULL,
9 `question` text NOT NULL,
10 `question_file` varchar(255) DEFAULT NULL,
11 `options` text COMMENT 'json pilihan jawaban',
12 `options_files` text COMMENT 'json file pilihan jawaban',
13 `answer_key` varchar(255) COMMENT 'json kunci jawaban',
14 `status` int(3) NOT NULL,
15 `created` datetime DEFAULT NULL,
16 `created_by` int(11) DEFAULT NULL,
17 `modified` datetime DEFAULT NULL,
18 `modified_by` int(11) DEFAULT NULL,
19 PRIMARY KEY (`id`)
20) ENGINE=InnoDB DEFAULT CHARSET=utf8;
21
22DROP TABLE IF EXISTS `question_package`;
23CREATE TABLE `question_package` (
24 `id` int(11) NOT NULL AUTO_INCREMENT,
25 `satker_id` int(11) NOT NULL,
26 `title` varchar(255) NOT NULL,
27 `question_ids` text NOT NULL,
28 `status` int(3) NOT NULL,
29 `created` datetime DEFAULT NULL,
30 `created_by` int(11) DEFAULT NULL,
31 `modified` datetime DEFAULT NULL,
32 `modified_by` int(11) DEFAULT NULL,
33 PRIMARY KEY (`id`)
34) ENGINE=InnoDB DEFAULT CHARSET=utf8;
35
36DROP TABLE IF EXISTS `program_test`;
37CREATE TABLE `program_test` (
38 `id` int(11) NOT NULL AUTO_INCREMENT,
39 `satker_id` int(11) NOT NULL,
40 `title` varchar(255) NOT NULL,
41 `start` datetime NOT NULL,
42 `end` datetime NOT NULL,
43 `question_package` int(11) NOT NULL,
44 `question_count` TEXT NOT NULL,
45 `duration` int(11) NOT NULL,
46 `question_random` int(1) NOT NULL DEFAULT '0' COMMENT '0:standard;1:random_question_by_topic_level;2:random_question_by_topic;2:random_question',
47 `answer_random` int(1) NOT NULL DEFAULT '0',
48 `result_show` tinyint(1) NOT NULL COMMENT 'tampilkan hasil ke peserta',
49 `enrol_singleton` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'satu user yang dapat enrol',
50 `enrol_auth` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'enrol with token?',
51 `enrol_token` varchar(255) DEFAULT NULL COMMENT 'mass token if enrol_auth',
52 `ip_allowed` text NOT NULL,
53 `timezone` int(2) DEFAULT '7' COMMENT '7: WIB;8:WITA;9:WIT',
54 `status` int(3) NOT NULL,
55 `created` datetime DEFAULT NULL,
56 `created_by` int(11) DEFAULT NULL,
57 `modified` datetime DEFAULT NULL,
58 `modified_by` int(11) DEFAULT NULL,
59 PRIMARY KEY (`id`)
60) ENGINE=InnoDB DEFAULT CHARSET=utf8;
61
62DROP TABLE IF EXISTS `program_test_participant`;
63CREATE TABLE `program_test_participant` (
64 `id` bigint(33) NOT NULL AUTO_INCREMENT,
65 `program_test_id` int(11) NOT NULL,
66 `participant_id` int(11) NOT NULL,
67 `question_order` text,
68 `answer` text,
69 `value` decimal(5,2) DEFAULT NULL,
70 `answer_validation` text,
71 `feedback` text,
72 `do_test` tinyint(1) DEFAULT '0',
73 `time_start` datetime DEFAULT NULL,
74 `time_elapsed` decimal(5,2) DEFAULT NULL,
75 `enrol_token` varchar(255) DEFAULT NULL,
76 `status` int(3) NOT NULL,
77 `created` datetime DEFAULT NULL,
78 `created_by` int(11) DEFAULT NULL,
79 `modified` datetime DEFAULT NULL,
80 `modified_by` int(11) DEFAULT NULL,
81 PRIMARY KEY (`id`),
82 UNIQUE KEY `program_test_participant_id` (`program_test_id`,`participant_id`)
83) ENGINE=InnoDB DEFAULT CHARSET=utf8;