|
@@ -468,7 +468,7 @@
|
|
|
<img
|
|
|
src="../assets/icon/secondToolList/library.png"
|
|
|
alt
|
|
|
- @click="addTools(tooC, toolIndex)"
|
|
|
+ @click="addTools(tooC, toolIndex, index)"
|
|
|
/>
|
|
|
<div style="margin: 5px 0">素材库</div>
|
|
|
</div>
|
|
@@ -476,13 +476,13 @@
|
|
|
<img
|
|
|
src="../assets/icon/secondToolList/library.png"
|
|
|
alt
|
|
|
- @click="addTools(tooC, toolIndex)"
|
|
|
+ @click="addTools(tooC, toolIndex, index)"
|
|
|
/>
|
|
|
<div style="margin: 5px 0">学习资料</div>
|
|
|
</div>
|
|
|
<div v-if="tooC == 2">
|
|
|
<img
|
|
|
- @click="addTools(tooC, toolIndex)"
|
|
|
+ @click="addTools(tooC, toolIndex, index)"
|
|
|
src="../assets/icon/secondToolList/note.png"
|
|
|
alt
|
|
|
/>
|
|
@@ -490,7 +490,7 @@
|
|
|
</div>
|
|
|
<div v-if="tooC == 4">
|
|
|
<img
|
|
|
- @click="addTools(tooC, toolIndex)"
|
|
|
+ @click="addTools(tooC, toolIndex, index)"
|
|
|
src="../assets/icon/thirdToolList/ask.png"
|
|
|
alt
|
|
|
/>
|
|
@@ -498,7 +498,7 @@
|
|
|
</div>
|
|
|
<div v-if="tooC == 5">
|
|
|
<img
|
|
|
- @click="addTools(tooC, toolIndex)"
|
|
|
+ @click="addTools(tooC, toolIndex, index)"
|
|
|
src="../assets/icon/thirdToolList/score.png"
|
|
|
alt
|
|
|
/>
|
|
@@ -506,7 +506,7 @@
|
|
|
</div>
|
|
|
<div v-if="tooC == 10">
|
|
|
<img
|
|
|
- @click="addTools(tooC, toolIndex)"
|
|
|
+ @click="addTools(tooC, toolIndex, index)"
|
|
|
src="../assets/icon/thirdToolList/time.png"
|
|
|
alt
|
|
|
/>
|
|
@@ -514,7 +514,7 @@
|
|
|
</div>
|
|
|
<div v-if="tooC == 15">
|
|
|
<img
|
|
|
- @click="addTools(tooC, toolIndex)"
|
|
|
+ @click="addTools(tooC, toolIndex, index)"
|
|
|
src="../assets/icon/thirdToolList/answer.png"
|
|
|
alt
|
|
|
/>
|
|
@@ -522,11 +522,11 @@
|
|
|
</div>
|
|
|
<div v-if="tooC == 18">
|
|
|
<img
|
|
|
- @click="addTools(tooC, toolIndex)"
|
|
|
+ @click="addTools(tooC, toolIndex, index)"
|
|
|
src="../assets/icon/thirdToolList/trainPlatform.png"
|
|
|
alt
|
|
|
/>
|
|
|
- <div style="margin: 5px 0">训练平台</div>
|
|
|
+ <div style="margin: 5px 0">训练服务器</div>
|
|
|
</div>
|
|
|
<!-- <div v-if="tooC == 16">
|
|
|
<img
|
|
@@ -1099,6 +1099,8 @@ export default {
|
|
|
askTitle: "",
|
|
|
askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
|
|
|
},
|
|
|
+ askList: [],
|
|
|
+ answerList: [],
|
|
|
navList: [],
|
|
|
};
|
|
|
},
|
|
@@ -1154,7 +1156,6 @@ export default {
|
|
|
cid: this.id,
|
|
|
stage: this.courseType,
|
|
|
task: i,
|
|
|
- // chid: this.chapInfoList[this.courseType - 0].chapterInfo[0].chapterid,
|
|
|
content: this.upToolImg,
|
|
|
type: 1,
|
|
|
},
|
|
@@ -1367,23 +1368,28 @@ export default {
|
|
|
// }, 0);
|
|
|
},
|
|
|
addQuestion() {
|
|
|
+ this.answerList.push({
|
|
|
+ answerTitle: this.answerQ,
|
|
|
+ answer: this.questionAnswer,
|
|
|
+ });
|
|
|
let params = [
|
|
|
{
|
|
|
- cid: this.id,
|
|
|
- // chid: this.chapInfoList[this.courseType - 0].chapterInfo[0].chapterid,
|
|
|
- chid: this.courseType,
|
|
|
- t: this.questionAnswer,
|
|
|
uid: this.userid,
|
|
|
+ cid: this.id,
|
|
|
+ stage: this.courseType,
|
|
|
+ task: this.taskCount,
|
|
|
+ content: JSON.stringify(this.answerList),
|
|
|
+ type: 3,
|
|
|
},
|
|
|
];
|
|
|
this.ajax
|
|
|
- .post(this.$store.state.api + "addProblem", params)
|
|
|
+ .post(this.$store.state.api + "addCourseWorks", params)
|
|
|
.then((res) => {
|
|
|
this.$message({
|
|
|
message: "提交成功",
|
|
|
type: "success",
|
|
|
});
|
|
|
- this.questionAnswer = "";
|
|
|
+ this.answerDialogVisible = false;
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
this.$message.error("提交失败");
|
|
@@ -1674,58 +1680,60 @@ export default {
|
|
|
// ];
|
|
|
},
|
|
|
addStudentAsk() {
|
|
|
- if (this.isAsk == true) {
|
|
|
- this.dialogVisible5 = false;
|
|
|
- } else {
|
|
|
- let params = [
|
|
|
- {
|
|
|
- cid: this.id,
|
|
|
- stage: this.courseType,
|
|
|
- task: this.taskCount,
|
|
|
- content: this.radio.join(","),
|
|
|
- uid: this.userid,
|
|
|
- },
|
|
|
- ];
|
|
|
- this.ajax
|
|
|
- .post(this.$store.state.api + "addAskList", params)
|
|
|
- .then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "提交成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.dialogVisible5 = false;
|
|
|
- this.radio = [];
|
|
|
- this.getStudentAsk();
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("提交失败");
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- getStudentAsk() {
|
|
|
- let params = {
|
|
|
- cid: this.id,
|
|
|
- stage: this.courseType,
|
|
|
- task: this.taskCount,
|
|
|
- };
|
|
|
+ // if (this.isAsk == true) {
|
|
|
+ // this.dialogVisible5 = false;
|
|
|
+ // } else {
|
|
|
+ this.askList.push({ askJson: this.askJson, anwer: this.radio.join(",") });
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ uid: this.userid,
|
|
|
+ cid: this.id,
|
|
|
+ stage: this.courseType,
|
|
|
+ task: this.taskCount,
|
|
|
+ content: JSON.stringify(this.askList),
|
|
|
+ type: 2,
|
|
|
+ },
|
|
|
+ ];
|
|
|
this.ajax
|
|
|
- .get(this.$store.state.api + "getAskListByCidStage", params)
|
|
|
+ .post(this.$store.state.api + "addCourseWorks", params)
|
|
|
.then((res) => {
|
|
|
- if (res.data[0].length > 0) {
|
|
|
- var a = res.data[0][0].content.split(",");
|
|
|
- for (var i = 0; i < a.length; i++) {
|
|
|
- this.radio.push(parseInt(a[i]));
|
|
|
- }
|
|
|
- this.isAsk = true;
|
|
|
- } else {
|
|
|
- this.isAsk = false;
|
|
|
- }
|
|
|
+ this.$message({
|
|
|
+ message: "提交成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.dialogVisible5 = false;
|
|
|
+ // this.radio = [];
|
|
|
+ // this.getStudentAsk();
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
+ this.$message.error("提交失败");
|
|
|
console.error(err);
|
|
|
});
|
|
|
+ // }
|
|
|
},
|
|
|
+ // getStudentAsk() {
|
|
|
+ // let params = {
|
|
|
+ // cid: this.id,
|
|
|
+ // stage: this.courseType,
|
|
|
+ // task: this.taskCount,
|
|
|
+ // };
|
|
|
+ // this.ajax
|
|
|
+ // .get(this.$store.state.api + "getAskListByCidStage", params)
|
|
|
+ // .then((res) => {
|
|
|
+ // if (res.data[0].length > 0) {
|
|
|
+ // var a = res.data[0][0].content.split(",");
|
|
|
+ // for (var i = 0; i < a.length; i++) {
|
|
|
+ // this.radio.push(parseInt(a[i]));
|
|
|
+ // }
|
|
|
+ // this.isAsk = true;
|
|
|
+ // } else {
|
|
|
+ // this.isAsk = false;
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
+ // },
|
|
|
addWork() {
|
|
|
if (this.studyJuri[0].content == "") {
|
|
|
this.$message.error("请将信息填写完整");
|
|
@@ -1878,8 +1886,9 @@ export default {
|
|
|
// }
|
|
|
// }
|
|
|
// },
|
|
|
- addTools(t, i) {
|
|
|
+ addTools(t, i, index) {
|
|
|
var a = 0;
|
|
|
+ this.taskCount = index;
|
|
|
if (t == 1) {
|
|
|
if (this.wbCount > 0) {
|
|
|
this.updateCount(this.wbCount, t);
|
|
@@ -1917,17 +1926,13 @@ export default {
|
|
|
}
|
|
|
if (!this.dialogVisible2) {
|
|
|
this.askJson.askJson =
|
|
|
- this.chapInfo.chapterInfo[0].taskJson[this.taskCount].toolChoose[
|
|
|
+ this.chapInfo.chapterInfo[0].taskJson[index].toolChoose[
|
|
|
i
|
|
|
].askJson[0];
|
|
|
this.askJson.askTitle =
|
|
|
- this.chapInfo.chapterInfo[0].taskJson[this.taskCount].toolChoose[
|
|
|
- i
|
|
|
- ].askTitle;
|
|
|
+ this.chapInfo.chapterInfo[0].taskJson[index].toolChoose[i].askTitle;
|
|
|
this.askJson.askCount =
|
|
|
- this.chapInfo.chapterInfo[0].taskJson[this.taskCount].toolChoose[
|
|
|
- i
|
|
|
- ].askCount;
|
|
|
+ this.chapInfo.chapterInfo[0].taskJson[index].toolChoose[i].askCount;
|
|
|
} else {
|
|
|
this.askJson.askJson = this.chapTools.askJson.askJson[0];
|
|
|
this.askJson.askTitle = this.chapTools.askJson.askTitle;
|
|
@@ -2016,10 +2021,10 @@ export default {
|
|
|
a = this.answerCount;
|
|
|
this.toolsCount(a, t);
|
|
|
}
|
|
|
- this.answerQ = this.chapInfo.chapterInfo[0].taskJson[this.taskCount]
|
|
|
- .toolChoose[i].answerQ
|
|
|
- ? this.chapInfo.chapterInfo[0].taskJson[this.taskCount].toolChoose[i]
|
|
|
- .answerQ
|
|
|
+ this.answerQ = this.chapInfo.chapterInfo[0].taskJson[index].toolChoose[
|
|
|
+ i
|
|
|
+ ].answerQ
|
|
|
+ ? this.chapInfo.chapterInfo[0].taskJson[index].toolChoose[i].answerQ
|
|
|
: "";
|
|
|
this.answerDialogVisible = true;
|
|
|
}
|