chooseTone.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { stemTypeList, questionNumberTypeList, scoreTypeList, optionTypeList } from './common';
  2. import { getRandomNumber } from '@/utils/index';
  3. export function getOption(content = '') {
  4. return {
  5. content,
  6. mark: getRandomNumber(),
  7. content_view: [],
  8. audio_file_id: '',
  9. };
  10. }
  11. export const toneList = [
  12. { value: 'first', label: '一声', img: 'first-tone' },
  13. { value: 'second', label: '二声', img: 'second-tone' },
  14. { value: 'third', label: '三声', img: 'third-tone' },
  15. { value: 'fourth', label: '四声', img: 'fourth-tone' },
  16. { value: 'neutral', label: '轻声', img: 'neutral-tone' },
  17. ];
  18. export const toneTypeList = [
  19. { value: 'select', label: '选择声调' },
  20. { value: 'label', label: '标注声调' },
  21. ];
  22. export const audioGenerationMethodList = [
  23. {
  24. value: 'upload',
  25. label: '上传',
  26. },
  27. {
  28. value: 'auto',
  29. label: '自动生成',
  30. },
  31. {
  32. value: 'record',
  33. label: '录音',
  34. },
  35. ];
  36. // 选择声调题数据模板
  37. export const ChooseToneData = {
  38. type: 'choose_tone', // 题型
  39. stem: '', // 题干
  40. description: '', // 描述
  41. option_number_show_mode: optionTypeList[0].value, // 选项类型
  42. option_list: [getOption(), getOption(), getOption()], // 选项
  43. file_id_list: [],
  44. answer: { score: 0, score_type: scoreTypeList[0].value, answer_list: [] }, // 答案
  45. // 题型属性
  46. property: {
  47. stem_type: stemTypeList[0].value, // 题干类型
  48. question_number: '1', // 题号
  49. is_enable_description: 'false', // 描述
  50. answer_mode: toneTypeList[0].value, // 音调类型
  51. score: 1, // 分值
  52. score_type: scoreTypeList[0].value, // 分值类型
  53. },
  54. // 其他属性
  55. other: {
  56. question_number_type: questionNumberTypeList[0].value, // 题号类型
  57. audio_generation_method: audioGenerationMethodList[0].value, // 音频生成方式
  58. },
  59. };