dusenyao 3 years ago
parent
commit
8aa06ff1fa
4 changed files with 22 additions and 17 deletions
  1. 6 6
      package-lock.json
  2. 1 1
      package.json
  3. 10 8
      src/components/live/CurMaterial.vue
  4. 5 2
      src/views/live/teacher/CompleteList.vue

+ 6 - 6
package-lock.json

@@ -11,7 +11,7 @@
         "ailp-book-question-ui": "file:../ailp-book-question-ui-0.1.1.tgz",
         "awe-dnd": "^0.3.4",
         "axios": "^0.25.0",
-        "book-ui": "file:../book-ui-0.2.21.tgz",
+        "book-ui": "file:../book-ui-0.2.22.tgz",
         "core-js": "^3.20.3",
         "dayjs": "^1.10.7",
         "element-ui": "^2.15.6",
@@ -5488,9 +5488,9 @@
       "license": "MIT"
     },
     "node_modules/book-ui": {
-      "version": "0.2.21",
-      "resolved": "file:../book-ui-0.2.21.tgz",
-      "integrity": "sha512-JF9Q9D8amJKYtHwL9DMaEHAZ2QxSb6pZw+HBl+83y7KyJIkJvjuR2iDRZgOZmj49veJrm0ni7Jh4uOfM5EWeKQ==",
+      "version": "0.2.22",
+      "resolved": "file:../book-ui-0.2.22.tgz",
+      "integrity": "sha512-E9JHMJDj3STD9eKDx5rHG3aX8TylTNusjXs69/mM9WMSyD8Rk/JHxnA9KjPSEH6B3OiDPSGEpTzElmaaXCT0qA==",
       "dependencies": {
         "awe-dnd": "^0.3.4",
         "axios": "^0.21.1",
@@ -26525,8 +26525,8 @@
       }
     },
     "book-ui": {
-      "version": "file:..\\book-ui-0.2.21.tgz",
-      "integrity": "sha512-JF9Q9D8amJKYtHwL9DMaEHAZ2QxSb6pZw+HBl+83y7KyJIkJvjuR2iDRZgOZmj49veJrm0ni7Jh4uOfM5EWeKQ==",
+      "version": "file:..\\book-ui-0.2.22.tgz",
+      "integrity": "sha512-E9JHMJDj3STD9eKDx5rHG3aX8TylTNusjXs69/mM9WMSyD8Rk/JHxnA9KjPSEH6B3OiDPSGEpTzElmaaXCT0qA==",
       "requires": {
         "awe-dnd": "^0.3.4",
         "axios": "^0.21.1",

+ 1 - 1
package.json

@@ -16,7 +16,7 @@
     "ailp-book-question-ui": "file:../ailp-book-question-ui-0.1.1.tgz",
     "awe-dnd": "^0.3.4",
     "axios": "^0.25.0",
-    "book-ui": "file:../book-ui-0.2.21.tgz",
+    "book-ui": "file:../book-ui-0.2.22.tgz",
     "core-js": "^3.20.3",
     "dayjs": "^1.10.7",
     "element-ui": "^2.15.6",

+ 10 - 8
src/components/live/CurMaterial.vue

@@ -49,7 +49,7 @@
       </template>
       <template v-else-if="category === 'NPC'">
         <booknpc
-          v-if="context"
+          v-if="context && refresh"
           :task-model="isFinished ? 'ANSWER' : ''"
           :is-show-save="!isFinished"
           :book-answer-content="bookAnswerContent"
@@ -163,7 +163,8 @@ export default {
         count_error: 0
       },
       text: '',
-      themeColor: ''
+      themeColor: '',
+      refresh: true
     };
   },
   computed: {
@@ -336,7 +337,9 @@ export default {
         this.answerData = { duration, count_not_done, count_right, count_error };
 
         this.curStudentID = '';
+        this.refresh = false;
         this.$nextTick(() => {
+          this.refresh = true;
           this.curStudentID = student_id;
         });
       });
@@ -362,17 +365,16 @@ export default {
     saveNPCAnswer(content) {
       const loading = this.$loading();
       FinishMyMaterial({
-        task_id: this.id,
-        material_type: 'COURSEWARE',
-        material_id: this.coursewareId,
+        task_id: this.taskId,
+        material_id: this.material_id,
+        material_type: this.material_type,
         exam_answer: {
           content
         }
       })
         .then(() => {
-          this.$message.success(this.$i18n.t('Key334'));
-          this.dialogClose();
-          this.$router.go(0);
+          this.$message.success('已完成');
+          this.dialogMaterialClose();
         })
         .finally(() => {
           loading.close();

+ 5 - 2
src/views/live/teacher/CompleteList.vue

@@ -65,7 +65,7 @@
         </template>
         <template v-else-if="category === 'NPC'">
           <booknpc
-            v-if="context"
+            v-if="context && refresh"
             task-model="ANSWER"
             :is-show-save="false"
             :book-answer-content="bookAnswerContent"
@@ -168,7 +168,8 @@ export default {
       listTimer: null,
       marginLeft: 0,
       isAlignCenter: true,
-      text: ''
+      text: '',
+      refresh: true
     };
   },
   computed: {
@@ -373,7 +374,9 @@ export default {
         this.count_error = count_error;
 
         this.curStudentID = '';
+        this.refresh = false;
         this.$nextTick(() => {
+          this.refresh = true;
           this.curStudentID = student_id;
         });
         this.curStudentName = student_name;