chinese.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { stemTypeList, scoreTypeList, questionNumberTypeList, optionTypeList } 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. collocation: '',
  11. };
  12. }
  13. // 汉字类型列表
  14. export const learnTypeList = [
  15. { value: 'paint', label: '描红' },
  16. { value: 'write', label: '书写' },
  17. { value: 'dictation', label: '听写' },
  18. ];
  19. // 音频生成方式类型
  20. export const audioGenerationMethodList = [
  21. {
  22. value: 'upload',
  23. label: '上传',
  24. },
  25. {
  26. value: 'auto',
  27. label: '自动生成',
  28. },
  29. {
  30. value: 'record',
  31. label: '录音',
  32. },
  33. ];
  34. // 汉字题数据模板
  35. export const chineseData = {
  36. type: 'chinese', // 题型
  37. stem: '', // 题干
  38. description: '', // 描述
  39. option_number_show_mode: optionTypeList[0].value, // 选项类型
  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. tian_number: 8, // 田字格数
  52. },
  53. // 其他属性
  54. other: {
  55. question_number_type: questionNumberTypeList[0].value, // 题号类型
  56. audio_generation_method: audioGenerationMethodList[0].value, // 音频生成方式
  57. },
  58. };