1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import { getRandomNumber } from '@/utils';
- import { stemTypeList, questionNumberTypeList, scoreTypeList, switchOption, fontSizeList } from './common';
- export const roleDefaultColorList = ['#306EFF', '#3ABD38', '#FC8E3D', '#FC493D', '#BF3DFC']; // 角色默认颜色
- /**
- * 获取角色对象
- * @param {number} index 序号
- */
- export function getRole(index) {
- return {
- name: `角色${index + 1}`,
- mark: getRandomNumber(),
- color: roleDefaultColorList[index],
- };
- }
- // 对话题数据模板
- export function getDialogueData() {
- return {
- type: 'dialogue', // 题型
- stem: '', // 题干
- description: '', // 描述
- option_list: [], // 选项列表
- file_id_list: [], // 文件 id 列表
- answer: { score: 1, score_type: scoreTypeList[0].value, answer_list: [] }, // 答案
- // 题型属性
- property: {
- stem_type: stemTypeList[1].value, // 题干类型
- question_number: '1', // 题号
- stem_question_number: fontSizeList[5], // 题干题号
- score: 1, // 分值
- is_enable_description: switchOption[0].value, // 描述
- is_enable_voice_answer: switchOption[0].value, // 语音作答
- score_type: scoreTypeList[0].value, // 分值类型
- role_number: 2, // 角色数 2 - 5
- role_list: [getRole(0), getRole(1)], // 角色列表
- },
- // 其他属性
- other: {
- question_number_type: questionNumberTypeList[1].value, // 题号类型
- },
- };
- }
|