2 rem Table structure for table choice
\r
5 drop TABLE prefix_choice;
\r
6 CREATE TABLE prefix_choice (
\r
7 id number(10) primary key,
\r
8 course number(10) default '0' not null,
\r
9 name varchar2(255) default '' not null,
\r
10 text varchar2(1024) NOT NULL,
\r
11 format number(2) default '0' not null,
\r
12 answer1 varchar2(255) default 'Yes' not null,
\r
13 answer2 varchar2(255) default 'No' not null,
\r
14 answer3 varchar2(255) default NULL,
\r
15 answer4 varchar2(255) default NULL,
\r
16 answer5 varchar2(255) default NULL,
\r
17 answer6 varchar2(255) default NULL,
\r
18 publish number(2) default '0' not null,
\r
19 timemodified number(10) default '0' not null
\r
22 COMMENT on table prefix_choice is 'Available choices are stored here.';
\r
24 drop sequence p_choice_seq;
\r
25 create sequence p_choice_seq;
\r
27 create or replace trigger p_choice_trig
\r
28 before insert on prefix_choice
\r
29 referencing new as new_row
\r
32 select p_choice_seq.nextval into :new_row.id from dual;
\r
37 insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(1,'name1','text1',1,'1','1','1','1','1','1',1,1);
\r
38 insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(2,'name2','text2',2,'2','2','2','2','2','2',2,2);
\r
39 insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(3,'name3','text3',3,'3','3','3','3','3','3',3,3);
\r
40 insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(4,'name4','text4',4,'4','4','4','4','4','4',4,4);
\r
42 select * from prefix_choice order by 1,2;
\r
44 rem --------------------------------------------------------
\r
47 rem Table structure for table choice_answers
\r
50 drop TABLE prefix_choice_answers;
\r
51 CREATE TABLE prefix_choice_answers (
\r
52 id number(10) primary key,
\r
53 choice number(10) default '0' not null,
\r
54 userid number(10) default '0' not null,
\r
55 answer number(4) default '0' not null,
\r
56 timemodified number(10) default '0' not null
\r
59 comment on table prefix_choice_answers is 'Answers for each choice';
\r
61 drop sequence p_choice_answers_seq;
\r
62 create sequence p_choice_answers_seq;
\r
64 create or replace trigger p_choice_answers_trig
\r
65 before insert on prefix_choice_answers
\r
66 referencing new as new_row
\r
69 select p_choice_answers_seq.nextval into :new_row.id from dual;
\r
74 insert into prefix_choice_answers (choice,userid,answer,timemodified) values(1,1,1,1);
\r
75 insert into prefix_choice_answers (choice,userid,answer,timemodified) values(2,2,2,2);
\r
76 insert into prefix_choice_answers (choice,userid,answer,timemodified) values(3,3,3,3);
\r
77 insert into prefix_choice_answers (choice,userid,answer,timemodified) values(4,4,4,4);
\r
79 select * from prefix_choice_answers order by 1,2;
\r
82 rem Dumping data for table log_display
\r
85 delete from prefix_log_display where module = 'choice';
\r
86 INSERT INTO prefix_log_display VALUES ('choice', 'view', 'choice', 'name');
\r
87 INSERT INTO prefix_log_display VALUES ('choice', 'update', 'choice', 'name');
\r
88 INSERT INTO prefix_log_display VALUES ('choice', 'add', 'choice', 'name');
\r
89 INSERT INTO prefix_log_display VALUES ('choice', 'report', 'choice', 'name');
\r