replaceAnswer.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { stemTypeList, scoreTypeList, questionNumberTypeList, switchOption, fontSizeList } from './common';
  2. import { getRandomNumber } from '@/utils/index';
  3. export function getOption(content = '') {
  4. return [
  5. { content, mark: getRandomNumber() },
  6. { content, mark: getRandomNumber() },
  7. { content, mark: getRandomNumber() },
  8. { content, mark: getRandomNumber() },
  9. ];
  10. }
  11. // 替换练习数据模板
  12. export const replaceAnswerData = {
  13. type: 'replace_answer', // 题型
  14. stem: '', // 题干
  15. description: '', // 描述
  16. option_list: [getOption(), getOption(), getOption(), getOption()], // 选项
  17. file_id_list: [], // 文件 id 列表
  18. answer: { score: 1, score_type: scoreTypeList[0].value }, // 答案
  19. // 题型属性
  20. property: {
  21. stem_type: stemTypeList[1].value, // 题干类型
  22. question_number: '1', // 题号
  23. stem_question_number: fontSizeList[5], // 题干题号
  24. is_enable_description: switchOption[0].value, // 描述
  25. score: 1, // 分值
  26. score_type: scoreTypeList[0].value, // 分值类型
  27. row_count: 4,
  28. column_count: 4,
  29. },
  30. // 其他属性
  31. other: {
  32. question_number_type: questionNumberTypeList[1].value, // 题号类型
  33. },
  34. };