wordCard.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import {
  2. stemTypeList,
  3. scoreTypeList,
  4. questionNumberTypeList,
  5. optionTypeList,
  6. switchOption,
  7. fontSizeList,
  8. } from './common';
  9. import { getRandomNumber } from '@/utils/index';
  10. export function getOption(content = '') {
  11. return {
  12. content,
  13. mark: getRandomNumber(),
  14. audio_file_id: '',
  15. pinyin: '',
  16. definition: '',
  17. collocation: '',
  18. example_sentence: ['', ''],
  19. picture_file_id: '',
  20. hz_strokes_list: [],
  21. };
  22. }
  23. // 音频生成方式类型
  24. export const audioGenerationMethodList = [
  25. {
  26. value: 'upload',
  27. label: '上传',
  28. },
  29. {
  30. value: 'auto',
  31. label: '自动生成',
  32. },
  33. {
  34. value: 'record',
  35. label: '录音',
  36. },
  37. ];
  38. // 汉字题数据模板
  39. export const wordCardData = {
  40. type: 'word_card', // 题型
  41. stem: '', // 题干
  42. description: '', // 描述
  43. option_number_show_mode: optionTypeList[1].value, // 选项类型
  44. answer: { score: 1, score_type: scoreTypeList[0].value }, // 答案
  45. option_list: [getOption()], // 选项
  46. file_id_list: [],
  47. // 题型属性
  48. property: {
  49. stem_type: stemTypeList[1].value, // 题干类型
  50. question_number: '1', // 题号
  51. stem_question_number: fontSizeList[5], // 题干题号
  52. is_enable_description: switchOption[0].value, // 描述
  53. score: 1, // 分值
  54. score_type: scoreTypeList[0].value, // 分值类型
  55. },
  56. // 其他属性
  57. other: {
  58. question_number_type: questionNumberTypeList[1].value, // 题号类型
  59. audio_generation_method: audioGenerationMethodList[0].value, // 音频生成方式
  60. },
  61. };