replaceAnswer.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { stemTypeList, scoreTypeList, questionNumberTypeList } 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: 0, score_type: scoreTypeList[0].value }, // 答案
  19. // 题型属性
  20. property: {
  21. stem_type: stemTypeList[0].value, // 题干类型
  22. question_number: '1', // 题号
  23. is_enable_description: 'false', // 描述
  24. score: 1, // 分值
  25. score_type: scoreTypeList[0].value, // 分值类型
  26. row_count: 4,
  27. },
  28. // 其他属性
  29. other: {
  30. question_number_type: questionNumberTypeList[0].value, // 题号类型
  31. },
  32. };