chinese.js 1.5 KB

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