123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357 |
- <?php
- $type = array
- (
- 1 => '开始答题时随机抽取',
- 2 => '每次答题时随机抽取',
- 3 => '指定题目ID',
- 4 => '按照难度随机抽取',
- );
- $continue = array
- (
- 1 => '答错之后继续答题',
- 2 => '答错之后停止答题',
- 3 => '答错之后停止答题,并且无法重新开始',
- );
- $cate = function()
- {
- $array = array();
- $cate = Dever::load('question/cate-state');
- if($cate)
- {
- $array += $cate;
- }
- return $array;
- };
- $continue_num_type = array
- (
- 1 => '自然日,每天凌晨自动恢复',
- 2 => '按照小时间隔',
- 3 => '按照天间隔',
- );
- $continue_index = array
- (
- 1 => '复活完成后继续当前题目',
- 2 => '复活完成后完成当前题目,进入下一道题目',
- );
- $continue_num_user = array
- (
- 1 => '对用户所有答题有效',
- 2 => '对用户本次答题有效',
- );
- return array
- (
- # 表名
- 'name' => 'exam',
- # 显示给用户看的名称
- 'lang' => '测试规则设置',
- # 是否显示在后台菜单
- 'order' => 200,
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'order' => 'desc',
- 'list' => true,
- ),
- 'hr1' => array
- (
- 'name' => '基本信息',
- 'class' => '',//本项必须填写
- 'attr' => '',
- ),
- 'name' => array
- (
- 'type' => 'varchar-150',
- 'name' => '标题',
- 'default' => '',
- 'desc' => '标题',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'desc' => array
- (
- 'type' => 'varchar-500',
- 'name' => '描述',
- 'default' => '',
- 'desc' => '描述',
- 'match' => 'option',
- 'update' => 'textarea',
- 'search' => 'fulltext',
- //'list' => true,
- ),
- 'pic' => array
- (
- 'type' => 'varchar-150',
- 'name' => '规则介绍图',
- 'default' => '',
- 'desc' => '规则介绍图',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '1',
- 'place' => '150',
- ),
- 'hr2' => array
- (
- 'name' => '题目抽取规则',
- 'class' => '',//本项必须填写
- 'attr' => '',
- ),
- 'num' => array
- (
- 'type' => 'int-11',
- 'name' => '题目数量',
- 'default' => '10',
- 'desc' => '题目数量',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'cate_id' => array
- (
- 'type' => 'varchar-150',
- 'name' => '抽取题目所属分类',
- 'default' => '',
- 'desc' => '请选择分类',
- 'match' => 'is_string',
- 'update' => 'checkbox',
- 'option' => $cate,
- //'search_parent' => 'info_id',//根据哪个字段来确定本搜索选项的内容
- 'list' => '{cate_id} > 0 ? Dever::load("question/cate-one#name", {cate_id}) : "未知"',
- ),
- 'type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '题目抽取方式',
- 'default' => '2',
- 'desc' => '题目抽取方式',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $type,
- 'control' => 'type',
- ),
- 'level_ids' => array
- (
- 'type' => 'varchar-300',
- 'name' => '难度数量设置-多个用换行隔开,如1,3 换行 3,4,则难度id为1的选出3个,难度id为3的选出4个,以此类推,总数量以题目数量为准,请准确输入',
- 'default' => '',
- 'desc' => '描述',
- 'match' => 'is_string',
- 'update' => 'textarea',
- 'search' => 'fulltext',
- //'list' => true,
- 'show' => 'type=4',
- ),
- 'info_ids' => array
- (
- 'type' => 'varchar-300',
- 'name' => '题库ID列表-多个请用换行',
- 'default' => '',
- 'desc' => '题库ID列表',
- 'match' => 'option',
- 'update' => 'textarea',
- //'list' => true,
- 'show' => 'type=3',
- ),
- 'hr3' => array
- (
- 'name' => '答题复活规则',
- 'class' => '',//本项必须填写
- 'attr' => '',
- ),
- 'continue' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '持续答题规则',
- 'default' => '2',
- 'desc' => '持续答题规则',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $continue,
- 'control' => 'continue',
- ),
- 'continue_times' => array
- (
- 'type' => 'int-11',
- 'name' => '超时时间-请直接输入秒数,由于网络消耗,可以设置为前端时间的2倍',
- 'default' => '20',
- 'desc' => '超时时间',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'show' => array('continue=2', 'continue=3'),
- ),
- 'continue_index' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '答题复活是否完成当前题目',
- 'default' => '1',
- 'desc' => '答题复活是否完成当前题目',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $continue_index,
- 'show' => array('continue=2', 'continue=3'),
- ),
- 'continue_num' => array
- (
- 'type' => 'int-11',
- 'name' => '答错复活次数',
- 'default' => '3',
- 'desc' => '答错复活次数',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'show' => array('continue=2', 'continue=3'),
- ),
- 'continue_num_type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '答题复活时间间隔',
- 'default' => '1',
- 'desc' => '答题复活时间间隔',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $continue_num_type,
- 'show' => array('continue=2', 'continue=3'),
- 'control' => 'continue_num_type',
- ),
- 'continue_num_type_times' => array
- (
- 'type' => 'int-11',
- 'name' => '答题复活时间间隔时间-如选择按照小时间隔则为24小时',
- 'default' => '24',
- 'desc' => '答题复活时间间隔时间',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'show' => array('continue_num_type=2', 'continue_num_type=3'),
- ),
- 'continue_num_user' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '答题复活有效规则',
- 'default' => '1',
- 'desc' => '答题复活有效规则',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $continue_num_user,
- 'show' => array('continue=2', 'continue=3'),
- ),
- 'hr4' => array
- (
- 'name' => '结果规则',
- 'class' => '',//本项必须填写
- 'attr' => '',
- ),
- 'content' => array
- (
- 'type' => 'text-1000',
- 'name' => '结果设置',
- 'default' => '',
- 'desc' => '结果设置',
- 'match' => 'is_string',
- 'update' => array
- (
- array
- (
- 'col' => 'score',
- 'name' => '结果分数-答对题目的总分数,区间用~隔开,如20~40,代表大于等于20小于等于40',
- 'default' => '0',
- 'desc' => '选项分数',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- array
- (
- 'col' => 'title',
- 'name' => '结果标题',
- 'default' => '',
- 'desc' => '结果标题',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- array
- (
- 'col' => 'pic',
- 'name' => '结果图片',
- 'default' => '',
- 'desc' => '结果图片',
- 'match' => 'is_string',
- 'update' => 'image',
- 'key' => '1',
- ),
- array
- (
- 'col' => 'info',
- 'name' => '结果描述',
- 'default' => '',
- 'desc' => '结果描述',
- 'match' => 'is_string',
- 'update' => 'editor',
- 'key' => '1',
- ),
- ),
- ),
-
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '录入时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- 'search' => 'date',
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'manage' => array
- (
-
- ),
- );
|