-- 2.0.0

USE `stmms_ft`;

ALTER TABLE eb_exam ADD COLUMN `mark_scroll_bottom` tinyint(1)  NOT NULL DEFAULT 0 COMMENT '评卷时强制试卷拉到底部';
ALTER TABLE eb_exam ADD COLUMN `min_mark_duration` int(11)  DEFAULT NULL  COMMENT '最小阅卷时长(秒)';
ALTER TABLE eb_exam ADD COLUMN `re_mark_limit_count` int(11)  DEFAULT NULL  COMMENT '单卷回评次数';
ALTER TABLE eb_exam ADD COLUMN `barcode_ai_check` tinyint(1)  NOT NULL DEFAULT 0 COMMENT '启用条码粘贴AI检测';
ALTER TABLE eb_exam ADD COLUMN `answer_ai_check` tinyint(1)  NOT NULL DEFAULT 0 COMMENT '启用题卡作答AI检测';


ALTER TABLE eb_marker ADD COLUMN `wait_arbitrate_count` int(11)     DEFAULT NULL COMMENT '待仲裁数';

ALTER TABLE eb_exam_student ADD COLUMN   `inspect_tag_user`     int(11)      DEFAULT NULL COMMENT '全卷复核标记人ID';
ALTER TABLE eb_exam_student ADD COLUMN   `inspect_tag_time`     datetime     DEFAULT NULL COMMENT '全卷复核标记时间';
ALTER TABLE eb_exam_student ADD COLUMN   `inspect_tag_flagged`  tinyint(1)   DEFAULT NULL COMMENT '全卷复核标记结果';

DROP TABLE IF EXISTS `m_reject_type`;
CREATE TABLE `m_reject_type`
(
    `id`        int(11)    NOT NULL AUTO_INCREMENT COMMENT '主键',
    `exam_id`   int(11)    NOT NULL COMMENT '考试ID',
    `name`      varchar(64) DEFAULT NULL COMMENT '名称',
    `is_custom` tinyint(1) NOT NULL COMMENT '是否自定义',
    PRIMARY KEY (`id`),
    KEY `index1` (`exam_id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4 COMMENT ='打回类型表';







-- 菜单权限  
TRUNCATE TABLE  b_privilege;
TRUNCATE TABLE  b_role_privilege;

-- 菜单权限  
INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('overview', '主页导览', 'root_code', 'MENU', 'HomeGuide', 10, 1, 'icon-bookmark', 'index.overview');

INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('user_list', '用户管理', 'root_code', 'MENU', 'UserManage', 20, 1, 'icon-user', 'index.user');

	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('user_list_help_video', '帮助视频', 'user_list', 'BUTTON', NULL, 10, 2, NULL, NULL);

INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('exam_list', '考试管理', 'root_code', 'MENU', 'ExamManage', 30, 1, 'icon-th-list', 'index.exam');

INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('exam_student', '考生管理', 'root_code', 'MENU', 'StudentManage', 40, 1, 'icon-user', 'index.student');

INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('exam_scan', '扫描进度', 'root_code', 'MENU', 'ScanManage', 50, 1, 'icon-print', 'index.scan');

INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('exam_paper', '科目管理', 'root_code', 'MENU', 'SubjectManage', 60, 1, 'icon-book', 'index.paper');

INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('exam_mark', '评卷管理', 'root_code', 'MENU', 'mark', 70, 1, 'icon-pencil', 'index.mark');

	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('mark_progress', '评卷进度', 'exam_mark', 'MENU', 'MarkProgress', 10, 2, NULL, NULL);
	
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('subject_mark_manage', '科目评卷管理', 'exam_mark', 'MENU', 'SubjectMarkManage', 20, 2, NULL, NULL);

		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('mark_group', '分组管理', 'subject_mark_manage', 'PAGE', NULL, 10, 3, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('group_query', '查询', 'mark_group', 'BUTTON', NULL, 10, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('group_add', '新增', 'mark_group', 'BUTTON', NULL, 20, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('group_close', '关闭评卷', 'mark_group', 'BUTTON', NULL, 30, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('group_count', '设置试评数量', 'mark_group', 'BUTTON', NULL, 40, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('group_paperview', '全卷预览', 'mark_group', 'BUTTON', NULL, 50, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('group_view', '分组预览', 'mark_group', 'BUTTON', NULL, 60, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('group_edit', '修改', 'mark_group', 'BUTTON', NULL, 70, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('group_reset_edit', '重置修改', 'mark_group', 'BUTTON', NULL, 80, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('group_delete', '删除', 'mark_group', 'BUTTON', NULL, 90, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('mark_group_help_video', '帮助视频', 'mark_group', 'BUTTON', NULL, 100, 4, NULL, NULL);

		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('marker', '评卷员管理', 'subject_mark_manage', 'PAGE', NULL, 20, 3, NULL, NULL);
		
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('marker_query', '查询', 'marker', 'BUTTON', NULL, 10, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('marker_enable', '启用', 'marker', 'BUTTON', NULL, 20, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('marker_disable', '禁用', 'marker', 'BUTTON', NULL, 30, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('marker_reset_pass', '重置密码', 'marker', 'BUTTON', NULL, 40, 4, NULL, NULL);
		
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('marker_reset', '重置', 'marker', 'BUTTON', NULL, 50, 4, NULL, NULL);
			
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('mark_trial', '试评管理', 'subject_mark_manage', 'PAGE', NULL, 30, 3, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('mark_trial_query', '查询', 'mark_trial', 'BUTTON', NULL, 10, 4, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('mark_library', '任务管理', 'subject_mark_manage', 'PAGE', NULL, 40, 3, NULL, NULL);
		
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('mark_library_query', '查询', 'mark_library', 'BUTTON', NULL, 10, 4, NULL, NULL);
		
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('mark_library_inspect', '复核', 'mark_library', 'BUTTON', NULL, 20, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('mark_library_view', '查看试卷', 'mark_library', 'BUTTON', NULL, 30, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('mark_library_reject', '打回', 'mark_library', 'BUTTON', NULL, 40, 4, NULL, NULL);
			
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('mark_arbitrate', '仲裁管理', 'subject_mark_manage', 'PAGE', NULL, 50, 3, NULL, NULL);
		
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('mark_arbitrate_query', '查询', 'mark_arbitrate', 'BUTTON', NULL, 10, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('mark_arbitrate_batch_dis', '批量处理', 'mark_arbitrate', 'BUTTON', NULL, 20, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('mark_arbitrate_dis', '处理', 'mark_arbitrate', 'BUTTON', NULL, 30, 4, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('mark_quality', '质量监控', 'subject_mark_manage', 'PAGE', NULL,60, 3, NULL, NULL);
		
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('subject_arbitrate_report', '科目仲裁统计', 'mark_quality', 'BUTTON', NULL, 10, 4, NULL, NULL);
			
			INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
			VALUES ('marker_arbitrate_report', '评卷员仲裁统计', 'mark_quality', 'BUTTON', NULL, 20, 4, NULL, NULL);
		
		
INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('reject_manage', '打回卷管理', 'root_code', 'MENU', 'back', 80, 1, 'icon-bookmark', 'index.reject');

	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('reject_list', '打回卷', 'reject_manage', 'MENU', 'RejectManage', 10, 2, NULL, NULL);
	
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('reject_list_query', '查询', 'reject_list', 'BUTTON', NULL, 10, 3, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('reject_list_info', '试卷详情', 'reject_list', 'BUTTON', NULL, 20, 3, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('reject_list_assigned', '任务指定', 'reject_list', 'BUTTON', NULL, 30, 3, NULL, NULL);
		
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('reject_report', '打回统计', 'reject_manage', 'MENU', 'RejectStatistics', 20, 2, NULL, NULL);
	
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('subject_reject_report', '科目打回统计', 'reject_report', 'BUTTON', NULL, 10, 3, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('marker_reject_report', '评卷员打回统计', 'reject_report', 'BUTTON', NULL, 20, 3, NULL, NULL);
	
INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('problem_history', '问题卷管理', 'root_code', 'MENU', 'IssuePaper', 90, 1, 'icon-tag', 'index.problem');

		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('problem_query', '查询', 'problem_history', 'BUTTON', NULL, 10, 2, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('problem_batch_reset', '批量重置', 'problem_history', 'BUTTON', NULL, 20, 2, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('problem_export', '导出', 'problem_history', 'BUTTON', NULL, 30, 2, NULL, NULL);

		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('problem_reset', '重置', 'problem_history', 'BUTTON', NULL, 40, 2, NULL, NULL);

INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('inspected', '成绩复核', 'root_code', 'MENU', 'ScoreReview', 100, 1, 'icon-flag', 'index.inspected');

	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('inspected_report', '复核进度统计', 'inspected', 'MENU', 'ScoreReviewStatistics', 10, 2, NULL, NULL);
	
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('inspected_report_query', '查询', 'inspected_report', 'BUTTON', NULL, 10, 3, NULL, NULL);
	
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('paper_inspected', '全卷复核', 'inspected', 'MENU', 'AllReview', 20, 2, NULL, NULL);
	
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('paper_inspected_query', '查询', 'paper_inspected', 'BUTTON', NULL, 10, 3, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('paper_inspected_batch', '批量复核', 'paper_inspected', 'BUTTON', NULL, 20, 3, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('paper_inspected_cancel', '取消复核', 'paper_inspected', 'BUTTON', NULL, 30, 3, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('paper_inspected_track', '轨迹图', 'paper_inspected', 'BUTTON', NULL, 40, 3, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('paper_inspected_dispose', '进入复核', 'paper_inspected', 'BUTTON', NULL, 50, 3, NULL, NULL);
	
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('paper_inspected_round', '再次复核', 'paper_inspected', 'BUTTON', NULL, 60, 3, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('paper_inspected_help_video', '帮助视频', 'paper_inspected', 'BUTTON', NULL, 70, 3, NULL, NULL);
		
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('score_verify', '成绩校验', 'inspected', 'MENU', 'ScoreCheck', 30, 2, NULL, NULL);


INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('exam_score', '成绩查询', 'root_code', 'MENU', 'ScoreQuery', 110, 1, 'icon-search', 'index.score');

	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('exam_score_query', '查询', 'exam_score', 'BUTTON', NULL, 10, 2, NULL, NULL);

	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('exam_score_export', '导出', 'exam_score', 'BUTTON', NULL, 20, 2, NULL, NULL);
	
INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('exam_report_subject', '科目分析', 'root_code', 'MENU', 'AnalysisManage', 120, 1, 'icon-asterisk', 'index.report.subject');

	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('report_subject_total', '总量分析', 'exam_report_subject', 'PAGE', NULL, 10, 2, NULL, NULL);
	
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('report_subject_total_eport', '导出总表', 'report_subject_total', 'BUTTON', NULL, 20, 2, NULL, NULL);
		
		INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
		VALUES ('report_subject_total_refresh', '刷新', 'report_subject_total', 'BUTTON', NULL, 20, 2, NULL, NULL);
	
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('report_subject_range', '分段统计', 'exam_report_subject', 'PAGE', NULL, 20, 2, NULL, NULL);
	
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('report_subject_college', '学院分析', 'exam_report_subject', 'PAGE', NULL, 30, 2, NULL, NULL);
	
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('report_subject_teacher', '任课老师分析', 'exam_report_subject', 'PAGE', NULL, 40, 2, NULL, NULL);
	
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('report_subject_class', '班级分析', 'exam_report_subject', 'PAGE', NULL, 50, 2, NULL, NULL);
	
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('report_subject_objective_question', '客观题分析', 'exam_report_subject', 'PAGE', NULL, 60, 2, NULL, NULL);
	
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('report_subject_subjective_question', '主观题分析', 'exam_report_subject', 'PAGE', NULL, 70, 2, NULL, NULL);
	
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('report_subject_group', '大题分析', 'exam_report_subject', 'PAGE', NULL, 80, 2, NULL, NULL);
	
INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('exam_check_answer', '数据检查', 'root_code', 'MENU', 'DataCheck', 130, 1, 'icon-check', 'index.check');

	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('manual_confirm', '人工确认', 'exam_check_answer', 'MENU', 'ManualConfirm', 10, 2, NULL, NULL);
	
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('result_check', '识别结果检查', 'exam_check_answer', 'MENU', 'ResultCheck', 20, 2, NULL, NULL);
	
	INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
	VALUES ('image_check', '图片检查', 'exam_check_answer', 'MENU', 'ImageCheck', 30, 2, NULL, NULL);

INSERT INTO `b_privilege` (`code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`, `level`, `icon`, `i18n`) 
VALUES ('operation_log', '操作日志', 'root_code', 'MENU', 'LogManage', 140, 1, 'icon-tasks', 'index.log');


  
INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
SELECT s.id,'SCHOOL_ADMIN',p.`code`,1 from b_privilege p join b_school s;

INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
SELECT s.id,'SUBJECT_HEADER',p.`code`,1 from b_privilege p join b_school s
where p.`code` in('exam_mark','mark_progress','subject_mark_manage','mark_group','group_query','marker','marker_query','marker_reset_pass','mark_trial',
'mark_trial_query','mark_library','mark_library_query','mark_library_inspect','mark_library_view','mark_library_reject','mark_arbitrate','mark_arbitrate_query',
'mark_arbitrate_batch_dis','mark_arbitrate_dis','mark_quality','subject_arbitrate_report','marker_arbitrate_report','reject_manage','reject_list',
'reject_list_query','reject_list_info','reject_list_assigned','reject_report','subject_reject_report','marker_reject_report','problem_history','problem_query',
'problem_batch_reset','problem_reset','inspected','inspected_report','inspected_report_query','paper_inspected','paper_inspected_query','paper_inspected_batch',
'paper_inspected_cancel','paper_inspected_track','paper_inspected_dispose','paper_inspected_round','exam_score','exam_score_query','exam_report_subject',
'report_subject_total','report_subject_total_refresh','report_subject_range','report_subject_college','report_subject_objective_question',
'report_subject_subjective_question','report_subject_group'
);

INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
SELECT s.id,'COLLEGE_ADMIN',p.`code`,1 from b_privilege p join b_school s
where p.`code` in('exam_mark','mark_progress','subject_mark_manage','mark_group','group_query','marker','marker_query','marker_reset_pass','mark_trial',
'mark_trial_query','mark_library','mark_library_query','mark_library_inspect','mark_library_view','mark_library_reject','mark_arbitrate','mark_arbitrate_query',
'mark_arbitrate_batch_dis','mark_arbitrate_dis','mark_quality','subject_arbitrate_report','marker_arbitrate_report','reject_manage','reject_list',
'reject_list_query','reject_list_info','reject_list_assigned','reject_report','subject_reject_report','marker_reject_report','problem_history','problem_query',
'problem_batch_reset','problem_reset','inspected','inspected_report','inspected_report_query','paper_inspected','paper_inspected_query','paper_inspected_batch',
'paper_inspected_cancel','paper_inspected_track','paper_inspected_dispose','paper_inspected_round','exam_score','exam_score_query','exam_score_export',
'exam_report_subject','report_subject_total','report_subject_total_eport''report_subject_total_refresh','report_subject_range','report_subject_college',
'report_subject_teacher','report_subject_class','report_subject_objective_question','report_subject_subjective_question','report_subject_group'
);

INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
SELECT s.id,'INSPECTOR',p.`code`,1 from b_privilege p join b_school s
where p.`code` in('inspected','inspected_report','inspected_report_query','paper_inspected','paper_inspected_query','paper_inspected_batch',
'paper_inspected_cancel','paper_inspected_track','paper_inspected_dispose','paper_inspected_round');

INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
SELECT s.id,'SCHOOL_VIEWER',p.`code`,1 from b_privilege p join b_school s
where p.`code` in('exam_score','exam_score_query','exam_report_subject','report_subject_total','report_subject_total_refresh','operation_log');


INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
SELECT s.id,'SUBJECT_HEADER',p.`code`,0 from b_privilege p join b_school s
where p.`code` in('group_add','group_close','group_count','group_paperview','group_view','group_edit','group_reset_edit','group_delete' ,
'marker_enable','marker_disable','problem_export','exam_score_export','report_subject_total_eport','report_subject_teacher','report_subject_class');

INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
SELECT s.id,'COLLEGE_ADMIN',p.`code`,0 from b_privilege p join b_school s
where p.`code` in('group_add','group_close','group_count','group_paperview','group_view','group_edit','group_reset_edit','group_delete','marker_enable',
'marker_disable','problem_export');
