wordDictation.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { stemTypeList, scoreTypeList, questionNumberTypeList, optionTypeList, switchOption } from './common';
  2. import { getRandomNumber } from '@/utils/index';
  3. export function getOption(content = '') {
  4. return {
  5. content,
  6. mark: getRandomNumber(),
  7. audio_file_id: '',
  8. pinyin: '',
  9. pinyin_item_list: [],
  10. };
  11. }
  12. // 音频生成方式类型
  13. export const audioGenerationMethodList = [
  14. {
  15. value: 'upload',
  16. label: '上传',
  17. },
  18. {
  19. value: 'auto',
  20. label: '自动生成',
  21. },
  22. {
  23. value: 'record',
  24. label: '录音',
  25. },
  26. ];
  27. // 字词听写数据模板
  28. export const wordDictationData = {
  29. type: 'word_dictation', // 题型
  30. stem: '', // 题干
  31. description: '', // 描述
  32. option_number_show_mode: optionTypeList[1].value, // 选项类型
  33. answer: { score: 1, score_type: scoreTypeList[0].value }, // 答案
  34. option_list: [getOption(), getOption(), getOption()], // 选项
  35. file_id_list: [],
  36. // 题型属性
  37. property: {
  38. stem_type: stemTypeList[1].value, // 题干类型
  39. question_number: '1', // 题号
  40. is_enable_description: switchOption[0].value, // 描述
  41. score: 1, // 分值
  42. score_type: scoreTypeList[0].value, // 分值类型
  43. },
  44. // 其他属性
  45. other: {
  46. question_number_type: questionNumberTypeList[1].value, // 题号类型
  47. audio_generation_method: audioGenerationMethodList[0].value, // 音频生成方式
  48. },
  49. };