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,7 +323,8 @@ ...@@ -323,7 +323,8 @@
/> />
</view> </view>
</view> </view>
<view class="answer-con" v-if="isShowAnswer"> <view v-if="isShowAnswer">
<view class="answer-con" v-if="!isShowAnswerSee">
<answer <answer
:paperData="peaperDetail" :paperData="peaperDetail"
:ExamStuId="Exam_Student_Id" :ExamStuId="Exam_Student_Id"
...@@ -334,7 +335,14 @@ ...@@ -334,7 +335,14 @@
@chooseTopic="jumpTopic" @chooseTopic="jumpTopic"
ref="answer" 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>
......
...@@ -2,20 +2,28 @@ ...@@ -2,20 +2,28 @@
<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
name="cross"
style="font-size: 32rpx; color: #111"
@click="back"
/>
</template> </template>
<template #title> <template #title>
<view style=" <view
style="
font-size: 32rpx; font-size: 32rpx;
color: #111; color: #111;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 800; font-weight: 800;
">考试成绩</view> "
>考试成绩</view
>
</template> </template>
</van-nav-bar> </van-nav-bar>
<view class="examScoreMain"> <view class="examScoreMain">
<view class="exam_Progress"> <view class="exam_Progress">
<van-circle v-model="dataList.TotalScore" <van-circle
v-model="dataList.TotalScore"
:rate="dataList.Publish.ExamScore" :rate="dataList.Publish.ExamScore"
:speed="100" :speed="100"
color="#fff" color="#fff"
...@@ -24,18 +32,26 @@ ...@@ -24,18 +32,26 @@
/> />
</view> </view>
<view> <view>
<img style="width:100%;height:322px;" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/examTop.png" alt="" /> <img
style="width: 100%; height: 322px"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/examTop.png"
alt=""
/>
</view> </view>
</view> </view>
<view class="exam_Bottom"> <view class="exam_Bottom">
<view class="exam_View"> <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="" /> <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 class="exam_Pingyu"> <view class="exam_Pingyu">
<view class="teacher_Say">老师评语</view> <view class="teacher_Say">老师评语</view>
<view class="teacher_Inner"> <view class="teacher_Inner">
{{dataList.StuComment}} {{ dataList.StuComment }}
</view> </view>
</view> </view>
</view> </view>
...@@ -43,7 +59,7 @@ ...@@ -43,7 +59,7 @@
</template> </template>
<script> <script>
import { import {
ref, ref,
reactive, reactive,
toRefs, toRefs,
...@@ -52,30 +68,25 @@ ...@@ -52,30 +68,25 @@
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 {
props: {
},
setup(props, ctx) { setup(props, ctx) {
let Gid = uni.getStorageSync("userInfo").Id;
let data = reactive({ let data = reactive({
value:50, value: 50,
Exam_Student_Id: 0, Exam_Student_Id: 0,
msg: { msg: {
GuestId: 0, GuestId: 0,
PaperId: 0, PaperId: 0,
PublishId: 0, PublishId: 0,
isShowAnswer: true isShowAnswer: true,
}, },
dataList:{} dataList: {},
}); });
let methods = { let methods = {
//返回首页 //返回首页
backToIndex(){ back() {
uni.navigateBack(); uni.navigateBack();
}, },
async getPaperDetail() { async getPaperDetail() {
...@@ -83,10 +94,25 @@ ...@@ -83,10 +94,25 @@
if (res) { if (res) {
if (res.Code == 1) { if (res.Code == 1) {
data.dataList = res.Data; data.dataList = res.Data;
console.log(res,'数据');
} }
} }
}, },
jumpPage() {
uni.navigateTo({
url:
"/pages/exam/examPaper?showScore=true" +
"&&PaperId=" +
data.msg.PaperId +
"&&Id=" +
data.msg.PublishId +
"&&GuestId=" +
data.msg.GuestId +
"&&Exam_Student_Id=" +
data.Exam_Student_Id +
"&&ExamStatus=" +
data.dataList.ExamStatus,
});
},
}; };
return { return {
...toRefs(data), ...toRefs(data),
...@@ -108,54 +134,54 @@ ...@@ -108,54 +134,54 @@
} }
this.getPaperDetail(); 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