@@ -328,7 +406,7 @@ export default {
methods: {
// v1.5
//上传截图
- openStem(obj, index, indexs, type) {
+ openStem(obj, type, index, indexs) {
this.stem.index = index;
this.stem.indexs = indexs;
if (type == 1) {
@@ -346,18 +424,18 @@ export default {
if (res && res.status == 0) {
this.stem.screenshot = res.data.url;
if (this.stem.type == 1) {
- // if (this.form.examType == 2) {
- this.questionList[this.stem.index].subQuestions[this.stem.indexs].screenshot = this.stem.screenshot;
- // } else {
- // this.questionList[this.stem.index].screenshot = this.stem.screenshot;
- // }
+ if (this.questionList[0]?.subQuestions) {
+ this.questionList[this.stem.index].subQuestions[this.stem.indexs].screenshot = this.stem.screenshot;
+ } else {
+ this.questionList[this.stem.index].screenshot = this.stem.screenshot;
+ }
} else {
- // if (this.form.examType == 2) {
- this.questionList[this.stem.index].subQuestions[this.stem.indexs].answerScreenshot = this.stem.answerScreenshot;
- // } else {
- // this.questionList[this.stem.index].answerScreenshot = this.stem.answerScreenshot;
- // }
+ if (this.questionList[0]?.subQuestions) {
+ this.questionList[this.stem.index].subQuestions[this.stem.indexs].answerScreenshot = this.stem.answerScreenshot;
+ } else {
+ this.questionList[this.stem.index].answerScreenshot = this.stem.answerScreenshot;
+ }
}
@@ -373,19 +451,19 @@ export default {
// 打开知识点
openKnowledge(obj, index, indexs) {
this.stem.index = index;
- this.stem.indexs = indexs;
+ this.stem.indexs = indexs || 0;
this.stem.knowledge = (obj.knowledge && obj.knowledge.split(",")) || [];
this.dialogKnowledge = true;
},
// 选择知识点
setKnowledge() {
- // if (this.form.examType == 2) {
- this.questionList[this.stem.index].subQuestions[
- this.stem.indexs
- ].knowledge = this.stem.knowledge.join(",");
- // } else {
- // this.questionList[this.stem.index].knowledge = this.stem.knowledge.join(",");
- // }
+ if (this.questionList[0]?.subQuestions) {
+ this.questionList[this.stem.index].subQuestions[
+ this.stem.indexs
+ ].knowledge = this.stem.knowledge.join(",");
+ } else {
+ this.questionList[this.stem.index].knowledge = this.stem.knowledge.join(",");
+ }
this.dialogKnowledge = false;
},
//end
@@ -539,32 +617,32 @@ export default {
//初始化要修改的答案
setFormAns(indexs, index) {
let answerList = "";
- // if (this.form.examType == 2) {
- this.formAns = { ...this.questionList[index].subQuestions[indexs] };
- this.formAns.listIndex = index;
- let startIndex = indexs - this.formAns.subNum; //批量设置大难开始位置
- this.questionList[index].subQuestions.map((item, subIdx) => {
- if (subIdx >= startIndex && subIdx < indexs) {
- answerList += this.setAnswer(item.questionType, item.correctAnswer);
- if (item.qusType == 3) {
- answerList = answerList.slice(0, -1);
+ if (this.questionList[0]?.subQuestions) {
+ this.formAns = { ...this.questionList[index].subQuestions[indexs] };
+ this.formAns.listIndex = index;
+ let startIndex = indexs - this.formAns.subNum; //批量设置大难开始位置
+ this.questionList[index].subQuestions.map((item, subIdx) => {
+ if (subIdx >= startIndex && subIdx < indexs) {
+ answerList += this.setAnswer(item.questionType, item.correctAnswer);
+ if (item.qusType == 3) {
+ answerList = answerList.slice(0, -1);
+ }
}
- }
- });
- // } else {
- // this.formAns = { ...this.questionList[indexs] };
- // let startIndex = indexs - this.formAns.subNum; //批量设置开始位置
- // this.formAns.answerList = [];
- // this.formAns.listIndex = indexs;
- // this.questionList.map((item, subIdx) => {
- // if (subIdx >= startIndex && subIdx < indexs) {
- // answerList += this.setAnswer(item.questionType, item.correctAnswer);
- // if (item.qusType == 3) {
- // answerList = answerList.slice(0, -1);
- // }
- // }
- // });
- // }
+ });
+ } else {
+ this.formAns = { ...this.questionList[indexs] };
+ let startIndex = indexs - this.formAns.subNum; //批量设置开始位置
+ this.formAns.answerList = [];
+ this.formAns.listIndex = indexs;
+ this.questionList.map((item, subIdx) => {
+ if (subIdx >= startIndex && subIdx < indexs) {
+ answerList += this.setAnswer(item.questionType, item.correctAnswer);
+ if (item.qusType == 3) {
+ answerList = answerList.slice(0, -1);
+ }
+ }
+ });
+ }
this.formAns.answerList = answerList;
this.diaSetAns = true;
},
@@ -572,23 +650,23 @@ export default {
//批量修改答案
let EndIndex;
let subNum = this.formAns.subNum - 1;
- // if (this.form.examType == 2) {
- this.questionList[this.formAns.listIndex].subQuestions.some(
- (item, index) => {
+ if (this.questionList[0]?.subQuestions) {
+ this.questionList[this.formAns.listIndex].subQuestions.some(
+ (item, index) => {
+ if (this.formAns.endIndex == item.questionIndex) {
+ EndIndex = index;
+ }
+ return this.formAns.endIndex == item.questionIndex
+ }
+ );
+ } else {
+ this.questionList.some((item, index) => {
if (this.formAns.endIndex == item.questionIndex) {
EndIndex = index;
}
return this.formAns.endIndex == item.questionIndex
- }
- );
- // } else {
- // this.questionList.some((item, index) => {
- // if (this.formAns.endIndex == item.questionIndex) {
- // EndIndex = index;
- // }
- // return this.formAns.endIndex == item.questionIndex
- // });
- // }
+ });
+ }
for (let i = 0; i <= subNum; i++) {
let correctAnswer = "";
@@ -604,30 +682,30 @@ export default {
? 2
: "";
}
- // if (this.form.examType == 2) {
- this.questionList[this.formAns.listIndex].subQuestions[
- EndIndex - i
- ].correctAnswer = correctAnswer;
- // } else {
- // this.questionList[EndIndex - i].correctAnswer = correctAnswer;
- // }
+ if (this.questionList[0]?.subQuestions) {
+ this.questionList[this.formAns.listIndex].subQuestions[
+ EndIndex - i
+ ].correctAnswer = correctAnswer;
+ } else {
+ this.questionList[EndIndex - i].correctAnswer = correctAnswer;
+ }
}
this.diaSetAns = false;
},
async save() {
for (let i = 0; i < this.questionList.length; i++) {
- // if (this.form.examType == 2) {
- for (let j = 0; j < this.questionList[i].subQuestions.length; j++) {
- if (this.questionList[i].subQuestions[j].qusType) {
- this.questionList[i].subQuestions.splice(j, 1);
+ if (this.questionList[0]?.subQuestions) {
+ for (let j = 0; j < this.questionList[i].subQuestions.length; j++) {
+ if (this.questionList[i].subQuestions[j].qusType) {
+ this.questionList[i].subQuestions.splice(j, 1);
+ }
+ }
+ } else {
+ if (this.questionList[i].qusType) {
+ this.questionList.splice(i, 1);
+ i--;
}
}
- // } else {
- // if (this.questionList[i].qusType) {
- // this.questionList.splice(i, 1);
- // i--;
- // }
- // }
}
let questionList = this.questionList.map((item) => {
item.score = null;
@@ -722,11 +800,72 @@ export default {
}
},
formateQuestion() {
- // if (this.form.examType == 2) {
- this.questionList?.map((item) => {
+ if (this.questionList[0]?.subQuestions) {
+ this.questionList?.map((item) => {
+ let types = [{}];
+ let addndex = 0;
+ item.subQuestions.map((sub, index) => {
+ if (!!sub.questionType) {
+ if (
+ sub.questionType == types[addndex].qusType &&
+ sub.questionType != 5
+ ) {
+ //同类型批量答案+1
+ types[addndex].subNum += 1;
+ if (
+ types[addndex].answerOptions.length <
+ sub.answerOptions.length
+ ) {
+ types[addndex].answerOptions = sub.answerOptions;
+ }
+ types[addndex].answerList += this.setAnswer(
+ sub.questionType,
+ sub.correctAnswer
+ );
+ if (index == item.subQuestions.length - 1) {
+ //循环最后类型数量大于等于5,保存批量答案
+ if (types[addndex].subNum && types[addndex].subNum >= 5) {
+ types[addndex].endIndex = sub.questionIndex;
+ types[addndex].index = index;
+ }
+ }
+ } else {
+ if (types[addndex].subNum && types[addndex].subNum >= 5) {
+ //不同类型时如果原有类型数量大于等于5,保存批量答案
+ types[addndex].endIndex =
+ item.subQuestions[index - 1].questionIndex;
+ types[addndex].index = index - 1;
+ addndex += 1;
+ types[addndex] = {};
+ }
+ //不同类型初始化批量答案
+ types[addndex].qusType = sub.questionType;
+ types[addndex].subNum = 1;
+ types[addndex].answerOptions = sub.answerOptions;
+ types[addndex].answerList = this.setAnswer(
+ sub.questionType,
+ sub.correctAnswer
+ );
+ }
+ }
+ });
+ for (let i = 0; i < types.length; i++) {
+ if (types[i].qusType == 3) {
+ types[i].answerList = types[i].answerList.slice(0, -1);
+ }
+ if (types[i].subNum >= 5) {
+ item.subQuestions.splice(
+ types[i].index + i + 1,
+ 0,
+ deepClone(types[i])
+ );
+ }
+ }
+ });
+ } else {
let types = [{}];
let addndex = 0;
- item.subQuestions.map((sub, index) => {
+ this.questionList?.map((sub, index) => {
if (!!sub.questionType) {
if (
sub.questionType == types[addndex].qusType &&
@@ -735,8 +874,7 @@ export default {
//同类型批量答案+1
types[addndex].subNum += 1;
if (
- types[addndex].answerOptions.length <
- sub.answerOptions.length
+ types[addndex].answerOptions.length < sub.answerOptions.length
) {
types[addndex].answerOptions = sub.answerOptions;
}
@@ -744,7 +882,7 @@ export default {
sub.questionType,
sub.correctAnswer
);
- if (index == item.subQuestions.length - 1) {
+ if (index == this.questionList.length - 1) {
//循环最后类型数量大于等于5,保存批量答案
if (types[addndex].subNum && types[addndex].subNum >= 5) {
types[addndex].endIndex = sub.questionIndex;
@@ -755,7 +893,7 @@ export default {
if (types[addndex].subNum && types[addndex].subNum >= 5) {
//不同类型时如果原有类型数量大于等于5,保存批量答案
types[addndex].endIndex =
- item.subQuestions[index - 1].questionIndex;
+ this.questionList[index - 1].questionIndex;
types[addndex].index = index - 1;
addndex += 1;
types[addndex] = {};
@@ -776,74 +914,14 @@ export default {
types[i].answerList = types[i].answerList.slice(0, -1);
}
if (types[i].subNum >= 5) {
- item.subQuestions.splice(
+ this.questionList.splice(
types[i].index + i + 1,
0,
deepClone(types[i])
);
}
}
- });
- // } else {
- // let types = [{}];
- // let addndex = 0;
- // this.questionList?.map((sub, index) => {
- // if (!!sub.questionType) {
- // if (
- // sub.questionType == types[addndex].qusType &&
- // sub.questionType != 5
- // ) {
- // //同类型批量答案+1
- // types[addndex].subNum += 1;
- // if (
- // types[addndex].answerOptions.length < sub.answerOptions.length
- // ) {
- // types[addndex].answerOptions = sub.answerOptions;
- // }
- // types[addndex].answerList += this.setAnswer(
- // sub.questionType,
- // sub.correctAnswer
- // );
- // if (index == this.questionList.length - 1) {
- // //循环最后类型数量大于等于5,保存批量答案
- // if (types[addndex].subNum && types[addndex].subNum >= 5) {
- // types[addndex].endIndex = sub.questionIndex;
- // types[addndex].index = index;
- // }
- // }
- // } else {
- // if (types[addndex].subNum && types[addndex].subNum >= 5) {
- // //不同类型时如果原有类型数量大于等于5,保存批量答案
- // types[addndex].endIndex =
- // this.questionList[index - 1].questionIndex;
- // types[addndex].index = index - 1;
- // addndex += 1;
- // types[addndex] = {};
- // }
- // //不同类型初始化批量答案
- // types[addndex].qusType = sub.questionType;
- // types[addndex].subNum = 1;
- // types[addndex].answerOptions = sub.answerOptions;
- // types[addndex].answerList = this.setAnswer(
- // sub.questionType,
- // sub.correctAnswer
- // );
- // }
- // }
- // });
- // for (let i = 0; i < types.length; i++) {
- // if (types[i].qusType == 3) {
- // types[i].answerList = types[i].answerList.slice(0, -1);
- // }
- // if (types[i].subNum >= 5) {
- // this.questionList.splice(
- // types[i].index + i + 1,
- // 0,
- // deepClone(types[i])
- // );
- // }
- // }
- // }
+ }
},
},
};
@@ -1060,7 +1138,8 @@ export default {
.stem-pic {
display: block;
margin: 0 auto 20px;
- height: 200px;
+ max-width: 100%;
+ max-height: 200px;
object-fit: cover;
}
}
diff --git a/src/views/examinationPaper/edit_Old.vue b/src/views/examinationPaper/edit_Old.vue
index c64e4bd..05f08cf 100644
--- a/src/views/examinationPaper/edit_Old.vue
+++ b/src/views/examinationPaper/edit_Old.vue
@@ -1262,7 +1262,8 @@ export default {
.stem-pic {
display: block;
margin: 0 auto 20px;
- height: 200px;
+ max-width: 100%;
+ max-height: 200px;
object-fit: cover;
}
}
diff --git a/src/views/examinationPaper/index.vue b/src/views/examinationPaper/index.vue
index 78505e3..b76cd46 100644
--- a/src/views/examinationPaper/index.vue
+++ b/src/views/examinationPaper/index.vue
@@ -70,8 +70,10 @@
总题数:{{ item.questionNum }}
|
- 预计时长:{{ item.examsDuration }}
- |
+
+ 预计时长:{{ item.examsDuration }}
+ |
+
授课端同步:
修改分享范围
复制
- 放入回收站
+ 放入回收站
@@ -196,6 +198,8 @@ export default {
this.$store.getters.info.showRole ||
this.$store.getters.info.permissions[0].role;
this.userName = this.$store.getters.info.name || "";
+ this.query.type = this.$route.query.type || 1;
+ this.query.share = this.$route.query.share || 0;
this._QueryClassList2()
await this._QueryClassList();
if (!this.query.classId) {
@@ -206,8 +210,9 @@ export default {
},
methods: {
refreshStic() {
- setTimeout(function () {
- window.location.reload();
+ this.loading = true;
+ setTimeout(() => {
+ this._QueryData();
}, 500);
},
toArchiving() {
@@ -223,6 +228,8 @@ export default {
}
let routerItem = {
path: "/examinationPaperAdd",
+ listType: this.query.type,
+ listShare: this.query.share,
};
query ? (routerItem["query"] = { ...query }) : "";
this.$router.push(routerItem);
@@ -235,6 +242,8 @@ export default {
}
let routerItem = {
path: "/examinationPaperAddAsk",
+ listType: this.query.type,
+ listShare: this.query.share,
};
query ? (routerItem["query"] = { ...query }) : "";
this.$router.push(routerItem);
diff --git a/src/views/examinationPaper/recycle.vue b/src/views/examinationPaper/recycle.vue
index b2f7f42..0ed5e33 100644
--- a/src/views/examinationPaper/recycle.vue
+++ b/src/views/examinationPaper/recycle.vue
@@ -21,60 +21,26 @@