|
@@ -1357,10 +1357,10 @@
|
|
|
</div>
|
|
|
<div
|
|
|
v-if="
|
|
|
- worksDetail[sIndex].img.length == 0 &&
|
|
|
- worksDetail[sIndex].askInfo.length == 0 &&
|
|
|
- worksDetail[sIndex].answerInfo.length == 0 &&
|
|
|
- worksDetail[sIndex].wpptInfo.length == 0 &&
|
|
|
+ // worksDetail[sIndex].img.length == 0 &&
|
|
|
+ // worksDetail[sIndex].askInfo.length == 0 &&
|
|
|
+ // worksDetail[sIndex].answerInfo.length == 0 &&
|
|
|
+ // worksDetail[sIndex].wpptInfo.length == 0 &&
|
|
|
worksDetail[sIndex].chooseInfo.length > 0
|
|
|
"
|
|
|
>
|
|
@@ -1377,7 +1377,7 @@
|
|
|
<div
|
|
|
class="tool_right_box"
|
|
|
v-for="(tItem, tIndex) in worksDetail[sIndex]
|
|
|
- .chooseInfo[0].testJson"
|
|
|
+ .chooseInfo[0].chooseInfo.testJson"
|
|
|
:key="tIndex"
|
|
|
>
|
|
|
<div>
|
|
@@ -1396,15 +1396,18 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="allRightBox">
|
|
|
- <span>全部道题的正确率:</span
|
|
|
- ><span>{{ checkJson[sIndex].allRight + "%" }}</span>
|
|
|
+ <span>全部题的正确率:</span
|
|
|
+ >
|
|
|
+ <span>{{ checkJson[sIndex].allRight + "%" }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-else>
|
|
|
+ <div v-if="
|
|
|
+ worksDetail[sIndex].eList.length
|
|
|
+ ">
|
|
|
<div class="ech" style="margin-left: 23px">
|
|
|
<img src="../../../assets/icon/pj/score.png" alt="" />
|
|
|
</div>
|
|
|
- <div style="height: 80%; overflow: auto">
|
|
|
+ <div>
|
|
|
<div
|
|
|
class="score_box"
|
|
|
v-for="(item, index) in worksDetail[sIndex].eList"
|
|
@@ -1796,6 +1799,7 @@ export default {
|
|
|
watch: {
|
|
|
typeCheck(newValue, oldValue) {
|
|
|
this.loading = true;
|
|
|
+ this.isLoading = true
|
|
|
this.tableData = [];
|
|
|
if (newValue) {
|
|
|
this.getWorks1();
|
|
@@ -1913,6 +1917,7 @@ export default {
|
|
|
var wordInfo = res.data[12]; //文档作业
|
|
|
var workEvaList = res.data[13];
|
|
|
var workJson = {};
|
|
|
+ let checkJson = {}
|
|
|
|
|
|
for (var k = 0; k < res.data[0].length; k++) {
|
|
|
this.allWorks = res.data[0][k];
|
|
@@ -1948,8 +1953,7 @@ export default {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- this.checkJson[k] = {};
|
|
|
-
|
|
|
+ // checkJson[stagetask] = {};
|
|
|
let stagetask = res.data[0][k].stage + "-" + res.data[0][k].task;
|
|
|
if (!workJson[stagetask]) {
|
|
|
workJson[stagetask] = {
|
|
@@ -1971,107 +1975,112 @@ export default {
|
|
|
stagetask: stagetask,
|
|
|
time: "",
|
|
|
};
|
|
|
- }
|
|
|
- workJson[stagetask].time = res.data[0][k].time;
|
|
|
- for (var i = 0; i < askInfo.length; i++) {
|
|
|
- if (
|
|
|
- res.data[0][k].stage == askInfo[i].stage &&
|
|
|
- res.data[0][k].task == askInfo[i].task &&
|
|
|
- res.data[0][k].tool == askInfo[i].tool
|
|
|
- ) {
|
|
|
- const element = askInfo[i];
|
|
|
- let a = JSON.parse(element.content)[0];
|
|
|
- let e = [];
|
|
|
- for (var y = 0; y < a.askJson.length; y++) {
|
|
|
- if (a.askJson[y].type == "2") {
|
|
|
- e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
|
|
|
- } else {
|
|
|
- e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
|
|
|
- }
|
|
|
- }
|
|
|
- a.radio = e;
|
|
|
- workJson[stagetask].askInfo.push({
|
|
|
- askInfo: a,
|
|
|
- score: askInfo[i].score
|
|
|
- ? JSON.parse(askInfo[i].score).wScore
|
|
|
- : askInfo[i].score,
|
|
|
- });
|
|
|
- this.checkJson[k].allRight = 0;
|
|
|
- var isCount = 0;
|
|
|
- for (var p = 0; p < a.radio.length; p++) {
|
|
|
- if (!this.checkJson[k][p]) {
|
|
|
- this.checkJson[k][p] = {
|
|
|
- checkCount: [],
|
|
|
- checkPerson: [],
|
|
|
- };
|
|
|
- }
|
|
|
- if (!this.checkJson[k][p].checkCount.length) {
|
|
|
- this.checkJson[k][p].checkCount = [];
|
|
|
- let _askItemCount = a.askJson[p].askCount;
|
|
|
- for (var aic = 0; aic < _askItemCount; aic++) {
|
|
|
- this.checkJson[k][p].checkCount.push(0);
|
|
|
- }
|
|
|
- }
|
|
|
- if (a.radio[p] instanceof Array) {
|
|
|
- if (
|
|
|
- workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
|
|
|
- .sort()
|
|
|
- .join(",") == a.radio[p].sort().join(",")
|
|
|
- ) {
|
|
|
- this.checkJson[k][p].right = 100;
|
|
|
- isCount += this.checkJson[k][p].right;
|
|
|
- } else {
|
|
|
- this.checkJson[k][p].right = 0;
|
|
|
- isCount += 0;
|
|
|
- }
|
|
|
- for (var q = 0; q < a.radio[p].length; q++) {
|
|
|
- this.checkJson[k][p].checkPerson[parseInt(a.radio[p][q])]
|
|
|
- ? this.checkJson[k][p].checkPerson[
|
|
|
- parseInt(a.radio[p][q])
|
|
|
- ].push(res.data[0][k].sName)
|
|
|
- : (this.checkJson[k][p].checkPerson[
|
|
|
- parseInt(a.radio[p][q])
|
|
|
- ] = [res.data[0][k].sName]);
|
|
|
- this.checkJson[k][p].checkCount[parseInt(a.radio[p][q])]
|
|
|
- ? this.checkJson[k][p].checkCount[
|
|
|
- parseInt(a.radio[p][q])
|
|
|
- ]++
|
|
|
- : (this.checkJson[k][p].checkCount[
|
|
|
- parseInt(a.radio[p][q])
|
|
|
- ] = 1);
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (
|
|
|
- workJson[stagetask].askInfo[0].askInfo.askJson[p]
|
|
|
- .answer == a.radio[p]
|
|
|
- ) {
|
|
|
- this.checkJson[k][p].right = 100;
|
|
|
- isCount += this.checkJson[k][p].right;
|
|
|
- } else {
|
|
|
- this.checkJson[k][p].right = 0;
|
|
|
- isCount += 0;
|
|
|
- }
|
|
|
- if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
|
|
|
- this.checkJson[k][p].checkPerson[parseInt(a.radio[p])]
|
|
|
- ? this.checkJson[k][p].checkPerson[
|
|
|
- parseInt(a.radio[p])
|
|
|
- ].push(res.data[0][k].sName)
|
|
|
- : (this.checkJson[k][p].checkPerson[
|
|
|
- parseInt(a.radio[p])
|
|
|
- ] = [res.data[0][k].sName]);
|
|
|
- this.checkJson[k][p].checkCount[parseInt(a.radio[p])]
|
|
|
- ? this.checkJson[k][p].checkCount[
|
|
|
- parseInt(a.radio[p])
|
|
|
- ]++
|
|
|
- : (this.checkJson[k][p].checkCount[
|
|
|
- parseInt(a.radio[p])
|
|
|
- ] = 1);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.checkJson[k].allRight = isCount / a.radio.length;
|
|
|
+ checkJson[stagetask] = {
|
|
|
+ stagetask: stagetask,
|
|
|
}
|
|
|
}
|
|
|
+ workJson[stagetask].time = res.data[0][k].time;
|
|
|
+ // for (var i = 0; i < askInfo.length; i++) {
|
|
|
+ // if (
|
|
|
+ // res.data[0][k].stage == askInfo[i].stage &&
|
|
|
+ // res.data[0][k].task == askInfo[i].task &&
|
|
|
+ // res.data[0][k].tool == askInfo[i].tool
|
|
|
+ // ) {
|
|
|
+ // const element = askInfo[i];
|
|
|
+ // let a = JSON.parse(element.content)[0];
|
|
|
+ // let e = [];
|
|
|
+ // for (var y = 0; y < a.askJson.length; y++) {
|
|
|
+ // if (a.askJson[y].type == "2") {
|
|
|
+ // e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
|
|
|
+ // } else {
|
|
|
+ // e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // a.radio = e;
|
|
|
+ // workJson[stagetask].askInfo.push({
|
|
|
+ // askInfo: a,
|
|
|
+ // score: askInfo[i].score
|
|
|
+ // ? JSON.parse(askInfo[i].score).wScore
|
|
|
+ // : askInfo[i].score,
|
|
|
+ // });
|
|
|
+ // // checkJson[stagetask].allRight = 0;
|
|
|
+ // checkJson[stagetask].allRight = 0
|
|
|
+ // var isCount = 0;
|
|
|
+ // for (var p = 0; p < a.radio.length; p++) {
|
|
|
+ // if (!checkJson[stagetask][p]) {
|
|
|
+ // checkJson[stagetask][p] = {
|
|
|
+ // checkCount: [],
|
|
|
+ // checkPerson: [],
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ // if (!checkJson[stagetask][p].checkCount.length) {
|
|
|
+ // checkJson[stagetask][p].checkCount = [];
|
|
|
+ // let _askItemCount = a.askJson[p].askCount;
|
|
|
+ // for (var aic = 0; aic < _askItemCount; aic++) {
|
|
|
+ // checkJson[stagetask][p].checkCount.push(0);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (a.radio[p] instanceof Array) {
|
|
|
+ // if (
|
|
|
+ // workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
|
|
|
+ // .sort()
|
|
|
+ // .join(",") == a.radio[p].sort().join(",")
|
|
|
+ // ) {
|
|
|
+ // checkJson[stagetask][p].right = 100;
|
|
|
+ // isCount += checkJson[stagetask][p].right;
|
|
|
+ // } else {
|
|
|
+ // checkJson[stagetask][p].right = 0;
|
|
|
+ // isCount += 0;
|
|
|
+ // }
|
|
|
+ // for (var q = 0; q < a.radio[p].length; q++) {
|
|
|
+ // checkJson[stagetask][p].checkPerson[parseInt(a.radio[p][q])]
|
|
|
+ // ? checkJson[stagetask][p].checkPerson[
|
|
|
+ // parseInt(a.radio[p][q])
|
|
|
+ // ].push(res.data[0][k].sName)
|
|
|
+ // : (checkJson[stagetask][p].checkPerson[
|
|
|
+ // parseInt(a.radio[p][q])
|
|
|
+ // ] = [res.data[0][k].sName]);
|
|
|
+ // checkJson[stagetask][p].checkCount[parseInt(a.radio[p][q])]
|
|
|
+ // ? checkJson[stagetask][p].checkCount[
|
|
|
+ // parseInt(a.radio[p][q])
|
|
|
+ // ]++
|
|
|
+ // : (checkJson[stagetask][p].checkCount[
|
|
|
+ // parseInt(a.radio[p][q])
|
|
|
+ // ] = 1);
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if (
|
|
|
+ // workJson[stagetask].askInfo[0].askInfo.askJson[p]
|
|
|
+ // .answer == a.radio[p]
|
|
|
+ // ) {
|
|
|
+ // checkJson[stagetask][p].right = 100;
|
|
|
+ // isCount += checkJson[stagetask][p].right;
|
|
|
+ // } else {
|
|
|
+ // checkJson[stagetask][p].right = 0;
|
|
|
+ // isCount += 0;
|
|
|
+ // }
|
|
|
+ // if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
|
|
|
+ // checkJson[stagetask][p].checkPerson[parseInt(a.radio[p])]
|
|
|
+ // ? checkJson[stagetask][p].checkPerson[
|
|
|
+ // parseInt(a.radio[p])
|
|
|
+ // ].push(res.data[0][k].sName)
|
|
|
+ // : (checkJson[stagetask][p].checkPerson[
|
|
|
+ // parseInt(a.radio[p])
|
|
|
+ // ] = [res.data[0][k].sName]);
|
|
|
+ // checkJson[stagetask][p].checkCount[parseInt(a.radio[p])]
|
|
|
+ // ? checkJson[stagetask][p].checkCount[
|
|
|
+ // parseInt(a.radio[p])
|
|
|
+ // ]++
|
|
|
+ // : (checkJson[stagetask][p].checkCount[
|
|
|
+ // parseInt(a.radio[p])
|
|
|
+ // ] = 1);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // checkJson[stagetask].allRight = isCount / a.radio.length;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ console.log(checkJson);
|
|
|
for (var i = 0; i < chooseInfo.length; i++) {
|
|
|
if (
|
|
|
res.data[0][k].stage == chooseInfo[i].stage &&
|
|
@@ -2095,20 +2104,20 @@ export default {
|
|
|
? JSON.parse(chooseInfo[i].score).wScore
|
|
|
: chooseInfo[i].score,
|
|
|
});
|
|
|
- this.checkJson[k].allRight = 0;
|
|
|
+ checkJson[stagetask].allRight = 0;
|
|
|
var isCount = 0;
|
|
|
for (var p = 0; p < t.radio.length; p++) {
|
|
|
- if (!this.checkJson[k][p]) {
|
|
|
- this.checkJson[k][p] = {
|
|
|
+ if (!checkJson[stagetask][p]) {
|
|
|
+ checkJson[stagetask][p] = {
|
|
|
checkCount: [],
|
|
|
checkPerson: [],
|
|
|
};
|
|
|
}
|
|
|
- if (!this.checkJson[k][p].checkCount.length) {
|
|
|
- this.checkJson[k][p].checkCount = [];
|
|
|
+ if (!checkJson[stagetask][p].checkCount.length) {
|
|
|
+ checkJson[stagetask][p].checkCount = [];
|
|
|
let _askItemCount = t.testJson[p].testItem;
|
|
|
for (var aic = 0; aic < _askItemCount; aic++) {
|
|
|
- this.checkJson[k][p].checkCount.push(0);
|
|
|
+ checkJson[stagetask][p].checkCount.push(0);
|
|
|
}
|
|
|
}
|
|
|
if (t.radio[p] instanceof Array) {
|
|
@@ -2116,55 +2125,55 @@ export default {
|
|
|
t.testJson[p].answer.sort().join(",") ==
|
|
|
t.radio[p].sort().join(",")
|
|
|
) {
|
|
|
- this.checkJson[k][p].right = 100;
|
|
|
- isCount += this.checkJson[k][p].right;
|
|
|
+ checkJson[stagetask][p].right = 100;
|
|
|
+ isCount += checkJson[stagetask][p].right;
|
|
|
} else {
|
|
|
- this.checkJson[k][p].right = 0;
|
|
|
+ checkJson[stagetask][p].right = 0;
|
|
|
isCount += 0;
|
|
|
}
|
|
|
for (var q = 0; q < t.radio[p].length; q++) {
|
|
|
- this.checkJson[k][p].checkPerson[parseInt(t.radio[p][q])]
|
|
|
- ? this.checkJson[k][p].checkPerson[
|
|
|
+ checkJson[stagetask][p].checkPerson[parseInt(t.radio[p][q])]
|
|
|
+ ? checkJson[stagetask][p].checkPerson[
|
|
|
parseInt(t.radio[p][q])
|
|
|
].push(res.data[0][k].sName)
|
|
|
- : (this.checkJson[k][p].checkPerson[
|
|
|
+ : (checkJson[stagetask][p].checkPerson[
|
|
|
parseInt(t.radio[p][q])
|
|
|
] = [res.data[0][k].sName]);
|
|
|
- this.checkJson[k][p].checkCount[parseInt(t.radio[p][q])]
|
|
|
- ? this.checkJson[k][p].checkCount[
|
|
|
+ checkJson[stagetask][p].checkCount[parseInt(t.radio[p][q])]
|
|
|
+ ? checkJson[stagetask][p].checkCount[
|
|
|
parseInt(t.radio[p][q])
|
|
|
]++
|
|
|
- : (this.checkJson[k][p].checkCount[
|
|
|
+ : (checkJson[stagetask][p].checkCount[
|
|
|
parseInt(t.radio[p][q])
|
|
|
] = 1);
|
|
|
}
|
|
|
} else {
|
|
|
if (t.testJson[p].answer == t.radio[p]) {
|
|
|
- this.checkJson[k][p].right = 100;
|
|
|
- isCount += this.checkJson[k][p].right;
|
|
|
+ checkJson[stagetask][p].right = 100;
|
|
|
+ isCount += checkJson[stagetask][p].right;
|
|
|
} else {
|
|
|
- this.checkJson[k][p].right = 0;
|
|
|
+ checkJson[stagetask][p].right = 0;
|
|
|
isCount += 0;
|
|
|
}
|
|
|
if (parseInt(t.radio[p]) || parseInt(t.radio[p]) == 0) {
|
|
|
- this.checkJson[k][p].checkPerson[parseInt(t.radio[p])]
|
|
|
- ? this.checkJson[k][p].checkPerson[
|
|
|
+ checkJson[stagetask][p].checkPerson[parseInt(t.radio[p])]
|
|
|
+ ? checkJson[stagetask][p].checkPerson[
|
|
|
parseInt(t.radio[p])
|
|
|
].push(res.data[0][k].sName)
|
|
|
- : (this.checkJson[k][p].checkPerson[
|
|
|
+ : (checkJson[stagetask][p].checkPerson[
|
|
|
parseInt(t.radio[p])
|
|
|
] = [res.data[0][k].sName]);
|
|
|
- this.checkJson[k][p].checkCount[parseInt(t.radio[p])]
|
|
|
- ? this.checkJson[k][p].checkCount[
|
|
|
+ checkJson[stagetask][p].checkCount[parseInt(t.radio[p])]
|
|
|
+ ? checkJson[stagetask][p].checkCount[
|
|
|
parseInt(t.radio[p])
|
|
|
]++
|
|
|
- : (this.checkJson[k][p].checkCount[
|
|
|
+ : (checkJson[stagetask][p].checkCount[
|
|
|
parseInt(t.radio[p])
|
|
|
] = 1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- this.checkJson[k].allRight = isCount / t.radio.length;
|
|
|
+ checkJson[stagetask].allRight = isCount / t.radio.length;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2384,8 +2393,10 @@ export default {
|
|
|
// );
|
|
|
// });
|
|
|
let result = [];
|
|
|
+ let checkJsonArray = []
|
|
|
for (var wi = 0; wi < Object.keys(workJson).length; wi++) {
|
|
|
result.push(workJson[Object.keys(workJson)[wi]]);
|
|
|
+ checkJsonArray.push(checkJson[Object.keys(checkJson)[wi]])
|
|
|
}
|
|
|
var resultNewArray = result.sort(function (x, y) {
|
|
|
// 以stagetask字段为排序依据
|
|
@@ -2400,7 +2411,22 @@ export default {
|
|
|
// 如果第一个数字相同,则比较第二个数字
|
|
|
return parseInt(x_parts[1]) - parseInt(y_parts[1]);
|
|
|
});
|
|
|
+ var checkJsonNewArray = checkJsonArray.sort(function (x, y) {
|
|
|
+ // 以stagetask字段为排序依据
|
|
|
+ var x_parts = x.stagetask.split("-");
|
|
|
+ var y_parts = y.stagetask.split("-");
|
|
|
+
|
|
|
+ // 首先比较第一个数字
|
|
|
+ if (x_parts[0] !== y_parts[0]) {
|
|
|
+ return parseInt(x_parts[0]) - parseInt(y_parts[0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果第一个数字相同,则比较第二个数字
|
|
|
+ return parseInt(x_parts[1]) - parseInt(y_parts[1]);
|
|
|
+ });
|
|
|
result = resultNewArray;
|
|
|
+ checkJsonArray = checkJsonNewArray;
|
|
|
+ this.checkJson = checkJsonArray
|
|
|
for (var l = 0; l < b.length; l++) {
|
|
|
if (workEvaList.length > 0) {
|
|
|
for (var p = 0; p < workEvaList.length; p++) {
|
|
@@ -2628,14 +2654,12 @@ export default {
|
|
|
},
|
|
|
//获取班级列表
|
|
|
getClass() {
|
|
|
- this.isLoading = true;
|
|
|
let params = {
|
|
|
oid: this.oid,
|
|
|
};
|
|
|
this.ajax
|
|
|
.get(this.$store.state.api + "selectClassBySchool", params)
|
|
|
.then((res) => {
|
|
|
- this.isLoading = false;
|
|
|
this.grade = res.data[0];
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -2730,6 +2754,7 @@ export default {
|
|
|
}
|
|
|
this.dyList = dyList;
|
|
|
this.userAarray = res.data[1];
|
|
|
+ this.getWorks();
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
console.error(err);
|
|
@@ -3545,10 +3570,10 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.page = 1;
|
|
|
+ this.isLoading = true
|
|
|
this.getCourseDetail();
|
|
|
this.getClass();
|
|
|
this.getGroup();
|
|
|
- this.getWorks();
|
|
|
},
|
|
|
};
|
|
|
</script>
|