12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import { getRandomNumber } from '@/utils';
- import { stemTypeList, questionNumberTypeList, scoreTypeList, switchOption, fontSizeList } from './common';
- export function getOption() {
- return { mark: getRandomNumber(), text: '', content_list: [] };
- }
- /**
- * 获取填表题数据模板(防止 mark 重复)
- * @returns {object} 判断题数据模板
- */
- export function getTableFillData() {
- return {
- type: 'table_fill', // 题型
- stem: '', // 题干
- option_header_list: [
- { mark: getRandomNumber(), text: '', width: 50 },
- { mark: getRandomNumber(), text: '', width: 50 },
- ], // 选项头部
- option_list: [
- [getOption(), getOption()],
- [getOption(), getOption()],
- ], // 选项列表
- answer: {
- score: 1,
- score_type: scoreTypeList[0].value,
- answer_list: [],
- }, // 答案
- // 题型属性
- property: {
- stem_type: stemTypeList[1].value, // 题干类型
- question_number: '1', // 题号
- stem_question_number_font_size: fontSizeList[5], // 题干题号
- score: 1, // 分值
- score_type: scoreTypeList[0].value, // 分值类型
- is_enable_number_column: switchOption[0].value, // 是否启用序号列
- form_width: 800, // 表格宽度 100 - 3000
- row_number: 2, // 行数 1 - 30
- column_number: 2, // 列数 2 - 5
- },
- // 其他属性
- other: {
- question_number_type: questionNumberTypeList[1].value, // 题号类型
- },
- };
- }
|