import { optionTypeList, stemTypeList, questionNumberTypeList, scoreTypeList, switchOption } from './common'; import { getRandomNumber } from '@/utils/index'; // 选项类型列表 export const option_type_list = [ { value: 'right', label: '是' }, { value: 'error', label: '非' }, { value: 'incertitude', label: '不确定' }, ]; export const option_type_value_list = option_type_list.map(({ value }) => value); export function getOption(content = '') { return { content, mark: getRandomNumber() }; } /** * 获取判断题数据模板(防止 mark 重复) * @returns {object} 判断题数据模板 */ export function getJudgeData() { return { type: 'judge', // 题型 stem: '', // 题干 option_number_show_mode: optionTypeList[0].value, // 选项类型 option_list: [getOption(), getOption(), getOption()], // 选项 file_id_list: [], // 文件 id 列表 answer: { answer_list: [], score: 1, score_type: scoreTypeList[0].value }, // 答案 // 题型属性 property: { stem_type: stemTypeList[1].value, // 题干类型 question_number: '1', // 题号 option_type_list: [option_type_list[0].value, option_type_list[1].value], // 选项类型列表 score: 1, // 分值 score_type: scoreTypeList[0].value, // 分值类型 }, // 其他属性 other: { question_number_type: questionNumberTypeList[1].value, // 题号类型 }, }; }