package cn.hmsoft.ltc.common.util;

import java.io.InputStreamReader;
import java.io.Reader;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;

import cn.hmsoft.ltc.model.Users;

public class Consts {

    public static final String key = "qmth~!@#$%^&*()_+}{:?><9876543210";

    /**
     * 对外交互文件的加密密钥
     */
    public static final String keyForService = "qmth~!@#$%^&*()_+}{:?><9876543210_fj_mt_rgf";

    /**
     * 用户信息缓存对象，Key为用户ID，Value为用户对象。此缓存在com.qmth.qrzk.web.listener.
     * LoadConfListener启动时加载，当用户信息更新时同步刷新此缓存对象
     */
    public static Map<Integer, Users> UserMap = new HashMap<Integer, Users>();
    /**
     * 在线用户数据,Key为sessionID
     */
//    public static Map<String, OLUser> OLUserMap = new LinkedHashMap<String, OLUser>();
    
    /**
     * 课程最大的题号索引值对应Map，key为课程code，vale为对应的最大索引值。程序初始化时加载该Map
     */
    public static Map<String,Integer> CourseLastIndexMap = new HashMap<String, Integer>();
    
    /**
     * 字典值显示值字典，key为itemType-itemCode，value为itemValue。程序初始化时加载该Map
     */
    public static Map<String,String> CodeTextMap = new HashMap<String, String>();

    /**
     * DOCX文件版本属性名：cp:version
     */
    public static final String DOCX_VERSION = "cp:version";
    
    /**
     * 过期时间：1天
     */
    public static final long OVERDUE_TIME_MILLIS = 24 * 3600L * 1000L;
    

    /**
     * 试卷任务的状态值列表
     * 
     * @author Horse
     *
     */
    public static class PaperTaskStatus {

        public static final String TO_CREATE_SKEL = "TO_CREATE_SKEL";// 提交细目表

        public static final String TO_AUDIT_SKEL = "TO_AUDIT_SKEL";// 审核细目表

        public static final String GENERATE_PAPER = "GENERATE_PAPER";// 组卷

        public static final String TYPESET = "TYPESET";// 预排版

        public static final String TO_AUDIT_PAPER = "TO_AUDIT_PAPER";// 试卷审核

        public static final String TO_CHECK_PAPER = "TO_CHECK_PAPER";// 试卷校对

        public static final String FINAL_TYPESET = "FINAL_TYPESET";// 终排版

        public static final String TO_ARCHIVE = "TO_ARCHIVE";// 待归档

        public static final String ARCHIVED = "ARCHIVED";// 已归档

        public static final Map<String, String> dicMap = new LinkedHashMap<String, String>();
        static {
            dicMap.put(TO_CREATE_SKEL, "提交细目表");
            dicMap.put(TO_AUDIT_SKEL, "审核细目表");
            dicMap.put(GENERATE_PAPER, "组卷");
            dicMap.put(TYPESET, "预排版");
            dicMap.put(TO_AUDIT_PAPER, "试卷审核");
            dicMap.put(TO_CHECK_PAPER, "试卷校对");
            dicMap.put(FINAL_TYPESET, "终排版");
            dicMap.put(TO_ARCHIVE, "待归档");
            dicMap.put(ARCHIVED, "已归档");
        }
    }
    
    /**
     * 复审任务的状态值列表
     * 
     * @author Horse
     *
     */
    public static class ReviewTaskStatus {

        public static final String TO_AUDIT_PAPER = "TO_AUDIT_PAPER_REVIEW";// 试卷审核

//        public static final String TO_ARCHIVE = "TO_ARCHIVE_REVIEW";// 待归档

        public static final String ARCHIVED = "ARCHIVED_REVIEW";// 已归档

        public static final Map<String, String> dicMap = new LinkedHashMap<String, String>();
        static {
            dicMap.put(TO_AUDIT_PAPER, "试卷审核");
//            dicMap.put(TO_ARCHIVE, "待归档");
            dicMap.put(ARCHIVED, "已归档");
        }
    }

    public static class TaskBatchType {

    	/**
    	 * 入闱命题
    	 */
        public static final String RU_WEI_MING_TI = "RU_WEI_MING_TI";

        /**
         * 题库建设
         */
        public static final String TI_KU_JIAN_SHE = "TI_KU_JIAN_SHE";

        /**
         * 题卡审核
         */
        public static final String SHEN_TI = "SHEN_TI";
        
        /**
         * 题卡录入
         */
        public static final String TI_KA_LU_RU = "TI_KA_LU_RU";
        
        /**
         * 试卷复审
         */
        public static final String SHI_JUAN_FU_SHEN = "SHI_JUAN_FU_SHEN";

        public static final Map<String, String> dicMap = new LinkedHashMap<String, String>();
        static {
            dicMap.put(RU_WEI_MING_TI, "入闱命题");
            dicMap.put(SHEN_TI, "题卡审核");
            dicMap.put(TI_KA_LU_RU, "题卡录入");
            dicMap.put(TI_KU_JIAN_SHE, "题库建设");
            dicMap.put(SHI_JUAN_FU_SHEN, "试卷复审");
        }
    }

    /**
     * 在组卷的时候题的操作类型
     * 
     * @author Horse
     *
     */
    public static class QuesOperTypeForZj {

        /**
         * 添加题到试卷中
         */
        public static String ADD_INTO_PAPER = "ADD_INTO_PAPER";

        /**
         * 替换或试卷中的试题
         */
        public static String CHANGE_INTO_PAPER = "CHANGE_INTO_PAPER";

        /**
         * 更新试卷中的试题
         */
        public static String UPDATE_INTO_PAPER = "UPDATE_INTO_PAPER";
    }

    /**
     * 附件的状态值列表
     * 
     * @author Horse
     *
     */
    public static class AttachmentStatus {

        public static final String DRAFT = "DRAFT";// 草稿

        public static final String USING = "USING";// 正在使用

        public static final String DELETEED = "DELETEED";// 已删除
        
        public static final String BACKUP = "BACKUP";// 数据库备份
    }

    /**
     * Word附件的类型
     * 
     * @author Horse
     *
     */
    public static class WordType {

        public static final String PAPER = "PAPER";// 试卷Word

        public static final String WANGPING = "WANGPING";// 网评卷Word

        public static final String TIKA = "TIKA";// 题卡Word

        public static final String ANSWER = "ANSWER";// 答案Word

        public static final String ZHUANYIN = "ZHUANYIN";// 转印说明
        
        public static final String HJ = "HJ";// 合卷

        public static final String DA = "DA";// 答案

        public static final String WPJ = "WPJ";// 网评卷

        public static final String ZK = "ZK";// 专卡

        public static final String ZY = "ZY";// 转印说明
    }

    /**
     * 题卡类型
     * 
     * @author Horse
     *
     */
    public static class TikaType {
        public static final String NORMAL = "NORMAL";// 通用题卡
        public static final String SPECIAL = "SPECIAL";// 专用题卡
    }

    /**
     * 教材状态
     * 
     * @author Horse
     *
     */
    public static class BookStatus {

        public static final int DISABLED = 0;

        public static final int USED = 1;

        public static final Map<Integer, String> dicMap = new LinkedHashMap<Integer, String>();
        static {
            dicMap.put(DISABLED, "停用");
            dicMap.put(USED, "启用");
        }
    }

    /**
     * 课程状态
     * 
     * @author Horse
     *
     */
    public static class CourseStatus {

        public static final int DISABLED = 0;

        public static final int USED = 1;

        public static final Map<Integer, String> dicMap = new LinkedHashMap<Integer, String>();
        static {
            dicMap.put(DISABLED, "停考");
            dicMap.put(USED, "开考");
        }
    }

    /**
     * 课程类型
     * 
     * @author Horse
     *
     */
    public static class CourseType {

        public static final int PROVINCE = 0;

        public static final int COUNTRY = 1;

        public static final Map<Integer, String> dicMap = new LinkedHashMap<Integer, String>();
        static {
            dicMap.put(PROVINCE, "省考");
            dicMap.put(COUNTRY, "国考");
        }
    }

    /**
     * 教材在课程中的状态枚举：0停用，1启用，2未使用
     * 
     * @author Horse
     *
     */
    public static class BookInCourseStatus {

        public static final int DISABLED = 0;

        public static final int USED = 1;

        public static final int UNUSED = 2;

        public static final Map<Integer, String> dicMap = new LinkedHashMap<Integer, String>();
        static {
            dicMap.put(DISABLED, "停用");
            dicMap.put(USED, "启用");
            dicMap.put(UNUSED, "未使用");
        }
    }

    /**
     * 试卷来源： 1智能 2手工
     * 
     * @author Horse
     *
     */
    public static class PaperResourse {

        /**
         * 智能
         */
        public static final int INTELLIGENCE = 1;

        /**
         * 手工
         */
        public static final int MANUAL = 2;

        public static final Map<Integer, String> dicMap = new LinkedHashMap<Integer, String>();
        static {
            dicMap.put(INTELLIGENCE, "智能");
            dicMap.put(MANUAL, "手工");
        }
    }

    /**
     * 试卷状态 0草稿 1内容待审批 2内容审批通过 3启用 4内容审批拒绝
     * 
     * @author Horse
     *
     */
    public static class PaperStatus {

        public static final int DRAFT = 0;

        public static final int TOAPPROVE = 1;

        public static final int APPROVED = 2;

        public static final int ENABLED = 3;

        public static final int REJECTED = 4;

        public static final Map<Integer, String> dicMap = new LinkedHashMap<Integer, String>();
        static {
            dicMap.put(DRAFT, "草稿");
            dicMap.put(TOAPPROVE, "待审核");
            dicMap.put(APPROVED, "审核通过");
            dicMap.put(ENABLED, "启用");
            dicMap.put(REJECTED, "审核拒绝");
        }
    }

    /**
     * 细目表状态 0草稿 1待审核 2审核通过 3启用 4审核拒绝
     * 
     * @author Horse
     *
     */
    public static class SkeletonStatus {

        public static final int DRAFT = 0;

        public static final int TOAPPROVE = 1;

        public static final int APPROVED = 2;

        public static final int ENABLED = 3;

        public static final int REJECTED = 4;

        public static final Map<Integer, String> dicMap = new LinkedHashMap<Integer, String>();
        static {
            dicMap.put(DRAFT, "草稿");
            dicMap.put(TOAPPROVE, "待审核");
            dicMap.put(APPROVED, "审核通过");
            dicMap.put(ENABLED, "启用");
            dicMap.put(REJECTED, "审核拒绝");
        }
    }

    /**
     * 审核类型 2通过 4 驳回
     * 
     * @author Horse
     *
     */
    public static class AuditStatus {

        public static final int APPROVE = 2;

        public static final int REFUSED = 4;

        public static final Map<Integer, String> dicMap = new LinkedHashMap<Integer, String>();
        static {
            dicMap.put(APPROVE, "通过");
            dicMap.put(REFUSED, "退回");
        }
    }
    
    /**
     * 消息状态 1未读 2 已读
     * 
     * @author sunjun
     *
     */
    public static class MsgStatus {

        public static final int NOREAD = 1;

        public static final int READ = 2;

        public static final Map<Integer, String> dicMap = new LinkedHashMap<Integer, String>();
        static {
            dicMap.put(NOREAD, "未读");
            dicMap.put(READ, "已读");
        }
    }

    /**
     * 操作日志记录里面的对象类型
     * 
     * @author Horse
     *
     */
    public static class OperLogObjType {

        /**
         * 试卷
         */
        public static final String PagerConstruct = "PagerConstruct";

        /**
         * 试卷细目表
         */
        public static final String PaperSkeleton = "PaperSkeleton";

        /**
         * 试题
         */
        public static final String Question = "Question";
    }

    /**
     * 默认的试卷标题
     */
    public static final String DEFAULT_HEAD = "XXXX年XX月湖北省高等教育自学考试";

    /**
     * 无法把试题的html转成word，或者正常解析Word的对应提示信息
     */
    public static final String ERR_QUS_MSG = "【此题无法解析，请核对原始试题，题号:%s】";

    /**
     * 无法把试题答案的html转成word，或者正常解析Word的对应提示信息
     */
    public static final String ERR_ANSWER_MSG = "【此题答案无法解析，请核对原始试题，题号:%s】";

    /**
     * 无法把答题项的html转成word，或者正常解析Word的对应提示信息
     */
    public static final String ERR_QUS_OPT_MSG = "【此选项无法解析，请核对原始试题，题号:%s】";

    /**
     * 提示错误的显示区域
     */
    public static final String ERR_P_TMP = "<w:p w:rsidR=\"009E6E9E\" w:rsidRPr=\"009E6E9E\" w:rsidRDefault=\"007829C6\" w:rsidP=\"009E6E9E\"><w:r w:rsidRPr=\"007829C6\"><w:rPr><w:rFonts w:hint=\"eastAsia\"/><w:color w:val=\"FF0000\"/><w:sz w:val=\"20\"/></w:rPr><w:t>XX</w:t></w:r></w:p>";

    /**
     * 一行四个答案的Table模板字符串
     */
    public static final String OPT_TABLE_TMP_1 = "<w:tbl><w:tblPr><w:tblStyle w:val=\"a5\"/><w:tblW w:w=\"0\" w:type=\"auto\"/><w:tblInd w:w=\"400\" w:type=\"dxa\"/><w:tblBorders><w:top w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:left w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:bottom w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:right w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:insideH w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:insideV w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/></w:tblBorders><w:tblLook w:val=\"04A0\" w:firstRow=\"1\" w:lastRow=\"0\" w:firstColumn=\"1\" w:lastColumn=\"0\" w:noHBand=\"0\" w:noVBand=\"1\"/></w:tblPr><w:tblGrid><w:gridCol w:w=\"2130\"/><w:gridCol w:w=\"2130\"/><w:gridCol w:w=\"2131\"/><w:gridCol w:w=\"2131\"/></w:tblGrid><w:tr w:rsidR=\"00285782\" w:rsidTr=\"00587AD0\"><w:tc><w:tcPr><w:tcW w:w=\"2130\" w:type=\"dxa\"/></w:tcPr>A_A.</w:tc><w:tc><w:tcPr><w:tcW w:w=\"2130\" w:type=\"dxa\"/></w:tcPr>B_B.</w:tc><w:tc><w:tcPr><w:tcW w:w=\"2131\" w:type=\"dxa\"/></w:tcPr>C_C.</w:tc><w:tc><w:tcPr><w:tcW w:w=\"2131\" w:type=\"dxa\"/></w:tcPr>D_D.</w:tc></w:tr></w:tbl>";

    /**
     * 一行两个答案的Table模板字符串
     */
    public static final String OPT_TABLE_TMP_2 = "<w:tbl><w:tblPr><w:tblStyle w:val=\"a5\"/><w:tblW w:w=\"0\" w:type=\"auto\"/><w:tblInd w:w=\"400\" w:type=\"dxa\"/><w:tblBorders><w:top w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:left w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:bottom w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:right w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:insideH w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:insideV w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/></w:tblBorders><w:tblLook w:val=\"04A0\" w:firstRow=\"1\" w:lastRow=\"0\" w:firstColumn=\"1\" w:lastColumn=\"0\" w:noHBand=\"0\" w:noVBand=\"1\"/></w:tblPr><w:tblGrid><w:gridCol w:w=\"4261\"/><w:gridCol w:w=\"4261\"/></w:tblGrid><w:tr w:rsidR=\"00285782\" w:rsidTr=\"00587AD0\"><w:tc><w:tcPr><w:tcW w:w=\"4261\" w:type=\"dxa\"/></w:tcPr>A_A.</w:tc><w:tc><w:tcPr><w:tcW w:w=\"4261\" w:type=\"dxa\"/></w:tcPr>B_B.</w:tc></w:tr><w:tr w:rsidR=\"00285782\" w:rsidTr=\"00587AD0\"><w:tc><w:tcPr><w:tcW w:w=\"4261\" w:type=\"dxa\"/></w:tcPr>C_C.</w:tc><w:tc><w:tcPr><w:tcW w:w=\"4261\" w:type=\"dxa\"/></w:tcPr>D_D.</w:tc></w:tr></w:tbl>";

    /**
     * 5个答案一行的Tab内容模板
     */
    public static final String OPT_TAB_5_TEMP = "<w:p w:rsidR=\"00B46DD1\" w:rsidRPr=\"00510D6C\" w:rsidRDefault=\"00B46DD1\" w:rsidP=\"00FA305D\"><w:pPr><w:tabs><w:tab w:val=\"left\" w:pos=\"A_NUM\"/><w:tab w:val=\"left\" w:pos=\"B_NUM\"/><w:tab w:val=\"left\" w:pos=\"C_NUM\"/><w:tab w:val=\"left\" w:pos=\"D_NUM\"/><w:tab w:val=\"left\" w:pos=\"E_NUM\"/></w:tabs><w:spacing w:line=\"340\" w:lineRule=\"exact\"/><w:rPr><w:rFonts w:hint=\"eastAsia\"/><w:bCs/><w:szCs w:val=\"28\"/></w:rPr></w:pPr><w:r w:rsidRPr=\"00510D6C\"><w:rPr><w:rFonts w:hint=\"eastAsia\"/><w:bCs/><w:szCs w:val=\"28\"/></w:rPr><w:tab/><w:t>A#A</w:t></w:r><w:r w:rsidRPr=\"00510D6C\"><w:rPr><w:rFonts w:hint=\"eastAsia\"/><w:bCs/><w:szCs w:val=\"28\"/></w:rPr><w:tab/><w:t>B#B</w:t></w:r><w:r w:rsidRPr=\"00510D6C\"><w:rPr><w:rFonts w:hint=\"eastAsia\"/><w:bCs/><w:szCs w:val=\"28\"/></w:rPr><w:tab/><w:t>C#C</w:t></w:r><w:r w:rsidRPr=\"00510D6C\"><w:rPr><w:rFonts w:hint=\"eastAsia\"/><w:bCs/><w:szCs w:val=\"28\"/></w:rPr><w:tab/><w:t>D#D</w:t></w:r><w:r w:rsidRPr=\"00510D6C\"><w:rPr><w:rFonts w:hint=\"eastAsia\"/><w:bCs/><w:szCs w:val=\"28\"/></w:rPr><w:tab/><w:t>E#E</w:t></w:r></w:p>";

    public static final int[] OPT_TAB_SPACE_ARR = {420,2100,3780,5460,7140};
    
    /**
     * 5个答案一行的行内容模板
     */
    public static final String OPT_TABLE_ROW_TEMP = "<w:tr w:rsidR=\"00285782\" w:rsidTr=\"00587AD0\"><w:tc><w:tcPr><w:tcW w:w=\"1900\" w:type=\"dxa\"/></w:tcPr>#column1#</w:tc><w:tc><w:tcPr><w:tcW w:w=\"1900\" w:type=\"dxa\"/></w:tcPr>#column2#</w:tc><w:tc><w:tcPr><w:tcW w:w=\"1900\" w:type=\"dxa\"/></w:tcPr>#column3#</w:tc><w:tc><w:tcPr><w:tcW w:w=\"1900\" w:type=\"dxa\"/></w:tcPr>#column4#</w:tc><w:tc><w:tcPr><w:tcW w:w=\"922\" w:type=\"dxa\"/></w:tcPr>#column5#</w:tc></w:tr>";

    /**
     * 第1行3个答案，第2行2个答案的Table模板字符串（用于多项选择题）
     */
    public static final String OPT_TABLE_TMP_3 = "<w:tbl><w:tblPr><w:tblStyle w:val=\"a7\"/><w:tblW w:w=\"0\" w:type=\"auto\"/><w:tblInd w:w=\"400\" w:type=\"dxa\"/><w:tblBorders><w:top w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:left w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:bottom w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:right w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:insideH w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:insideV w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/></w:tblBorders><w:tblLook w:val=\"04A0\" w:firstRow=\"1\" w:lastRow=\"0\" w:firstColumn=\"1\" w:lastColumn=\"0\" w:noHBand=\"0\" w:noVBand=\"1\"/></w:tblPr><w:tblGrid><w:gridCol w:w=\"2952\"/><w:gridCol w:w=\"2952\"/><w:gridCol w:w=\"2952\"/></w:tblGrid><w:tr w:rsidR=\"00F53E7F\" w:rsidTr=\"00F53E7F\"><w:tc><w:tcPr><w:tcW w:w=\"2952\" w:type=\"dxa\"/></w:tcPr>A_A.</w:tc><w:tc><w:tcPr><w:tcW w:w=\"2952\" w:type=\"dxa\"/></w:tcPr>B_B.</w:tc><w:tc><w:tcPr><w:tcW w:w=\"2952\" w:type=\"dxa\"/></w:tcPr>C_C.</w:tc></w:tr><w:tr w:rsidR=\"00F53E7F\" w:rsidTr=\"00F53E7F\"><w:tc><w:tcPr><w:tcW w:w=\"2952\" w:type=\"dxa\"/></w:tcPr>D_D.</w:tc><w:tc><w:tcPr><w:tcW w:w=\"5904\" w:type=\"dxa\"/><w:gridSpan w:val=\"2\"/></w:tcPr>E_E.</w:tc></w:tr></w:tbl>";

    /**
     * 每行1列的4行的Table模板字符串（用于单项选择题）
     */
    public static final String OPT_TABLE_TMP_4X1 = "<w:tbl><w:tblPr><w:tblStyle w:val=\"a3\"/><w:tblW w:w=\"0\" w:type=\"auto\"/><w:tblInd w:w=\"400\" w:type=\"dxa\"/><w:tblBorders><w:top w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:left w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:bottom w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:right w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:insideH w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:insideV w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/></w:tblBorders><w:tblLook w:val=\"04A0\" w:firstRow=\"1\" w:lastRow=\"0\" w:firstColumn=\"1\" w:lastColumn=\"0\" w:noHBand=\"0\" w:noVBand=\"1\"/></w:tblPr><w:tblGrid><w:gridCol w:w=\"8130\"/></w:tblGrid><w:tr w:rsidR=\"00A5416B\" w:rsidTr=\"00705032\"><w:tc><w:tcPr><w:tcW w:w=\"8130\" w:type=\"dxa\"/></w:tcPr>A_A.</w:tc></w:tr><w:tr w:rsidR=\"00A5416B\" w:rsidTr=\"00EE31D1\"><w:tc><w:tcPr><w:tcW w:w=\"8130\" w:type=\"dxa\"/></w:tcPr>B_B.</w:tc></w:tr><w:tr w:rsidR=\"00A5416B\" w:rsidTr=\"0043588F\"><w:tc><w:tcPr><w:tcW w:w=\"8130\" w:type=\"dxa\"/></w:tcPr>C_C.</w:tc></w:tr><w:tr w:rsidR=\"00A5416B\" w:rsidTr=\"003610FD\"><w:tc><w:tcPr><w:tcW w:w=\"8130\" w:type=\"dxa\"/></w:tcPr>D_D.</w:tc></w:tr></w:tbl>";

    /**
     * 每行1列的5行的Table模板字符串（用于单项选择题）
     */
    public static final String OPT_TABLE_TMP_5X1 = "<w:tbl><w:tblPr><w:tblStyle w:val=\"a3\"/><w:tblW w:w=\"0\" w:type=\"auto\"/><w:tblInd w:w=\"400\" w:type=\"dxa\"/><w:tblBorders><w:top w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:left w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:bottom w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:right w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:insideH w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/><w:insideV w:val=\"none\" w:sz=\"0\" w:space=\"0\" w:color=\"auto\"/></w:tblBorders><w:tblLook w:val=\"04A0\" w:firstRow=\"1\" w:lastRow=\"0\" w:firstColumn=\"1\" w:lastColumn=\"0\" w:noHBand=\"0\" w:noVBand=\"1\"/></w:tblPr><w:tblGrid><w:gridCol w:w=\"8130\"/></w:tblGrid><w:tr w:rsidR=\"00A5416B\" w:rsidTr=\"00705032\"><w:tc><w:tcPr><w:tcW w:w=\"8130\" w:type=\"dxa\"/></w:tcPr>A_A.</w:tc></w:tr><w:tr w:rsidR=\"00A5416B\" w:rsidTr=\"00EE31D1\"><w:tc><w:tcPr><w:tcW w:w=\"8130\" w:type=\"dxa\"/></w:tcPr>B_B.</w:tc></w:tr><w:tr w:rsidR=\"00A5416B\" w:rsidTr=\"0043588F\"><w:tc><w:tcPr><w:tcW w:w=\"8130\" w:type=\"dxa\"/></w:tcPr>C_C.</w:tc></w:tr><w:tr w:rsidR=\"00A5416B\" w:rsidTr=\"003610FD\"><w:tc><w:tcPr><w:tcW w:w=\"8130\" w:type=\"dxa\"/></w:tcPr>D_D.</w:tc></w:tr><w:tr w:rsidR=\"00A5416B\" w:rsidTr=\"003610FD\"><w:tc><w:tcPr><w:tcW w:w=\"8130\" w:type=\"dxa\"/></w:tcPr>E_E.</w:tc></w:tr></w:tbl>";
    
    /**
     * 普通文本的P标签模板字符串
     */
    public static final String NORMAL_P_TMP = "<w:p w:rsidR=\"00285782\" w:rsidRDefault=\"00285782\"><w:pPr><w:rPr><w:rFonts w:hint=\"eastAsia\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:hint=\"eastAsia\"/><w:sz w:val=\"22\"/></w:rPr><w:t xml:space=\"preserve\">XX</w:t></w:r></w:p>";

    /**
     * 换页的回车换行字符串
     */
    public static final String PAGE_BR_TMP = "<w:p w:rsidR=\"007C36AF\" w:rsidRDefault=\"007C36AF\"><w:pPr><w:widowControl/><w:jc w:val=\"left\"/></w:pPr><w:r><w:br w:type=\"page\"/></w:r></w:p>";
    
    /**
     * 普通的回车换行字符串
     */
    public static final String BLANK_BR_TMP = "<w:p w:rsidR=\"00CB447E\" w:rsidRDefault=\"00CB447E\"><w:pPr><w:rPr><w:rFonts w:hint=\"eastAsia\"/></w:rPr></w:pPr></w:p>";
    
    /**
     * 用于临时使用的body节点开始标签
     */
    public static final String PAPERTMPBODY_START = "<paperTmpBody xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">";

    /**
     * 用于临时使用的body节点结束标签
     */
    public static final String PAPERTMPBODY_END = "</paperTmpBody>";

    public static final int USER_TYPE_TEACHER = 10;// 命题教师

    public static final int USER_TYPE_SECRETARY = 11;// 学科秘书

    public static final int USER_TYPE_INPUTER = 12;// 录入员，排版员

    public static class UserRoleCodes {

        /**
         * 业务管理员角色的Code：processManagement
         */
        public static final String BUSINESS_ADMIN = "processManagement";

        /**
         * 普通用户角色的Code：domesticConsumer
         */
        public static final String NORMAL_USER = "domesticConsumer";
        
        /**
         * 审题教师角色的Code：quesAuditor
         */
        public static final String QUES_AUDITOR = "quesAuditor";
        
        /**
         * 录入员角色的Code：quesInputer
         */
        public static final String QUES_INPUTER = "quesInputer";
    }

    public static class EstimateDifficulty {

        public static final Map<Integer, String> dicMap = new LinkedHashMap<Integer, String>();
        static {
            dicMap.put(1, "A");
            dicMap.put(2, "B");
            dicMap.put(3, "C");
            dicMap.put(4, "D");
            dicMap.put(10, "A");
            dicMap.put(20, "B");
            dicMap.put(30, "C");
            dicMap.put(40, "D");
        }
    }

    public static final String ROLE_PROCESS_MANAGEMENT = "processManagement";

    public static final String ROLE_DOMESTIC_CONSUMER = "domesticConsumer";

	

	/**
	 * 常见的几种图片类型的后缀名
	 * @author 马涛 2015-05-18
	 *
	 */
	public static final class ImgType{
		public static final String wmf = "wmf";
		public static final String emf = "emf";
		public static final String gif = "gif";
		public static final String png = "png";
		public static final String jpg = "jpg";
		public static final String jpeg = "jpeg";
		public static final String bmp = "bmp";
		public static final String tiff = "tiff";
		public static final String eps = "eps";
		
		public static final Map<String,String> ImgTypeMap = new HashMap<String, String>();
		static{
			ImgTypeMap.put(wmf, "image/x-wmf");
			ImgTypeMap.put(emf, "image/x-emf");
			ImgTypeMap.put(gif, "image/gif");
			ImgTypeMap.put(png, "image/png");
			ImgTypeMap.put(jpg, "image/jpeg");
			ImgTypeMap.put(jpeg, "image/jpeg");
			ImgTypeMap.put(bmp, "image/bmp");
			ImgTypeMap.put(tiff, "image/tiff");
			ImgTypeMap.put(eps, "application/postscript");
		}
	}
	
	/**
	 * 完整的命名实体-特殊符号对照表，例如：&Alpha; - Α
	 */
	public static final Map<String,String> HtmlSymbolWholeMap = new LinkedHashMap<String, String>();
	
//	/**
//	 * 简单的命名实体-特殊符号对照表，例如：Alpha - Α
//	 */
//	public static final Map<String,String> HtmlSymbolSimpleMap = new LinkedHashMap<String, String>();
	
	public static final StringBuffer HtmlSymbolDocTypeStr = new StringBuffer();
	
	static{
		try{
			Properties prop = new Properties();
			Reader reader = new InputStreamReader(Consts.class.getResourceAsStream("/htmlSymbolMap.txt"), "UTF-8");
			prop.load(reader);
			for(Entry<Object, Object> entry:prop.entrySet()){
				HtmlSymbolWholeMap.put(((String)entry.getKey()).trim(), ((String)entry.getValue()).trim());
			}
			HtmlSymbolWholeMap.put("&nbsp;", " ");
			HtmlSymbolWholeMap.remove("&amp;");
			HtmlSymbolWholeMap.put("&amp;", "&");

			HtmlSymbolDocTypeStr.append("<!DOCTYPE horse [ \n");
			for(Entry<String, String> entry:HtmlSymbolWholeMap.entrySet()){
				String key = entry.getKey();
				key = key.substring(1, key.length() - 1);
				if(!key.equals("quot") && !key.equals("amp") && !key.equals("gt") && !key.equals("lt")){
					HtmlSymbolDocTypeStr.append("<!ENTITY ").append(key).append(" \"").append(entry.getValue()).append("\">\n");
				}
			}
			HtmlSymbolDocTypeStr.append("]>\n");
		}catch(Exception e){
			e.printStackTrace();
			throw new RuntimeException("初始化HTML特殊符号编码对照表文件（/htmlSymbolMap.txt）失败，原因：" + e.getMessage(),e);
		}
	}
}
