Kaynağa Gözat

修改答题流程问题

dusenyao 1 yıl önce
ebeveyn
işleme
54b1364820

+ 6 - 1
src/views/main/exercise_list/index.js

@@ -55,7 +55,12 @@ export function useExerciseList(calendar) {
   });
 
   function exerciseLink(exercise_share_record_id) {
-    window.open(`${exercise_share_url_path.value}?share_record_id=${exercise_share_record_id}`, '_blank');
+    window.open(
+      `${exercise_share_url_path.value}?share_record_id=${exercise_share_record_id}&back_url=${encodeURIComponent(
+        window.location.href
+      )}?tab=ExerciseList`,
+      '_blank'
+    );
   }
 
   onMounted(() => {

+ 15 - 1
src/views/task_details/student/index.vue

@@ -418,7 +418,21 @@ GetShareConfig().then(({ exercise_share_url_path: path }) => {
 });
 
 function exerciseLink() {
-  window.open(`${exercise_share_url_path.value}?share_record_id=${exercise_share_record_id.value}`, '_blank');
+  // 如果开发环境,直接打开链接
+  if (process.env.NODE_ENV === 'development') {
+    return window.open(
+      `http://localhost:6589/#/open/share/exercise?share_record_id=${
+        exercise_share_record_id.value
+      }&back_url=${encodeURIComponent(window.location.href)}`,
+      '_blank'
+    );
+  }
+  window.open(
+    `${exercise_share_url_path.value}?share_record_id=${exercise_share_record_id.value}&back_url=${encodeURIComponent(
+      window.location.href
+    )}`,
+    '_blank'
+  );
 }
 </script>
 

+ 5 - 1
src/views/task_details/teacher/exercise.js

@@ -21,7 +21,11 @@ export function useExerciseTeacher() {
    */
   function exerciseLink(exercise_share_record_id, exercise_answer_record_id, exercise_id, index) {
     window.open(
-      `${exercise_share_url_path.value}?share_record_id=${exercise_share_record_id}&answer_record_id=${exercise_answer_record_id}&exercise_id=${exercise_id}&question_index=${index}`,
+      `${
+        exercise_share_url_path.value
+      }?share_record_id=${exercise_share_record_id}&answer_record_id=${exercise_answer_record_id}&exercise_id=${exercise_id}&question_index=${index}&back_url=${encodeURIComponent(
+        window.location.href
+      )}`,
       '_blank'
     );
   }

+ 11 - 2
src/views/task_details/teacher/index.vue

@@ -59,7 +59,10 @@
               <span
                 v-for="({ question_id, is_objective, answer_status }, i) in exercise_info.question_list"
                 :key="question_id"
-                :class="['question-list-item', { subjectivity: is_objective === 'false', error: answer_status === 2 }]"
+                :class="[
+                  'question-list-item',
+                  { subjectivity: is_objective === 'false', error: answer_status === 2 || answer_status === 0 }
+                ]"
                 @click="
                   exerciseLink(
                     exercise_info.answer_record.exercise_share_record_id,
@@ -81,7 +84,7 @@
               <el-button type="primary" @click="remarkTaskStudentExecuteInfo_Teacher">批改完成</el-button>
               <el-button>重发</el-button>
               <el-button v-if="student_list.length > 1" @click="next">
-                {{ buttonName }} <i class="el-icon-right"></i>
+                {{ buttonName }} <i :class="buttonIcon"></i>
               </el-button>
             </div>
           </div>
@@ -364,6 +367,11 @@ let buttonName = computed(() => {
   if (list.length <= 0) return '';
   return list[list.length - 1].student_id === curStudentId.value ? $t('Key618') : $t('Key619');
 });
+let buttonIcon = computed(() => {
+  const list = student_list.value;
+  if (list.length <= 0) return '';
+  return list[list.length - 1].student_id === curStudentId.value ? 'el-icon-back' : 'el-icon-right';
+});
 
 function next() {
   const list = student_list.value;
@@ -520,6 +528,7 @@ $bor-color: #d9d9d9;
             }
 
             &.subjectivity {
+              color: $color;
               background-color: #fef2a4;
             }
           }