Parcourir la source

描述默认开启

natasha il y a 1 an
Parent
commit
aa74d477c7

+ 17 - 1
src/views/exercise_questions/create/components/exercises/AnswerQuestion.vue

@@ -76,7 +76,23 @@ export default {
       data: JSON.parse(JSON.stringify(answerQuestionData)),
     };
   },
-  methods: {},
+  methods: {
+    /**
+     * 智能识别
+     * @param {String} text 识别数据
+     */
+    recognition(text) {
+      let arr = text
+        .split(/[\r\n]/)
+        .map((item) => item.trim())
+        .filter((item) => item);
+
+      if (arr.length > 0) {
+        this.data.stem = arr[0];
+        this.data.reference_answer = arr[1] ? arr[1] : '';
+      }
+    },
+  },
 };
 </script>
 

+ 17 - 1
src/views/exercise_questions/create/components/exercises/EssayQuestion.vue

@@ -90,7 +90,23 @@ export default {
       data: JSON.parse(JSON.stringify(essayQuestionData)),
     };
   },
-  methods: {},
+  methods: {
+    /**
+     * 智能识别
+     * @param {String} text 识别数据
+     */
+    recognition(text) {
+      let arr = text
+        .split(/[\r\n]/)
+        .map((item) => item.trim())
+        .filter((item) => item);
+
+      if (arr.length > 0) {
+        this.data.stem = arr[0];
+        this.data.reference_answer = arr[1] ? arr[1] : '';
+      }
+    },
+  },
 };
 </script>
 

+ 1 - 1
src/views/exercise_questions/data/chinese.js

@@ -49,7 +49,7 @@ export const chineseData = {
   property: {
     stem_type: stemTypeList[1].value, // 题干类型
     question_number: '1', // 题号
-    is_enable_description: switchOption[1].value, // 描述
+    is_enable_description: switchOption[0].value, // 描述
     score: 1, // 分值
     score_type: scoreTypeList[0].value, // 分值类型
     learn_type: learnTypeList[0].value,

+ 1 - 1
src/views/exercise_questions/data/chooseTone.js

@@ -51,7 +51,7 @@ export const ChooseToneData = {
   property: {
     stem_type: stemTypeList[1].value, // 题干类型
     question_number: '1', // 题号
-    is_enable_description: switchOption[1].value, // 描述
+    is_enable_description: switchOption[0].value, // 描述
     answer_mode: toneTypeList[0].value, // 音调类型
     score: 1, // 分值
     score_type: scoreTypeList[0].value, // 分值类型

+ 1 - 1
src/views/exercise_questions/data/replaceAnswer.js

@@ -22,7 +22,7 @@ export const replaceAnswerData = {
   property: {
     stem_type: stemTypeList[1].value, // 题干类型
     question_number: '1', // 题号
-    is_enable_description: switchOption[1].value, // 描述
+    is_enable_description: switchOption[0].value, // 描述
     score: 1, // 分值
     score_type: scoreTypeList[0].value, // 分值类型
     row_count: 4,

+ 1 - 1
src/views/exercise_questions/data/sort.js

@@ -23,7 +23,7 @@ export function getSortDataTemplate() {
     property: {
       stem_type: stemTypeList[1].value, // 题干类型
       question_number: '1', // 题号
-      is_enable_description: switchOption[1].value, // 描述
+      is_enable_description: switchOption[0].value, // 描述
       score: 1, // 分值
       score_type: scoreTypeList[0].value, // 分值类型
       layout_type: sortTypeList[0].value,

+ 1 - 1
src/views/exercise_questions/data/talkPicture.js

@@ -16,7 +16,7 @@ export const talkPictrueData = {
     stem_type: stemTypeList[1].value, // 题干类型
     question_number: '1', // 题号
     score: 1, // 分值
-    is_enable_description: switchOption[1].value, // 描述
+    is_enable_description: switchOption[0].value, // 描述
     is_enable_voice_answer: switchOption[0].value, // 语音作答
     is_enable_reference_answer: switchOption[0].value, // 参考答案
     score_type: scoreTypeList[0].value, // 分值类型

+ 1 - 1
src/views/exercise_questions/data/wordCard.js

@@ -44,7 +44,7 @@ export const wordCardData = {
   property: {
     stem_type: stemTypeList[1].value, // 题干类型
     question_number: '1', // 题号
-    is_enable_description: switchOption[1].value, // 描述
+    is_enable_description: switchOption[0].value, // 描述
     score: 1, // 分值
     score_type: scoreTypeList[0].value, // 分值类型
   },

+ 1 - 1
src/views/exercise_questions/data/write.js

@@ -13,7 +13,7 @@ export const writeData = {
   property: {
     stem_type: stemTypeList[1].value, // 题干类型
     question_number: '1', // 题号
-    is_enable_description: switchOption[1].value, // 描述
+    is_enable_description: switchOption[0].value, // 描述
     score: 1, // 分值
     score_type: scoreTypeList[0].value, // 分值类型
     word_num: 50, // 字数

+ 1 - 1
src/views/exercise_questions/data/writePicture.js

@@ -22,7 +22,7 @@ export const writePictrueData = {
     stem_type: stemTypeList[1].value, // 题干类型
     question_number: '1', // 题号
     score: 1, // 分值
-    is_enable_description: switchOption[1].value, // 描述
+    is_enable_description: switchOption[0].value, // 描述
     score_type: scoreTypeList[0].value, // 分值类型
     word_num: 50, // 字数
     is_enable_sample_text: 'true', // 范文开启