|
@@ -155,6 +155,7 @@ import SoundRecord from '../common/SoundRecord.vue';
|
|
|
import { GetStaticResources, GetFileStoreInfo } from '@/api/app';
|
|
|
import { changeOptionType, handleInputNumber, addTone } from '@/views/exercise_questions/data/common';
|
|
|
import UploadDrag from '../common/UploadDrag.vue';
|
|
|
+import { getRandomNumber } from '@/utils/index';
|
|
|
|
|
|
import {
|
|
|
wordCardData,
|
|
@@ -412,7 +413,42 @@ export default {
|
|
|
.filter((item) => item);
|
|
|
|
|
|
if (arr.length > 0) {
|
|
|
- this.data.stem = arr[0];
|
|
|
+ let sliceLength = 0;
|
|
|
+ if (arr[0].substring(0, 3) === '题干:') {
|
|
|
+ this.data.stem = arr[0].substring(3);
|
|
|
+ sliceLength += 1;
|
|
|
+ }
|
|
|
+ if (arr.slice(sliceLength)[0] && arr.slice(sliceLength)[0].substring(0, 3) === '提示:') {
|
|
|
+ this.data.description = arr.slice(sliceLength)[0].substring(3);
|
|
|
+ this.data.property.is_enable_description = 'true';
|
|
|
+ sliceLength += 1;
|
|
|
+ } else {
|
|
|
+ this.data.description = '';
|
|
|
+ this.data.property.is_enable_description = 'false';
|
|
|
+ }
|
|
|
+ let option_list = arr.slice(sliceLength);
|
|
|
+ this.data.option_list = [];
|
|
|
+ option_list.map((content, index) => {
|
|
|
+ let content_item = content.split('/');
|
|
|
+ this.data.option_list.push({
|
|
|
+ content: content_item[0] ? content_item[0] : '',
|
|
|
+ mark: getRandomNumber(),
|
|
|
+ audio_file_id: '',
|
|
|
+ pinyin: content_item[1] ? content_item[1] : '',
|
|
|
+ definition: content_item[2] ? content_item[2] : '',
|
|
|
+ collocation: content_item[3] ? content_item[3] : '',
|
|
|
+ example_sentence: content_item.length > 3 ? content_item.slice(4) : [''],
|
|
|
+ picture_file_id: '',
|
|
|
+ hz_strokes_list: [],
|
|
|
+ });
|
|
|
+ let obj = {
|
|
|
+ loading: false,
|
|
|
+ loadings: false,
|
|
|
+ };
|
|
|
+ this.loading_list.push(obj);
|
|
|
+ this.handleChineseStrokes(this.data.option_list[index], index);
|
|
|
+ this.changePinyin(this.data.option_list[index]);
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
},
|