readAloud.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { stemTypeList, questionNumberTypeList, scoreTypeList, switchOption, fontSizeList } from './common';
  2. /**
  3. * 解析智能识别数据
  4. * @param {array} arr 智能识别数据
  5. * @returns object
  6. */
  7. export function analysisRecognitionReadAloudData(arr) {
  8. if (arr.length === 0) return {};
  9. let reg = /^文段[::]/;
  10. let text = reg.test(arr[0]) ? arr[0].replace(reg, '') : '';
  11. return { 'data.text': text };
  12. }
  13. // 朗读题数据模板
  14. export const readAloudData = {
  15. type: 'read_aloud', // 题型
  16. stem: '', // 题干
  17. description: '', // 提示
  18. text: '', // 文段
  19. file_id_list: [], // 文件 id 列表
  20. answer: {
  21. score: 1,
  22. score_type: scoreTypeList[0].value,
  23. }, // 答案
  24. // 题型属性
  25. property: {
  26. stem_type: stemTypeList[1].value, // 题干类型
  27. question_number: '1', // 题号
  28. stem_question_number_font_size: fontSizeList[6], // 题干题号
  29. is_enable_listening: switchOption[0].value, // 是否开启听力
  30. is_enable_description: switchOption[1].value, // 是否开启提示
  31. score: 1, // 分值
  32. score_type: scoreTypeList[0].value, // 分值类型
  33. },
  34. // 其他属性
  35. other: {
  36. question_number_type: questionNumberTypeList[1].value, // 题号类型
  37. },
  38. };