|
@@ -55,8 +55,22 @@
|
|
|
:content="nav.taskName"
|
|
|
placement="top"
|
|
|
>
|
|
|
- <div>{{ nav.taskName }}</div>
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ width:
|
|
|
+ IsLookOpen && !nav.isLook
|
|
|
+ ? 'calc(100% - 75px)'
|
|
|
+ : 'auto',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ {{ nav.taskName }}
|
|
|
+ </div>
|
|
|
</el-tooltip>
|
|
|
+ <img
|
|
|
+ src="../assets/lock.png"
|
|
|
+ v-if="IsLookOpen && !nav.isLook"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -1610,9 +1624,7 @@
|
|
|
<div>
|
|
|
<span>{{ index + 1 + "、" + item.askstitle }}</span>
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="right_box_xuan"
|
|
|
- >
|
|
|
+ <div class="right_box_xuan">
|
|
|
<span>正确率</span>
|
|
|
<span>{{
|
|
|
(checkJson[toolIndex][index].right
|
|
@@ -3570,15 +3582,25 @@
|
|
|
class="dialog_diy"
|
|
|
>
|
|
|
<div>
|
|
|
- <div>
|
|
|
- <div>
|
|
|
+ <div class="open_box">
|
|
|
+ <div class="switch_box">
|
|
|
+ <span>学生是否能查看所有作业</span>
|
|
|
<el-switch
|
|
|
v-model="sIsOpen"
|
|
|
- active-text="学生是否能查看所有作业"
|
|
|
+ active-text=""
|
|
|
class="switchCss"
|
|
|
@change="updateSLook"
|
|
|
></el-switch>
|
|
|
</div>
|
|
|
+ <div class="switch_box" v-if="courseDetail.userid == userid">
|
|
|
+ <span>是否锁定阶段</span>
|
|
|
+ <el-switch
|
|
|
+ v-model="IsLookOpen"
|
|
|
+ active-text=""
|
|
|
+ class="switchCss"
|
|
|
+ @change="updateLookOpen"
|
|
|
+ ></el-switch>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div slot="footer">
|
|
@@ -4202,6 +4224,7 @@ export default {
|
|
|
commentText: "",
|
|
|
full: false,
|
|
|
sIsOpen: false,
|
|
|
+ IsLookOpen: false,
|
|
|
pzDialog: false,
|
|
|
type: 1,
|
|
|
vedio: [],
|
|
@@ -5047,7 +5070,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (
|
|
|
- (JSON.parse(data.content)[0].askJson.askJson[z].answer || JSON.parse(data.content)[0].askJson.askJson[z].answer == 0) &&
|
|
|
+ (JSON.parse(data.content)[0].askJson.askJson[z].answer ||
|
|
|
+ JSON.parse(data.content)[0].askJson.askJson[z].answer ==
|
|
|
+ 0) &&
|
|
|
JSON.parse(data.content)[0].askJson.askJson[z].answer ==
|
|
|
checkL[z]
|
|
|
) {
|
|
@@ -5656,12 +5681,23 @@ export default {
|
|
|
window.parent.postMessage({ allScreen: this.screenType }, "*");
|
|
|
},
|
|
|
nextOrpreSteps(t) {
|
|
|
- document.scrollingElement.scrollTop = 0;
|
|
|
- this.showType = 0;
|
|
|
var b = this.chapInfoList.length - 1;
|
|
|
if (t == 0) {
|
|
|
if (this.courseType == 0) {
|
|
|
if (this.taskCount == 0) {
|
|
|
+ // console.log(this.navList[b].task[this.navList[b].task.length - 1].isLook);
|
|
|
+ if (this.IsLookOpen) {
|
|
|
+ if (
|
|
|
+ !this.navList[b].task[this.navList[b].task.length - 1].isLook
|
|
|
+ ) {
|
|
|
+ if (this.courseDetail.userid != this.userid) {
|
|
|
+ this.$message.error("任务未解锁");
|
|
|
+ } else {
|
|
|
+ this.$message.error("上一任务未解锁");
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
this.navList[this.courseType].isOpen = false;
|
|
|
this.courseType = b;
|
|
|
this.taskCount =
|
|
@@ -5684,7 +5720,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- var b = this.chapInfoList.length - 1;
|
|
|
if (this.courseType == b) {
|
|
|
if (
|
|
|
this.taskCount ==
|
|
@@ -5696,7 +5731,22 @@ export default {
|
|
|
this.taskCount = 0;
|
|
|
this.navList[this.courseType].isOpen = true;
|
|
|
} else {
|
|
|
+ var bbb = this.taskCount + 1;
|
|
|
+ if (
|
|
|
+ !this.chapInfoList[this.courseType].chapterInfo[0].taskJson[bbb]
|
|
|
+ .isLook &&
|
|
|
+ this.courseDetail.userid != this.userid
|
|
|
+ ) {
|
|
|
+ this.$message.error("任务未解锁");
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.taskCount++;
|
|
|
+ if (this.IsLookOpen) {
|
|
|
+ this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
|
|
|
+ this.taskCount
|
|
|
+ ].isLook = true;
|
|
|
+ this.addCourseState(3);
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
if (
|
|
@@ -5704,14 +5754,38 @@ export default {
|
|
|
this.chapInfoList[this.courseType].chapterInfo[0].taskJson.length -
|
|
|
1
|
|
|
) {
|
|
|
+ var bbb = this.courseType + 1;
|
|
|
+ if (
|
|
|
+ !this.chapInfoList[bbb].chapterInfo[0].taskJson[0].isLook &&
|
|
|
+ this.courseDetail.userid != this.userid
|
|
|
+ ) {
|
|
|
+ this.$message.error("任务未解锁");
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.navList[this.courseType].isOpen = false;
|
|
|
this.courseType++;
|
|
|
this.taskCount = 0;
|
|
|
this.navList[this.courseType].isOpen = true;
|
|
|
} else {
|
|
|
+ var bbb = this.taskCount + 1;
|
|
|
+ if (
|
|
|
+ !this.chapInfoList[this.courseType].chapterInfo[0].taskJson[bbb]
|
|
|
+ .isLook &&
|
|
|
+ this.courseDetail.userid != this.userid
|
|
|
+ ) {
|
|
|
+ this.$message.error("任务未解锁");
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.taskCount++;
|
|
|
}
|
|
|
+ if (this.IsLookOpen) {
|
|
|
+ this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
|
|
|
+ this.taskCount
|
|
|
+ ].isLook = true;
|
|
|
+ this.addCourseState(3);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
// if (
|
|
|
// this.taskCount ==
|
|
|
// this.chapInfo.chapterInfo[0].taskJson.length - 1
|
|
@@ -5721,6 +5795,8 @@ export default {
|
|
|
// this.taskCount++;
|
|
|
// }
|
|
|
}
|
|
|
+ document.scrollingElement.scrollTop = 0;
|
|
|
+ this.showType = 0;
|
|
|
this.navId = this.navList[this.courseType].task[this.taskCount].id;
|
|
|
// if (this.vedio[this.taskCount].length > 0) {
|
|
|
// var a =
|
|
@@ -5749,10 +5825,49 @@ export default {
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
openTask(s, n, i) {
|
|
|
- document.scrollingElement.scrollTop = 0;
|
|
|
+ if (this.IsLookOpen) {
|
|
|
+ if (
|
|
|
+ !this.chapInfoList[s].chapterInfo[0].taskJson[n].isLook &&
|
|
|
+ this.courseDetail.userid != this.userid
|
|
|
+ ) {
|
|
|
+ this.$message.error("任务未解锁");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.courseType == s && this.taskCount != n && n > this.taskCount) {
|
|
|
+ if (
|
|
|
+ !this.chapInfoList[this.courseType].chapterInfo[0].taskJson[n - 1]
|
|
|
+ .isLook
|
|
|
+ ) {
|
|
|
+ this.$message.error("上一任务未解锁");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else if (s > this.courseType) {
|
|
|
+ if (n > 0) {
|
|
|
+ if (!this.chapInfoList[s].chapterInfo[0].taskJson[n - 1].isLook) {
|
|
|
+ this.$message.error("上一任务未解锁");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (
|
|
|
+ !this.chapInfoList[s - 1].chapterInfo[0].taskJson[
|
|
|
+ this.chapInfoList[s - 1].chapterInfo[0].taskJson.length - 1
|
|
|
+ ].isLook
|
|
|
+ ) {
|
|
|
+ this.$message.error("上一任务未解锁");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
this.courseType = s;
|
|
|
this.navId = i;
|
|
|
this.taskCount = n;
|
|
|
+ if (this.IsLookOpen) {
|
|
|
+ this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
|
|
|
+ this.taskCount
|
|
|
+ ].isLook = true;
|
|
|
+ this.addCourseState(3);
|
|
|
+ }
|
|
|
this.showType = 0;
|
|
|
this.isNoHomeWork = false;
|
|
|
(this.studyJuri = [
|
|
@@ -5764,6 +5879,8 @@ export default {
|
|
|
},
|
|
|
]),
|
|
|
(this.radio = []);
|
|
|
+ document.scrollingElement.scrollTop = 0;
|
|
|
+
|
|
|
// setTimeout(() => {
|
|
|
// let a = document.getElementById(i);
|
|
|
// if (a.offsetTop - 110 == 0) {
|
|
@@ -5900,27 +6017,27 @@ export default {
|
|
|
this.courseType
|
|
|
];
|
|
|
this.chapInfoList = JSON.parse(this.courseDetail.chapters);
|
|
|
- if (this.navList.length == 0) {
|
|
|
- this.navList = [];
|
|
|
- for (var l = 0; l < this.chapInfoList.length; l++) {
|
|
|
- var q = this.chapInfoList[l].dyName;
|
|
|
- var w = this.chapInfoList[l].chapterInfo[0].taskJson;
|
|
|
- var e;
|
|
|
- this.navList.push({
|
|
|
- dyName: q,
|
|
|
- isOpen: l === 0 ? true : false,
|
|
|
- task: [],
|
|
|
- });
|
|
|
- for (var r = 0; r < w.length; r++) {
|
|
|
- e = w[r].task;
|
|
|
- this.navList[l].task.push({ taskName: e, id: l + "-" + r });
|
|
|
- this.navId = this.navId ? this.navId : l + "-" + r;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.navList[0].isOpen = false;
|
|
|
- this.navList[this.courseType].isOpen = true;
|
|
|
- this.navId = this.navList[this.courseType].task[this.taskCount].id;
|
|
|
+ // if (this.navList.length == 0) {
|
|
|
+ // this.navList = [];
|
|
|
+ // for (var l = 0; l < this.chapInfoList.length; l++) {
|
|
|
+ // var q = this.chapInfoList[l].dyName;
|
|
|
+ // var w = this.chapInfoList[l].chapterInfo[0].taskJson;
|
|
|
+ // var e;
|
|
|
+ // this.navList.push({
|
|
|
+ // dyName: q,
|
|
|
+ // isOpen: l === 0 ? true : false,
|
|
|
+ // task: [],
|
|
|
+ // });
|
|
|
+ // for (var r = 0; r < w.length; r++) {
|
|
|
+ // e = w[r].task;
|
|
|
+ // this.navList[l].task.push({ taskName: e, id: l + "-" + r });
|
|
|
+ // this.navId = this.navId ? this.navId : l + "-" + r;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.navList[0].isOpen = false;
|
|
|
+ // this.navList[this.courseType].isOpen = true;
|
|
|
+ // this.navId = this.navList[this.courseType].task[this.taskCount].id;
|
|
|
for (var l = 0; l < this.chapInfoList.length; l++) {
|
|
|
var w = this.chapInfoList[l].chapterInfo[0].taskJson;
|
|
|
for (var m = 0; m < w.length; m++) {
|
|
@@ -6066,6 +6183,7 @@ export default {
|
|
|
}, 500);
|
|
|
this.selectStudent();
|
|
|
this.selectSWorks();
|
|
|
+ this.selectSLook();
|
|
|
let _this = this;
|
|
|
if (_this.timer) {
|
|
|
clearInterval(_this.timer);
|
|
@@ -6201,6 +6319,36 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
+ updateLookOpen() {
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ sopen: this.IsLookOpen == false ? 1 : 2,
|
|
|
+ cid: this.id,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "updateCourseLookOpen", params)
|
|
|
+ .then((res) => {
|
|
|
+ if (this.IsLookOpen == true) {
|
|
|
+ if (this.courseType != 0 && this.taskCount != 0) {
|
|
|
+ this.openTask(0, 0, "0-0");
|
|
|
+ }
|
|
|
+ this.$message({
|
|
|
+ message: "权限开放成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "权限关闭成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.getCourseState(2);
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
selectSLook() {
|
|
|
let params = {
|
|
|
cid: this.id,
|
|
@@ -6209,6 +6357,116 @@ export default {
|
|
|
.get(this.$store.state.api + "selectCourseSLook", params)
|
|
|
.then((res) => {
|
|
|
this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
|
|
|
+ this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
|
|
|
+ if (!this.IsLookOpen) {
|
|
|
+ this.setNavList();
|
|
|
+ } else {
|
|
|
+ this.getCourseState(1);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ setNavList() {
|
|
|
+ if (this.navList.length == 0) {
|
|
|
+ this.navList = [];
|
|
|
+ for (var l = 0; l < this.chapInfoList.length; l++) {
|
|
|
+ var q = this.chapInfoList[l].dyName;
|
|
|
+ var w = this.chapInfoList[l].chapterInfo[0].taskJson;
|
|
|
+ var e;
|
|
|
+ this.navList.push({
|
|
|
+ dyName: q,
|
|
|
+ isOpen: l === 0 ? true : false,
|
|
|
+ task: [],
|
|
|
+ });
|
|
|
+ for (var r = 0; r < w.length; r++) {
|
|
|
+ e = w[r].task;
|
|
|
+ this.navList[l].task.push({
|
|
|
+ taskName: e,
|
|
|
+ id: l + "-" + r,
|
|
|
+ isLook: w[r].isLook,
|
|
|
+ });
|
|
|
+ // this.navId = this.navId ? this.navId : l + "-" + r;
|
|
|
+ // this.navId = l + "-" + r;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.navList[0].isOpen = false;
|
|
|
+ this.navList[this.courseType].isOpen = true;
|
|
|
+ this.navId = this.navList[this.courseType].task[this.taskCount].id;
|
|
|
+ } else {
|
|
|
+ this.setNavList2();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setNavList2() {
|
|
|
+ for (var l = 0; l < this.chapInfoList.length; l++) {
|
|
|
+ var w = this.chapInfoList[l].chapterInfo[0].taskJson;
|
|
|
+ for (var r = 0; r < w.length; r++) {
|
|
|
+ this.navList[l].task[r].isLook = w[r].isLook;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.IsLookOpen &&
|
|
|
+ !this.navList[this.courseType].task[this.taskCount].isLook
|
|
|
+ ) {
|
|
|
+ this.openTask(0, 0, "0-0");
|
|
|
+ }
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+ getCourseState(type) {
|
|
|
+ let params = {
|
|
|
+ cid: this.id,
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "getCourseState", params)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data[0].length > 0 && this.IsLookOpen && type == 1) {
|
|
|
+ this.chapInfoList = JSON.parse(res.data[0][0].state);
|
|
|
+ this.setNavList();
|
|
|
+ this.$forceUpdate();
|
|
|
+ } else if (res.data[0].length > 0 && this.IsLookOpen && type == 2) {
|
|
|
+ this.addCourseState(2);
|
|
|
+ } else {
|
|
|
+ this.addCourseState(1);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addCourseState(type) {
|
|
|
+ let _state = this.chapInfoList;
|
|
|
+ if (type == 1 || type == 2) {
|
|
|
+ for (var i = 0; i < _state.length; i++) {
|
|
|
+ let el = _state[i].chapterInfo[0].taskJson;
|
|
|
+ for (var j = 0; j < el.length; j++) {
|
|
|
+ if (i == 0 && j == 0) {
|
|
|
+ el[j].isLook = true;
|
|
|
+ } else {
|
|
|
+ el[j].isLook = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ cid: this.id,
|
|
|
+ state: JSON.stringify(_state).replaceAll(/%/g, "%25"),
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.ajax
|
|
|
+ .post(
|
|
|
+ this.$store.state.api +
|
|
|
+ (type == 1 ? "addCourseState" : "updateCourseSate"),
|
|
|
+ params
|
|
|
+ )
|
|
|
+ .then((res) => {
|
|
|
+ if (this.IsLookOpen) {
|
|
|
+ this.setNavList();
|
|
|
+ }
|
|
|
+ if (type == 3 && type == 2) {
|
|
|
+ this.getCourseState(1);
|
|
|
+ }
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
console.error(err);
|
|
@@ -6386,7 +6644,7 @@ export default {
|
|
|
stage: this.courseType,
|
|
|
task: this.taskCount,
|
|
|
tool: this.toolindex,
|
|
|
- content: JSON.stringify(this.askList).replace(/%/g, "%25"),
|
|
|
+ content: JSON.stringify(this.askList).replaceAll(/%/g, "%25"),
|
|
|
type: 2,
|
|
|
},
|
|
|
];
|
|
@@ -6423,7 +6681,7 @@ export default {
|
|
|
stage: this.courseType,
|
|
|
task: this.taskCount,
|
|
|
tool: this.toolindex,
|
|
|
- content: JSON.stringify(this.askList).replace(/%/g, "%25"),
|
|
|
+ content: JSON.stringify(this.askList).replaceAll(/%/g, "%25"),
|
|
|
type: 8,
|
|
|
},
|
|
|
];
|
|
@@ -7082,7 +7340,6 @@ export default {
|
|
|
this.getCourseDetail();
|
|
|
this.selectCount();
|
|
|
this.getHomeWork();
|
|
|
- this.selectSLook();
|
|
|
if (this.tType == 4) {
|
|
|
this.pzDialog = true;
|
|
|
this.selectPz();
|
|
@@ -7724,7 +7981,7 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
align-items: center;
|
|
|
- width: calc(100% - 350px);
|
|
|
+ width: calc(100% - 420px);
|
|
|
}
|
|
|
|
|
|
.courseIndex > div:nth-child(1) {
|
|
@@ -8209,8 +8466,15 @@ export default {
|
|
|
width: 100%;
|
|
|
cursor: pointer;
|
|
|
margin-bottom: 10px;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+.navChild img {
|
|
|
+ position: absolute;
|
|
|
+ right: 11px;
|
|
|
+ width: 15px;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
}
|
|
|
-
|
|
|
.navActive {
|
|
|
height: auto;
|
|
|
}
|
|
@@ -8883,12 +9147,12 @@ export default {
|
|
|
}
|
|
|
|
|
|
.switchCss {
|
|
|
- width: 100%;
|
|
|
+ /* width: 100%; */
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
flex-wrap: nowrap;
|
|
|
align-items: center;
|
|
|
- justify-content: center;
|
|
|
+ /* justify-content: center; */
|
|
|
}
|
|
|
|
|
|
.isClickNav {
|
|
@@ -9655,4 +9919,15 @@ ol {
|
|
|
color: #fff;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+
|
|
|
+.open_box .switch_box {
|
|
|
+ width: 100%;
|
|
|
+ margin: 0 auto;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+
|
|
|
+.open_box .switch_box + .switch_box {
|
|
|
+ margin-top: 10px;
|
|
|
+}
|
|
|
</style>
|