dusenyao 3 rokov pred
rodič
commit
93e1f91b52

+ 6 - 6
package-lock.json

@@ -11,7 +11,7 @@
         "ailp-book-question-ui": "file:../ailp-book-question-ui-0.1.1.tgz",
         "ailp-book-question-ui": "file:../ailp-book-question-ui-0.1.1.tgz",
         "awe-dnd": "^0.3.4",
         "awe-dnd": "^0.3.4",
         "axios": "^0.25.0",
         "axios": "^0.25.0",
-        "book-ui": "file:../book-ui-0.2.22.tgz",
+        "book-ui": "file:../book-ui-0.2.24.tgz",
         "core-js": "^3.20.3",
         "core-js": "^3.20.3",
         "dayjs": "^1.10.7",
         "dayjs": "^1.10.7",
         "element-ui": "^2.15.6",
         "element-ui": "^2.15.6",
@@ -5488,9 +5488,9 @@
       "license": "MIT"
       "license": "MIT"
     },
     },
     "node_modules/book-ui": {
     "node_modules/book-ui": {
-      "version": "0.2.22",
-      "resolved": "file:../book-ui-0.2.22.tgz",
-      "integrity": "sha512-E9JHMJDj3STD9eKDx5rHG3aX8TylTNusjXs69/mM9WMSyD8Rk/JHxnA9KjPSEH6B3OiDPSGEpTzElmaaXCT0qA==",
+      "version": "0.2.24",
+      "resolved": "file:../book-ui-0.2.24.tgz",
+      "integrity": "sha512-E3FGM/ru7fnq2UZ/XIoGxc5AY8MpXTJYaXlPHfRNtAFkjlKkzDviJKBycSBor7UcKNEwP7Ummy1uBRJqw8nEKA==",
       "dependencies": {
       "dependencies": {
         "awe-dnd": "^0.3.4",
         "awe-dnd": "^0.3.4",
         "axios": "^0.21.1",
         "axios": "^0.21.1",
@@ -26525,8 +26525,8 @@
       }
       }
     },
     },
     "book-ui": {
     "book-ui": {
-      "version": "file:..\\book-ui-0.2.22.tgz",
-      "integrity": "sha512-E9JHMJDj3STD9eKDx5rHG3aX8TylTNusjXs69/mM9WMSyD8Rk/JHxnA9KjPSEH6B3OiDPSGEpTzElmaaXCT0qA==",
+      "version": "file:..\\book-ui-0.2.24.tgz",
+      "integrity": "sha512-E3FGM/ru7fnq2UZ/XIoGxc5AY8MpXTJYaXlPHfRNtAFkjlKkzDviJKBycSBor7UcKNEwP7Ummy1uBRJqw8nEKA==",
       "requires": {
       "requires": {
         "awe-dnd": "^0.3.4",
         "awe-dnd": "^0.3.4",
         "axios": "^0.21.1",
         "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",
     "ailp-book-question-ui": "file:../ailp-book-question-ui-0.1.1.tgz",
     "awe-dnd": "^0.3.4",
     "awe-dnd": "^0.3.4",
     "axios": "^0.25.0",
     "axios": "^0.25.0",
-    "book-ui": "file:../book-ui-0.2.22.tgz",
+    "book-ui": "file:../book-ui-0.2.24.tgz",
     "core-js": "^3.20.3",
     "core-js": "^3.20.3",
     "dayjs": "^1.10.7",
     "dayjs": "^1.10.7",
     "element-ui": "^2.15.6",
     "element-ui": "^2.15.6",

+ 6 - 3
src/components/course/CompletionView.vue

@@ -5,9 +5,12 @@
       <div class="completion-info">
       <div class="completion-info">
         <div>{{ material_name }}</div>
         <div>{{ material_name }}</div>
         <div>
         <div>
-          {{ student_name }} {{ finish_time_view_txt }} {{ $t('Key320') }}:{{ duration }}{{ $t('Key321') }} |
-          {{ $t('Key194') }} {{ count_right }} | {{ $t('Key195') }}
-          {{ count_error }}
+          {{ student_name }} {{ finish_time_view_txt }} {{ $t('Key320') }}:{{ duration }}{{ $t('Key321') }}
+          <template v-if="category !== 'NPC'">
+            | {{ $t('Key194') }} {{ count_right }} |
+            {{ $t('Key195') }}
+            {{ count_error }}
+          </template>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>

+ 6 - 1
src/components/course/FinishCourseware.vue

@@ -26,6 +26,7 @@
     <template v-else-if="category === 'NPC'">
     <template v-else-if="category === 'NPC'">
       <booknpc
       <booknpc
         v-if="context"
         v-if="context"
+        ref="booknpc"
         :is-show-save="true"
         :is-show-save="true"
         task-model=""
         task-model=""
         :context="context"
         :context="context"
@@ -111,6 +112,9 @@ export default {
           this.themeColor = book_theme_color;
           this.themeColor = book_theme_color;
           this.dialogWidth = '900px';
           this.dialogWidth = '900px';
           this.context = JSON.parse(content);
           this.context = JSON.parse(content);
+          this.$nextTick(() => {
+            this.$refs.booknpc.handleAnswerTimeStart();
+          });
           return;
           return;
         }
         }
         if (category === 'NNPE') {
         if (category === 'NNPE') {
@@ -127,13 +131,14 @@ export default {
     });
     });
   },
   },
   methods: {
   methods: {
-    saveNPCAnswer(content) {
+    saveNPCAnswer(content, duration) {
       const loading = this.$loading();
       const loading = this.$loading();
       FinishMyTaskMaterial_Student({
       FinishMyTaskMaterial_Student({
         task_id: this.id,
         task_id: this.id,
         material_type: 'COURSEWARE',
         material_type: 'COURSEWARE',
         material_id: this.coursewareId,
         material_id: this.coursewareId,
         exam_answer: {
         exam_answer: {
+          duration,
           content
           content
         }
         }
       })
       })

+ 12 - 5
src/components/live/CurMaterial.vue

@@ -22,10 +22,12 @@
     <div v-show="!isCurMaterial && material_type === 'COURSEWARE'" class="answer-data">
     <div v-show="!isCurMaterial && material_type === 'COURSEWARE'" class="answer-data">
       <span>{{ $t('Key320') }}</span>
       <span>{{ $t('Key320') }}</span>
       <span class="answer-data-duration">{{ answerData.duration }}{{ $t('Key321') }}</span>
       <span class="answer-data-duration">{{ answerData.duration }}{{ $t('Key321') }}</span>
-      <span class="answer-data-label">{{ $t('Key194') }}</span>
-      <span class="answer-data-count-right">{{ answerData.count_right }}</span>
-      <span class="answer-data-label">{{ $t('Key195') }}</span>
-      <span class="answer-data-count-error">{{ answerData.count_error }}</span>
+      <template v-if="category !== 'NPC'">
+        <span class="answer-data-label">{{ $t('Key194') }}</span>
+        <span class="answer-data-count-right">{{ answerData.count_right }}</span>
+        <span class="answer-data-label">{{ $t('Key195') }}</span>
+        <span class="answer-data-count-error">{{ answerData.count_error }}</span>
+      </template>
     </div>
     </div>
 
 
     <template v-if="material_type === 'COURSEWARE' && visible">
     <template v-if="material_type === 'COURSEWARE' && visible">
@@ -50,6 +52,7 @@
       <template v-else-if="category === 'NPC'">
       <template v-else-if="category === 'NPC'">
         <booknpc
         <booknpc
           v-if="context && refresh"
           v-if="context && refresh"
+          ref="booknpc"
           :task-model="isFinished ? 'ANSWER' : ''"
           :task-model="isFinished ? 'ANSWER' : ''"
           :is-show-save="!isFinished"
           :is-show-save="!isFinished"
           :book-answer-content="bookAnswerContent"
           :book-answer-content="bookAnswerContent"
@@ -293,6 +296,9 @@ export default {
           if (category === 'NPC') {
           if (category === 'NPC') {
             this.themeColor = book_theme_color;
             this.themeColor = book_theme_color;
             this.context = JSON.parse(content);
             this.context = JSON.parse(content);
+            this.$nextTick(() => {
+              this.$refs.booknpc.handleAnswerTimeStart();
+            });
             return;
             return;
           }
           }
           if (category === 'NNPE') {
           if (category === 'NNPE') {
@@ -362,13 +368,14 @@ export default {
       this.exam_answer = data;
       this.exam_answer = data;
     },
     },
 
 
-    saveNPCAnswer(content) {
+    saveNPCAnswer(content, duration) {
       const loading = this.$loading();
       const loading = this.$loading();
       FinishMyMaterial({
       FinishMyMaterial({
         task_id: this.taskId,
         task_id: this.taskId,
         material_id: this.material_id,
         material_id: this.material_id,
         material_type: this.material_type,
         material_type: this.material_type,
         exam_answer: {
         exam_answer: {
+          duration,
           content
           content
         }
         }
       })
       })

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

@@ -39,8 +39,10 @@
       <div v-show="isStudent" class="answer-info">
       <div v-show="isStudent" class="answer-info">
         <span class="current-student-name">{{ curStudentName }}:</span>
         <span class="current-student-name">{{ curStudentName }}:</span>
         <template v-if="material_type === 'COURSEWARE'">
         <template v-if="material_type === 'COURSEWARE'">
-          <span>{{ $t('Key320') }}</span>
-          <span class="answer-info-duration">{{ duration }}{{ $t('Key321') }}</span>
+          <template v-if="category !== 'NPC'">
+            <span>{{ $t('Key320') }}</span>
+            <span class="answer-info-duration">{{ duration }}{{ $t('Key321') }}</span>
+          </template>
           <span class="answer-info-label">{{ $t('Key194') }}</span>
           <span class="answer-info-label">{{ $t('Key194') }}</span>
           <span class="answer-info-count-right">{{ count_right }}</span>
           <span class="answer-info-count-right">{{ count_right }}</span>
           <span class="answer-info-label">{{ $t('Key195') }}</span>
           <span class="answer-info-label">{{ $t('Key195') }}</span>

+ 26 - 7
src/views/main/TaskList.vue

@@ -68,14 +68,19 @@
             {{ date_stamp }}
             {{ date_stamp }}
           </li>
           </li>
           <li
           <li
-            v-for="{ id, cs_item_name, time_type, course_name, teaching_type, time_space_view_txt, name } in task_list"
+            v-for="{
+              id,
+              cs_item_name,
+              time_type,
+              course_id: cid,
+              course_name,
+              teaching_type,
+              time_space_view_txt,
+              name
+            } in task_list"
             :key="id"
             :key="id"
             class="task-item"
             class="task-item"
-            :style="{
-              'background-color': colorMatching[i % 7].background,
-              color: colorMatching[i % 7].main,
-              border: `1px solid ${colorMatching[i % 7].border}`
-            }"
+            :style="getItemStyle(cid)"
             @click="taskLink_outside(id)"
             @click="taskLink_outside(id)"
           >
           >
             <div class="task-item-top">
             <div class="task-item-top">
@@ -135,7 +140,9 @@ export default {
       timeType: -1,
       timeType: -1,
       task_group_list: [],
       task_group_list: [],
       message_list: [],
       message_list: [],
-      course_list: []
+      course_list: [],
+      // 课程 id 列表,用于颜色显示
+      courseIdList: []
     };
     };
   },
   },
   computed: {
   computed: {
@@ -266,6 +273,18 @@ export default {
       });
       });
     },
     },
 
 
+    getItemStyle(id) {
+      if (!this.courseIdList.includes(id)) {
+        this.courseIdList.push(id);
+      }
+      let i = this.courseIdList.indexOf(id) % 7;
+      return {
+        'background-color': colorMatching[i].background,
+        color: colorMatching[i].main,
+        border: `1px solid ${colorMatching[i].border}`
+      };
+    },
+
     goPersonal() {
     goPersonal() {
       window.location.href = `/GCLS-Personal/#/EnterSys`;
       window.location.href = `/GCLS-Personal/#/EnterSys`;
     }
     }