Commit 966c50b7 authored by 罗超's avatar 罗超

1

parent d8ffe406
...@@ -100,11 +100,10 @@ export default { ...@@ -100,11 +100,10 @@ export default {
ExamStatus: Number, ExamStatus: Number,
}, },
setup(props, ctx) { setup(props, ctx) {
let Gid = uni.getStorageSync("userInfo").Id;
let data = reactive({ let data = reactive({
msg: { GuestId: Gid, PaperId: 5, PublishId: 1 },
questionList: props.paperData.Paper.GroupList, questionList: props.paperData.Paper.GroupList,
}); });
let methods = { let methods = {
changeNumToHan, changeNumToHan,
chooseTopic(index, index1, index2) { chooseTopic(index, index1, index2) {
......
...@@ -42,7 +42,10 @@ ...@@ -42,7 +42,10 @@
> >
<view <view
class="item1" class="item1"
:class="{ isRes: item1.IsRes }" :class="{
isTrueAnswer: item1.Answer == item1.StundetAnswer,
isNotAnswer: item1.Answer != item1.StundetAnswer,
}"
v-else v-else
@click="chooseTopic(index, index1)" @click="chooseTopic(index, index1)"
>{{ index1 + 1 }}</view >{{ index1 + 1 }}</view
...@@ -61,7 +64,14 @@ ...@@ -61,7 +64,14 @@
> >
<view <view
class="item1" class="item1"
:class="{ isRes: item2.IsRes }" :class="{
isTrueAnswer:
item1.QuestionAnswerList[index2].SubAnswer ==
item1.AnswerList[index2].SubAnswer,
isNotAnswer:
item1.QuestionAnswerList[index2].SubAnswer !=
item1.AnswerList[index2].SubAnswer,
}"
@click="chooseTopic(index, index1)" @click="chooseTopic(index, index1)"
>{{ index2 + 1 }}</view >{{ index2 + 1 }}</view
> >
...@@ -71,9 +81,6 @@ ...@@ -71,9 +81,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="submitBox" v-if="ExamStatus === 1">
<view class="submit" @click="savePaper">立即提交</view>
</view>
<van-toast id="van-toast" /> <van-toast id="van-toast" />
</view> </view>
</template> </template>
...@@ -94,18 +101,13 @@ import { submitPaper } from "../../api/exam"; ...@@ -94,18 +101,13 @@ import { submitPaper } from "../../api/exam";
export default { export default {
props: { props: {
paperData: Object, paperData: Object,
ExamStuId: Number,
SubmitTimes: Number,
StartTime: String,
ExamStatus: Number,
}, },
setup(props, ctx) { setup(props, ctx) {
let Gid = uni.getStorageSync("userInfo").Id; console.log(108, props);
let data = reactive({ let data = reactive({
msg: { GuestId: Gid, PaperId: 5, PublishId: 1 },
questionList: props.paperData.Paper.GroupList, questionList: props.paperData.Paper.GroupList,
}); });
console.log(108, props.paperData);
let methods = { let methods = {
changeNumToHan, changeNumToHan,
chooseTopic(index, index1, index2) { chooseTopic(index, index1, index2) {
...@@ -119,55 +121,6 @@ export default { ...@@ -119,55 +121,6 @@ export default {
back() { back() {
ctx.emit("hideAnswer"); ctx.emit("hideAnswer");
}, },
getNowTime() {
let dateTime;
let yy = new Date().getFullYear();
let mm = new Date().getMonth() + 1;
let dd = new Date().getDate();
let hh = new Date().getHours();
let mf =
new Date().getMinutes() < 10
? "0" + new Date().getMinutes()
: new Date().getMinutes();
let ss =
new Date().getSeconds() < 10
? "0" + new Date().getSeconds()
: new Date().getSeconds();
dateTime = yy + "-" + mm + "-" + dd + " " + hh + ":" + mf + ":" + ss;
return dateTime;
},
//交卷
async savePaper() {
let obj = JSON.parse(JSON.stringify(props.paperData.Paper));
delete obj.Group_Id;
obj.Exam_Student_Id = props.ExamStuId;
let time1 = props.StartTime;
let time2 = methods.getNowTime();
var d1 = new Date(time1);
var d2 = new Date(time2);
let TimeDis = parseInt(d2 - d1) / 1000 / 60;
if (TimeDis < props.SubmitTimes) {
uni.showToast({
title: `开场不足${props.SubmitTimes}分钟禁止交卷哦~`,
icon: "none",
});
return;
}
let res = await submitPaper(obj);
if (res) {
if (res.Code == 1) {
uni.showToast({
title: res.Message,
icon: "none",
});
setTimeout(() => {
uni.navigateTo({
url: "/pages/index/index",
});
}, 1000);
}
}
},
}; };
return { return {
...toRefs(data), ...toRefs(data),
...@@ -181,7 +134,7 @@ export default { ...@@ -181,7 +134,7 @@ export default {
.answer-sheets { .answer-sheets {
box-sizing: border-box; box-sizing: border-box;
padding: 30rpx; padding: 30rpx;
height: calc(100vh - 300rpx); height: calc(100vh - 200rpx);
overflow-y: auto; overflow-y: auto;
} }
.name, .name,
...@@ -267,4 +220,15 @@ export default { ...@@ -267,4 +220,15 @@ export default {
color: #ffffff !important; color: #ffffff !important;
border: none !important; border: none !important;
} }
.isTrueAnswer {
background-color: #65c6a5 !important;
color: #ffffff !important;
border: none !important;
}
.isNotAnswer {
background-color: #fc5752 !important;
color: #ffffff !important;
border: none !important;
}
</style> </style>
...@@ -323,18 +323,26 @@ ...@@ -323,18 +323,26 @@
/> />
</view> </view>
</view> </view>
<view class="answer-con" v-if="isShowAnswer"> <view v-if="isShowAnswer">
<answer <view class="answer-con" v-if="!isShowAnswerSee">
:paperData="peaperDetail" <answer
:ExamStuId="Exam_Student_Id" :paperData="peaperDetail"
:StartTime="StartTime" :ExamStuId="Exam_Student_Id"
:ExamStatus="ExamStatus" :StartTime="StartTime"
:SubmitTimes="SubmitTimes" :ExamStatus="ExamStatus"
@hideAnswer="hideAnswerSheet" :SubmitTimes="SubmitTimes"
@chooseTopic="jumpTopic" @hideAnswer="hideAnswerSheet"
ref="answer" @chooseTopic="jumpTopic"
/> ref="answer"
/>
<!-- 答题卡查看对错 -->
<view v-if="isShowAnswerSee">
<answerSee :paperData="peaperDetail" @chooseTopic="jumpTopic" />
</view>
</view>
</view> </view>
<view class="answer-con" v-if="isShowNotice"> <view class="answer-con" v-if="isShowNotice">
<examNotice :paperData="peaperDetail" @hideNotice="hideNotice" /> <examNotice :paperData="peaperDetail" @hideNotice="hideNotice" />
</view> </view>
...@@ -376,7 +384,8 @@ import Dataquestion from "../../components/subject/Dataquestion.vue"; ...@@ -376,7 +384,8 @@ import Dataquestion from "../../components/subject/Dataquestion.vue";
import SortingProblem from "../../components/subject/SortingProblem.vue"; import SortingProblem from "../../components/subject/SortingProblem.vue";
import Connect from "../../components/subject/Connect.vue"; //"连线题" import Connect from "../../components/subject/Connect.vue"; //"连线题"
import SharingChoose from "../../components/subject/SharingChoose.vue"; import SharingChoose from "../../components/subject/SharingChoose.vue";
import answer from "../../components/subject/answerSee.vue"; //答题卡 import answer from "../../components/subject/answer.vue"; //答题卡
import answerSee from "../../components/subject/answerSee.vue"; //查看答题卡对错,
import examNotice from "../../components/subject/examNotice.vue"; //考前须知 import examNotice from "../../components/subject/examNotice.vue"; //考前须知
export default { export default {
components: { components: {
...@@ -400,6 +409,7 @@ export default { ...@@ -400,6 +409,7 @@ export default {
SharingChoose, SharingChoose,
Connect, Connect,
answer, answer,
answerSee,
examNotice, examNotice,
}, },
setup(props, context) { setup(props, context) {
...@@ -426,6 +436,7 @@ export default { ...@@ -426,6 +436,7 @@ export default {
StartTime: "", //页面加载后的时间 StartTime: "", //页面加载后的时间
SubmitTimes: 0, //后台设置几分钟后可提交 SubmitTimes: 0, //后台设置几分钟后可提交
isShowNotice: false, //是否显示考前须知 isShowNotice: false, //是否显示考前须知
isShowAnswerSee: false,
}); });
let methods = { let methods = {
changeNumToHan, changeNumToHan,
...@@ -447,7 +458,7 @@ export default { ...@@ -447,7 +458,7 @@ export default {
data.peaperDetail = res.Data; data.peaperDetail = res.Data;
//-1-缺考, 0-未开始,1-已开始,2-已考试,3-已阅卷 //-1-缺考, 0-未开始,1-已开始,2-已考试,3-已阅卷
this.ExamStatus = res.Data.ExamStatusTemp; this.ExamStatus = res.Data.ExamStatusTemp;
console.log(277, this.ExamStatus); console.log(277, data.peaperDetail);
this.SubmitTimes = res.Data.Publish.SubmitTimes; this.SubmitTimes = res.Data.Publish.SubmitTimes;
//判断是答卷 //判断是答卷
if (res.Data.ExamStatusTemp == 1) { if (res.Data.ExamStatusTemp == 1) {
...@@ -575,7 +586,7 @@ export default { ...@@ -575,7 +586,7 @@ export default {
...methods, ...methods,
}; };
}, },
onLoad(options) { async onLoad(options) {
if (options.GuestId) { if (options.GuestId) {
this.msg.GuestId = options.GuestId; this.msg.GuestId = options.GuestId;
} }
...@@ -594,7 +605,11 @@ export default { ...@@ -594,7 +605,11 @@ export default {
) { ) {
this.msg.isShowAnswer = true; this.msg.isShowAnswer = true;
} }
this.getPaperDetail(); await this.getPaperDetail();
if (options.showScore) {
this.isShowAnswer = true;
this.isShowAnswerSee = true;
}
}, },
}; };
</script> </script>
......
<template> <template>
<view> <view>
<van-nav-bar fixed> <van-nav-bar fixed>
<template #left> <template #left>
<van-icon name="cross" style="font-size: 32rpx; color: #111" @click="back" /> <van-icon
</template> name="cross"
<template #title> style="font-size: 32rpx; color: #111"
<view style=" @click="back"
font-size: 32rpx; />
color: #111; </template>
font-family: PingFang SC; <template #title>
font-weight: 800; <view
">考试成绩</view> style="
</template> font-size: 32rpx;
</van-nav-bar> color: #111;
<view class="examScoreMain"> font-family: PingFang SC;
<view class="exam_Progress"> font-weight: 800;
<van-circle v-model="dataList.TotalScore" "
:rate="dataList.Publish.ExamScore" >考试成绩</view
:speed="100" >
color="#fff" </template>
layer-color="#0097d8" </van-nav-bar>
:text="dataList.TotalScore" <view class="examScoreMain">
/> <view class="exam_Progress">
</view> <van-circle
<view> v-model="dataList.TotalScore"
<img style="width:100%;height:322px;" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/examTop.png" alt="" /> :rate="dataList.Publish.ExamScore"
</view> :speed="100"
</view> color="#fff"
<view class="exam_Bottom"> layer-color="#0097d8"
<view class="exam_View"> :text="dataList.TotalScore"
<img style="width:20px;height:21px;margin-right:20rpx;" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/exam_Edit.png" alt="" /> />
回顾试卷 </view>
</view> <view>
<view class="exam_Pingyu"> <img
<view class="teacher_Say">老师评语</view> style="width: 100%; height: 322px"
<view class="teacher_Inner"> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/examTop.png"
{{dataList.StuComment}} alt=""
</view> />
</view> </view>
</view> </view>
</view> <view class="exam_Bottom">
<view class="exam_View" @click="jumpPage">
<img
style="width: 20px; height: 21px; margin-right: 20rpx"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/exam_Edit.png"
alt=""
/>
回顾试卷
</view>
<view class="exam_Pingyu">
<view class="teacher_Say">老师评语</view>
<view class="teacher_Inner">
{{ dataList.StuComment }}
</view>
</view>
</view>
</view>
</template> </template>
<script> <script>
import { import {
ref, ref,
reactive, reactive,
toRefs, toRefs,
toRef, toRef,
getCurrentInstance, getCurrentInstance,
watch, watch,
computed, computed,
onMounted, onMounted,
} from "vue"; } from "vue";
import { import { getPaperDetail } from "../../api/exam";
getPaperDetail export default {
} from "../../api/exam"; props: {},
export default { setup(props, ctx) {
props: { let data = reactive({
value: 50,
}, Exam_Student_Id: 0,
setup(props, ctx) { msg: {
let Gid = uni.getStorageSync("userInfo").Id; GuestId: 0,
let data = reactive({ PaperId: 0,
value:50, PublishId: 0,
Exam_Student_Id: 0, isShowAnswer: true,
msg: { },
GuestId: 0, dataList: {},
PaperId: 0, });
PublishId: 0, let methods = {
isShowAnswer: true //返回首页
}, back() {
dataList:{} uni.navigateBack();
}); },
let methods = { async getPaperDetail() {
//返回首页 let res = await getPaperDetail(data.msg);
backToIndex(){ if (res) {
uni.navigateBack(); if (res.Code == 1) {
}, data.dataList = res.Data;
async getPaperDetail() { }
let res = await getPaperDetail(data.msg); }
if (res) { },
if (res.Code == 1) { jumpPage() {
data.dataList = res.Data; uni.navigateTo({
console.log(res,'数据'); url:
} "/pages/exam/examPaper?showScore=true" +
} "&&PaperId=" +
}, data.msg.PaperId +
}; "&&Id=" +
return { data.msg.PublishId +
...toRefs(data), "&&GuestId=" +
...methods, data.msg.GuestId +
}; "&&Exam_Student_Id=" +
}, data.Exam_Student_Id +
onLoad(options) { "&&ExamStatus=" +
if (options.GuestId) { data.dataList.ExamStatus,
this.msg.GuestId = options.GuestId; });
} },
if (options.PaperId) { };
this.msg.PaperId = options.PaperId; return {
} ...toRefs(data),
if (options.Id) { ...methods,
this.msg.PublishId = options.Id; };
} },
if (options.Exam_Student_Id) { onLoad(options) {
this.Exam_Student_Id = options.Exam_Student_Id; if (options.GuestId) {
} this.msg.GuestId = options.GuestId;
this.getPaperDetail(); }
}, if (options.PaperId) {
}; this.msg.PaperId = options.PaperId;
}
if (options.Id) {
this.msg.PublishId = options.Id;
}
if (options.Exam_Student_Id) {
this.Exam_Student_Id = options.Exam_Student_Id;
}
this.getPaperDetail();
},
};
</script> </script>
<style scoped> <style scoped>
.examScoreMain{ .examScoreMain {
position: relative; position: relative;
} }
.exam_Progress{ .exam_Progress {
position: absolute; position: absolute;
top:132px; top: 132px;
left:37%; left: 37%;
} }
.exam_Bottom{ .exam_Bottom {
padding:30rpx; padding: 30rpx;
} }
.exam_View{ .exam_View {
width:100%; width: 100%;
height:100rpx; height: 100rpx;
border-radius:20rpx; border-radius: 20rpx;
display:flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: #fff; background-color: #fff;
color:#111111; color: #111111;
font-size:26rpx; font-size: 26rpx;
font-weight: bold; font-weight: bold;
box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85); box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85);
} }
.exam_Pingyu{ .exam_Pingyu {
padding:30rpx; padding: 30rpx;
height:490rpx; height: 490rpx;
border-radius:20rpx; border-radius: 20rpx;
background-color: #fff; background-color: #fff;
margin-top:30rpx; margin-top: 30rpx;
box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85); box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85);
} }
.teacher_Say{ .teacher_Say {
font-size:32rpx; font-size: 32rpx;
color:#0F1B35; color: #0f1b35;
font-weight: bold; font-weight: bold;
} }
.teacher_Inner{ .teacher_Inner {
color:#0F1B35; color: #0f1b35;
font-size:26rpx; font-size: 26rpx;
margin-top:24rpx; margin-top: 24rpx;
line-height: 45rpx; line-height: 45rpx;
height:350rpx; height: 350rpx;
overflow-y: scroll; overflow-y: scroll;
font-family: PingFang SC; font-family: PingFang SC;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment