wordDictation.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. hz_strokes_list: [],
  11. };
  12. }
  13. // 音频生成方式类型
  14. export const audioGenerationMethodList = [
  15. {
  16. value: 'upload',
  17. label: '上传',
  18. },
  19. {
  20. value: 'auto',
  21. label: '自动生成',
  22. },
  23. {
  24. value: 'record',
  25. label: '录音',
  26. },
  27. ];
  28. // 字词听写数据模板
  29. export const wordDictationData = {
  30. type: 'word_dictation', // 题型
  31. stem: '', // 题干
  32. description: '', // 描述
  33. option_number_show_mode: optionTypeList[1].value, // 选项类型
  34. answer: { score: 1, score_type: scoreTypeList[0].value }, // 答案
  35. option_list: [getOption(), getOption(), getOption()], // 选项
  36. file_id_list: [],
  37. // 题型属性
  38. property: {
  39. stem_type: stemTypeList[1].value, // 题干类型
  40. question_number: '1', // 题号
  41. is_enable_description: switchOption[0].value, // 描述
  42. score: 1, // 分值
  43. score_type: scoreTypeList[0].value, // 分值类型
  44. },
  45. // 其他属性
  46. other: {
  47. question_number_type: questionNumberTypeList[1].value, // 题号类型
  48. audio_generation_method: audioGenerationMethodList[0].value, // 音频生成方式
  49. },
  50. };