repeat.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { optionTypeList, stemTypeList, scoreTypeList, questionNumberTypeList, switchOption } from './common';
  2. import { getRandomNumber } from '@/utils/index';
  3. export function getOption(content = '') {
  4. return { content, mark: getRandomNumber(), audio_file_id: '' };
  5. }
  6. // 音频生成方式类型
  7. export const audioGenerationMethodList = [
  8. {
  9. value: 'upload',
  10. label: '上传',
  11. },
  12. {
  13. value: 'auto',
  14. label: '自动生成',
  15. },
  16. {
  17. value: 'record',
  18. label: '录音',
  19. },
  20. ];
  21. // 听后训练数据模板
  22. export const repeatData = {
  23. type: 'repeat', // 题型
  24. stem: '', // 题干
  25. option_number_show_mode: optionTypeList[0].value, // 选项类型
  26. description: '', // 描述
  27. option_list: [
  28. { content: '', mark: getRandomNumber(), audio_file_id: '' },
  29. { content: '', mark: getRandomNumber(), audio_file_id: '' },
  30. { content: '', mark: getRandomNumber(), audio_file_id: '' },
  31. ], // 选项
  32. file_id_list: [],
  33. answer: { score: 1, score_type: scoreTypeList[0].value }, // 答案
  34. // 题型属性
  35. property: {
  36. stem_type: stemTypeList[1].value, // 题干类型
  37. question_number: '1', // 题号
  38. is_enable_description: switchOption[0].value, // 描述
  39. score: 1, // 分值
  40. score_type: scoreTypeList[0].value, // 分值类型
  41. },
  42. // 其他属性
  43. other: {
  44. question_number_type: questionNumberTypeList[1].value, // 题号类型
  45. audio_generation_method: audioGenerationMethodList[0].value, // 音频生成方式
  46. },
  47. };