|
@@ -31,7 +31,7 @@
|
|
<el-form label-width="100px">
|
|
<el-form label-width="100px">
|
|
<el-form-item v-if="isEdit" label="题型">
|
|
<el-form-item v-if="isEdit" label="题型">
|
|
<el-button type="primary" size="small">
|
|
<el-button type="primary" size="small">
|
|
- {{ question.sourceDetailName }}
|
|
|
|
|
|
+ {{ questionModel.sourceDetailName }}
|
|
</el-button>
|
|
</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item v-else label="题型">
|
|
<el-form-item v-else label="题型">
|
|
@@ -160,8 +160,13 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
async visibleChange() {
|
|
async visibleChange() {
|
|
- if (this.question.id) {
|
|
|
|
- const res = await questionDetailApi(this.question.id);
|
|
|
|
|
|
+ // paper模式时试题结构{question,[试卷相关信息]}
|
|
|
|
+ const questionId =
|
|
|
|
+ this.editMode === "paper"
|
|
|
|
+ ? this.question.question.id
|
|
|
|
+ : this.question.id;
|
|
|
|
+ if (questionId) {
|
|
|
|
+ const res = await questionDetailApi(questionId);
|
|
|
|
|
|
const courseInfo = {
|
|
const courseInfo = {
|
|
courseId: res.data.course.id,
|
|
courseId: res.data.course.id,
|
|
@@ -171,9 +176,11 @@ export default {
|
|
let questionModel = {
|
|
let questionModel = {
|
|
...res.data,
|
|
...res.data,
|
|
...courseInfo,
|
|
...courseInfo,
|
|
- score: this.question.score,
|
|
|
|
editMode: this.editMode,
|
|
editMode: this.editMode,
|
|
};
|
|
};
|
|
|
|
+ if (this.editMode === "paper") {
|
|
|
|
+ questionModel.score = this.question.score;
|
|
|
|
+ }
|
|
if (questionModel.subQuestions && questionModel.subQuestions.length) {
|
|
if (questionModel.subQuestions && questionModel.subQuestions.length) {
|
|
questionModel.subQuestions = questionModel.subQuestions.map(
|
|
questionModel.subQuestions = questionModel.subQuestions.map(
|
|
(q, qindex) => {
|
|
(q, qindex) => {
|