|
@@ -1215,6 +1215,7 @@ export default {
|
|
loading: false,
|
|
loading: false,
|
|
type: 0, //type:1章卷,2节卷,3模考卷
|
|
type: 0, //type:1章卷,2节卷,3模考卷
|
|
bankType: 0,
|
|
bankType: 0,
|
|
|
|
+ compareFaceData: 0, // 拍照匹配相似度
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async mounted() {
|
|
async mounted() {
|
|
@@ -1428,7 +1429,6 @@ export default {
|
|
window.navigator.webkitGetUserMedia ||
|
|
window.navigator.webkitGetUserMedia ||
|
|
window.navigator.mozGetUserMedia
|
|
window.navigator.mozGetUserMedia
|
|
) {
|
|
) {
|
|
- console.log(this.getUserMedia, "getUserMedia");
|
|
|
|
// 调用用户媒体设备, 访问摄像头
|
|
// 调用用户媒体设备, 访问摄像头
|
|
this.getUserMedia(
|
|
this.getUserMedia(
|
|
{
|
|
{
|
|
@@ -1449,7 +1449,7 @@ export default {
|
|
async takeOk() {
|
|
async takeOk() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
let compareFaceData = await this.faceRecognition();
|
|
let compareFaceData = await this.faceRecognition();
|
|
-
|
|
|
|
|
|
+ this.compareFaceData = compareFaceData
|
|
if (compareFaceData == 0) {
|
|
if (compareFaceData == 0) {
|
|
this.$message({
|
|
this.$message({
|
|
type: "warning",
|
|
type: "warning",
|
|
@@ -1483,12 +1483,14 @@ export default {
|
|
photo: self.ossAvatarUrl,
|
|
photo: self.ossAvatarUrl,
|
|
recordId: self.recordId,
|
|
recordId: self.recordId,
|
|
};
|
|
};
|
|
- console.log(data, "拍照提交");
|
|
|
|
|
|
+ if (this.ossAvatarUrl) {
|
|
|
|
+ data.similarity = this.compareFaceData // 相似度
|
|
|
|
+ }
|
|
this.$request
|
|
this.$request
|
|
.studyExamPhotoRecord(data)
|
|
.studyExamPhotoRecord(data)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.hasTake = true;
|
|
this.hasTake = true;
|
|
- console.log(res, "拍照提交结果");
|
|
|
|
|
|
+ // console.log(res, "拍照提交结果");
|
|
self.ossAvatarUrl = "";
|
|
self.ossAvatarUrl = "";
|
|
//拍照
|
|
//拍照
|
|
if (this.lastTime) {
|
|
if (this.lastTime) {
|
|
@@ -1584,7 +1586,6 @@ export default {
|
|
gradeId: this.gradeId,
|
|
gradeId: this.gradeId,
|
|
})
|
|
})
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- console.log(res, "res");
|
|
|
|
resolve(res.data);
|
|
resolve(res.data);
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
@@ -1652,7 +1653,7 @@ export default {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
const video = document.getElementById("video");
|
|
const video = document.getElementById("video");
|
|
// 将视频流设置为video元素的源
|
|
// 将视频流设置为video元素的源
|
|
- console.dir(video);
|
|
|
|
|
|
+ // console.dir(video);
|
|
video.srcObject = stream;
|
|
video.srcObject = stream;
|
|
this.mediaStreamTrack =
|
|
this.mediaStreamTrack =
|
|
typeof stream.stop === "function" ? stream : stream.getTracks()[0];
|
|
typeof stream.stop === "function" ? stream : stream.getTracks()[0];
|
|
@@ -1935,7 +1936,6 @@ export default {
|
|
item.ques[indexs] &&
|
|
item.ques[indexs] &&
|
|
(item.ques[indexs].text || item.ques[indexs].imageList.length)
|
|
(item.ques[indexs].text || item.ques[indexs].imageList.length)
|
|
) {
|
|
) {
|
|
- console.log("chil");
|
|
|
|
return true;
|
|
return true;
|
|
} else {
|
|
} else {
|
|
return false;
|
|
return false;
|
|
@@ -1974,7 +1974,6 @@ export default {
|
|
question.ques.imageList = question.ansText.imageList;
|
|
question.ques.imageList = question.ansText.imageList;
|
|
question.ques.text = question.ansText.text;
|
|
question.ques.text = question.ansText.text;
|
|
|
|
|
|
- console.log(question.ques);
|
|
|
|
},
|
|
},
|
|
ansSubmitChild(question, questionIndex, jsonIndex) {
|
|
ansSubmitChild(question, questionIndex, jsonIndex) {
|
|
if (
|
|
if (
|
|
@@ -2032,9 +2031,6 @@ export default {
|
|
//单选
|
|
//单选
|
|
if (this.questionList[index].ques) {
|
|
if (this.questionList[index].ques) {
|
|
if (item.type == 1) {
|
|
if (item.type == 1) {
|
|
- console.log(
|
|
|
|
- this.questionList[index].ques == this.questionList[index].ans
|
|
|
|
- );
|
|
|
|
return this.questionList[index].ques == this.questionList[index].ans;
|
|
return this.questionList[index].ques == this.questionList[index].ans;
|
|
//多选
|
|
//多选
|
|
} else if (item.type == 2) {
|
|
} else if (item.type == 2) {
|
|
@@ -2176,14 +2172,12 @@ export default {
|
|
|
|
|
|
if (isOver) {
|
|
if (isOver) {
|
|
count++;
|
|
count++;
|
|
- console.log(item, 444);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (item.type == 5) {
|
|
} else if (item.type == 5) {
|
|
//简答题
|
|
//简答题
|
|
if (hasSpecail) {
|
|
if (hasSpecail) {
|
|
if (item.ques && (item.ques.text || item.ques.imageList.length)) {
|
|
if (item.ques && (item.ques.text || item.ques.imageList.length)) {
|
|
- console.log(5, item);
|
|
|
|
count++;
|
|
count++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2335,7 +2329,6 @@ export default {
|
|
checkboxScore = 0;
|
|
checkboxScore = 0;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- console.log(checkboxScore);
|
|
|
|
|
|
|
|
//没选错
|
|
//没选错
|
|
if (checkboxScore) {
|
|
if (checkboxScore) {
|