|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <div style="overflow: auto">
|
|
|
|
|
|
+ <div class="question-container">
|
|
<div class="question-header">
|
|
<div class="question-header">
|
|
<Icon
|
|
<Icon
|
|
:type="examQuestion.isSign ? 'ios-star' : 'ios-star-outline'"
|
|
:type="examQuestion.isSign ? 'ios-star' : 'ios-star-outline'"
|
|
@@ -12,104 +12,45 @@
|
|
:examQuestion="examQuestion"
|
|
:examQuestion="examQuestion"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
- <div v-if="parentQuestionBody" 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 && examQuestion.getQuestionContent"
|
|
|
|
- class="question-view"
|
|
|
|
- :key="examQuestion.order"
|
|
|
|
- >
|
|
|
|
- <div style="margin-bottom: -45px;">{{ examQuestion.groupOrder }}、</div>
|
|
|
|
- <template
|
|
|
|
- v-if="
|
|
|
|
- question &&
|
|
|
|
- question.questionType === 'SINGLE_CHOICE' &&
|
|
|
|
- examQuestion.questionType === 'SINGLE_CHOICE'
|
|
|
|
- "
|
|
|
|
- >
|
|
|
|
- <single-question-view
|
|
|
|
- :question="question"
|
|
|
|
- :examQuestion="examQuestion"
|
|
|
|
- :key="examQuestion.order"
|
|
|
|
- />
|
|
|
|
- </template>
|
|
|
|
- <template
|
|
|
|
- v-if="
|
|
|
|
- question &&
|
|
|
|
- question.questionType === 'MULTIPLE_CHOICE' &&
|
|
|
|
- examQuestion.questionType === 'MULTIPLE_CHOICE'
|
|
|
|
- "
|
|
|
|
- >
|
|
|
|
- <multiple-question-view
|
|
|
|
- :question="question"
|
|
|
|
|
|
+ <split-pane
|
|
|
|
+ v-if="parentQuestionBody"
|
|
|
|
+ :min-percent="10"
|
|
|
|
+ :default-percent="parentPaneHeight"
|
|
|
|
+ split="horizontal"
|
|
|
|
+ >
|
|
|
|
+ <template slot="paneL">
|
|
|
|
+ <div v-if="parentQuestionBody" class="question-view parent-question">
|
|
|
|
+ <question-body
|
|
|
|
+ :questionBody="parentQuestionBody"
|
|
:examQuestion="examQuestion"
|
|
:examQuestion="examQuestion"
|
|
- :key="examQuestion.order"
|
|
|
|
- />
|
|
|
|
- </template>
|
|
|
|
- <template
|
|
|
|
- v-if="
|
|
|
|
- question &&
|
|
|
|
- question.questionType === 'TRUE_OR_FALSE' &&
|
|
|
|
- examQuestion.questionType === 'TRUE_OR_FALSE'
|
|
|
|
- "
|
|
|
|
- >
|
|
|
|
- <boolean-question-view
|
|
|
|
- :question="question"
|
|
|
|
- :examQuestion="examQuestion"
|
|
|
|
- :key="examQuestion.order"
|
|
|
|
- />
|
|
|
|
- </template>
|
|
|
|
- <template
|
|
|
|
- v-if="
|
|
|
|
- question &&
|
|
|
|
- question.questionType === 'FILL_UP' &&
|
|
|
|
- examQuestion.questionType === 'FILL_UP'
|
|
|
|
- "
|
|
|
|
- >
|
|
|
|
- <fill-blank-question-view
|
|
|
|
- :question="question"
|
|
|
|
- :examQuestion="examQuestion"
|
|
|
|
- :key="examQuestion.order"
|
|
|
|
- />
|
|
|
|
- </template>
|
|
|
|
- <template
|
|
|
|
- v-if="
|
|
|
|
- question &&
|
|
|
|
- question.questionType === 'ESSAY' &&
|
|
|
|
- examQuestion.questionType === 'ESSAY'
|
|
|
|
- "
|
|
|
|
- >
|
|
|
|
- <text-question-view
|
|
|
|
- :question="question"
|
|
|
|
- :examQuestion="examQuestion"
|
|
|
|
- :key="examQuestion.order"
|
|
|
|
- />
|
|
|
|
- </template>
|
|
|
|
- </div>
|
|
|
|
- </transition>
|
|
|
|
|
|
+ style="margin-bottom: 20px"
|
|
|
|
+ :key="examQuestion.questionId"
|
|
|
|
+ ></question-body>
|
|
|
|
+ <!-- <div class="hr" /> -->
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot="paneR">
|
|
|
|
+ <QuestionViewSingle :question="question" :examQuestion="examQuestion" />
|
|
|
|
+ </template>
|
|
|
|
+ </split-pane>
|
|
|
|
+
|
|
|
|
+ <QuestionViewSingle
|
|
|
|
+ v-if="!parentQuestionBody"
|
|
|
|
+ :question="question"
|
|
|
|
+ :examQuestion="examQuestion"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <div v-if="!examQuestion.getQuestionContent">试题获取中...</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import QuestionIndex from "./QuestionIndex";
|
|
import QuestionIndex from "./QuestionIndex";
|
|
import QuestionBody from "./QuestionBody";
|
|
import QuestionBody from "./QuestionBody";
|
|
-import SingleQuestionView from "./SingleQuestionView";
|
|
|
|
-import MultipleQuestionView from "./MultipleQuestionView";
|
|
|
|
-import BooleanQuestionView from "./BooleanQuestionView";
|
|
|
|
-import FillBlankQuestionView from "./FillBlankQuestionView";
|
|
|
|
-import TextQuestionView from "./TextQuestionView";
|
|
|
|
|
|
+import QuestionViewSingle from "./QuestionViewSingle";
|
|
import { createNamespacedHelpers } from "vuex";
|
|
import { createNamespacedHelpers } from "vuex";
|
|
const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
|
|
const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
|
|
|
|
+import splitPane from "vue-splitpane";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "QuestionView",
|
|
name: "QuestionView",
|
|
@@ -117,6 +58,7 @@ export default {
|
|
return {
|
|
return {
|
|
parentQuestionBody: null,
|
|
parentQuestionBody: null,
|
|
question: null,
|
|
question: null,
|
|
|
|
+ parentPaneHeight: 50,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
props: {
|
|
props: {
|
|
@@ -125,6 +67,7 @@ export default {
|
|
created() {
|
|
created() {
|
|
this.updateQuestion();
|
|
this.updateQuestion();
|
|
},
|
|
},
|
|
|
|
+ mounted() {},
|
|
methods: {
|
|
methods: {
|
|
...mapMutations(["updateExamQuestion"]),
|
|
...mapMutations(["updateExamQuestion"]),
|
|
async updateQuestion() {
|
|
async updateQuestion() {
|
|
@@ -236,6 +179,21 @@ export default {
|
|
this.question =
|
|
this.question =
|
|
question.questionUnitList[currentExamQuestion.subNumber - 1];
|
|
question.questionUnitList[currentExamQuestion.subNumber - 1];
|
|
|
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ // 从非套题进入套题时,会根据套题的内容动态调整套题的默认高度
|
|
|
|
+ const parentQuestion = document.getElementsByClassName(
|
|
|
|
+ "parent-question"
|
|
|
|
+ )[0];
|
|
|
|
+ if (parentQuestion) {
|
|
|
|
+ this.parentPaneHeight =
|
|
|
|
+ 5 +
|
|
|
|
+ (100 * parentQuestion.clientHeight) /
|
|
|
|
+ (document.body.clientHeight - 160);
|
|
|
|
+ if (this.parentPaneHeight > 60) {
|
|
|
|
+ this.parentPaneHeight = 60;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
{
|
|
{
|
|
// cache next question content
|
|
// cache next question content
|
|
const currentOrder = currentExamQuestion.order;
|
|
const currentOrder = currentExamQuestion.order;
|
|
@@ -267,21 +225,30 @@ export default {
|
|
components: {
|
|
components: {
|
|
QuestionIndex,
|
|
QuestionIndex,
|
|
QuestionBody,
|
|
QuestionBody,
|
|
- SingleQuestionView,
|
|
|
|
- MultipleQuestionView,
|
|
|
|
- BooleanQuestionView,
|
|
|
|
- FillBlankQuestionView,
|
|
|
|
- TextQuestionView,
|
|
|
|
|
|
+ "split-pane": splitPane,
|
|
|
|
+ QuestionViewSingle,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
|
+.question-container {
|
|
|
|
+ overflow: scroll;
|
|
|
|
+}
|
|
|
|
+.question-container >>> .splitter-pane {
|
|
|
|
+ overflow: scroll;
|
|
|
|
+}
|
|
|
|
+.question-container >>> .vue-splitter-container {
|
|
|
|
+ height: calc(100% - 42px);
|
|
|
|
+}
|
|
|
|
+.question-container >>> .splitter-pane-resizer.horizontal {
|
|
|
|
+ height: 15px;
|
|
|
|
+}
|
|
.question-view {
|
|
.question-view {
|
|
padding: 20px 30px;
|
|
padding: 20px 30px;
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
text-align: left;
|
|
text-align: left;
|
|
- overflow: auto;
|
|
|
|
|
|
+ overflow: scroll;
|
|
}
|
|
}
|
|
|
|
|
|
.question-header {
|
|
.question-header {
|