浏览代码

取下一题时,保证全部题目已经取出再显示

Michael Wang 6 年之前
父节点
当前提交
b3924d02df

+ 7 - 8
src/features/OnlineExam/Examing/QuestionView.vue

@@ -3,16 +3,19 @@
   <div style="overflow: auto">
     <div class="question-header">
       <Icon :type="examQuestion.isSign ? 'ios-star':'ios-star-outline'" :style="{color: '#ffcc00'}" class="star" @click="toggleSign" />
-      <question-index :examQuestion="examQuestion" />
+      <question-index v-if="examQuestion.getQuestionContent" :examQuestion="examQuestion" />
     </div>
-    <div v-if="parentQuestionBody" class="question-view">
+    <div v-if="parentQuestionBody && examQuestion.getQuestionContent" class="question-view">
       <question-body :questionBody="parentQuestionBody" :examQuestion="examQuestion" style="margin-bottom: 20px" :key="examQuestion.questionId"></question-body>
       <div class="hr" />
     </div>
+    <div v-if="!examQuestion.getQuestionContent">
+      试题获取中...
+    </div>
 
     <transition name="fade">
 
-      <div v-show="question && examQuestion" class="question-view" :key="examQuestion.order">
+      <div v-show="question && examQuestion && examQuestion.getQuestionContent" class="question-view" :key="examQuestion.order">
 
         <template v-if="question && question.questionType === 'SINGLE_CHOICE'">
           <single-question-view :question="question" :examQuestion="examQuestion" :key="examQuestion.order" />
@@ -51,8 +54,7 @@ export default {
   data() {
     return {
       parentQuestionBody: null,
-      question: null,
-      updateQuestioning: false // TODO: 更新问题时,隐藏旧内容。可能用不着
+      question: null
     };
   },
   props: {
@@ -64,7 +66,6 @@ export default {
   methods: {
     ...mapMutations(["updateExamQuestion"]),
     async updateQuestion() {
-      this.updateQuestioning = true;
       const currentExamQuestion = this.examQuestion; // 避免以后执行时,this.examQuestion换掉了
       const examRecordDataId = this.$route.params.examRecordDataId;
 
@@ -77,12 +78,10 @@ export default {
             examRecordDataId
         );
       } catch (e) {
-        this.updateQuestioning = false;
         this.parentQuestionBody = null;
         this.question = null;
         return;
       }
-      this.updateQuestioning = false;
       const question = qContentRes.data;
 
       this.updateExamQuestion({

+ 2 - 1
src/features/OnlineExam/Examing/TextQuestionView.vue

@@ -97,7 +97,8 @@ export default {
 }
 
 .stu-answer {
-  width: 500px;
+  width: 100%;
+  max-width: 500px;
   min-height: 300px;
 }