chinese.js 1.5 KB

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