|
@@ -184,22 +184,22 @@ export default {
|
|
|
.map((item) => item.trim())
|
|
|
.filter((item) => item);
|
|
|
|
|
|
- if (arr.length > 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';
|
|
|
- }
|
|
|
- this.data.option_list = arr.slice(sliceLength).map((content) => getOption(content));
|
|
|
+ if (arr.length <= 0) return;
|
|
|
+
|
|
|
+ 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';
|
|
|
}
|
|
|
+ this.data.option_list = arr.slice(sliceLength).map((content) => getOption(content));
|
|
|
},
|
|
|
changeSelectType(val) {
|
|
|
if (val === selectTypeList[0].value && this.data.answer.answer_list.length > 1) {
|