chinese.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. definition: '',
  11. collocation: '',
  12. hz_strokes_list: [],
  13. };
  14. }
  15. // 汉字类型列表
  16. export const learnTypeList = [
  17. { value: 'paint', label: '描红' },
  18. { value: 'write', label: '书写' },
  19. { value: 'dictation', label: '听写' },
  20. ];
  21. // 音频生成方式类型
  22. export const audioGenerationMethodList = [
  23. {
  24. value: 'upload',
  25. label: '上传',
  26. },
  27. {
  28. value: 'auto',
  29. label: '自动生成',
  30. },
  31. {
  32. value: 'record',
  33. label: '录音',
  34. },
  35. ];
  36. // 汉字题数据模板
  37. export const chineseData = {
  38. type: 'chinese', // 题型
  39. stem: '', // 题干
  40. description: '', // 描述
  41. option_number_show_mode: optionTypeList[1].value, // 选项类型
  42. answer: { score: 1, score_type: scoreTypeList[0].value }, // 答案
  43. option_list: [getOption(), getOption(), getOption()], // 选项
  44. file_id_list: [],
  45. // 题型属性
  46. property: {
  47. stem_type: stemTypeList[1].value, // 题干类型
  48. question_number: '1', // 题号
  49. is_enable_description: switchOption[0].value, // 描述
  50. score: 1, // 分值
  51. score_type: scoreTypeList[0].value, // 分值类型
  52. learn_type: learnTypeList[0].value,
  53. tian_number: 8, // 田字格组
  54. },
  55. // 其他属性
  56. other: {
  57. question_number_type: questionNumberTypeList[1].value, // 题号类型
  58. audio_generation_method: audioGenerationMethodList[0].value, // 音频生成方式
  59. },
  60. };