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

1

parent d8ffe406
......@@ -100,11 +100,10 @@ export default {
ExamStatus: Number,
},
setup(props, ctx) {
let Gid = uni.getStorageSync("userInfo").Id;
let data = reactive({
msg: { GuestId: Gid, PaperId: 5, PublishId: 1 },
questionList: props.paperData.Paper.GroupList,
});
let methods = {
changeNumToHan,
chooseTopic(index, index1, index2) {
......
......@@ -42,7 +42,10 @@
>
<view
class="item1"
:class="{ isRes: item1.IsRes }"
:class="{
isTrueAnswer: item1.Answer == item1.StundetAnswer,
isNotAnswer: item1.Answer != item1.StundetAnswer,
}"
v-else
@click="chooseTopic(index, index1)"
>{{ index1 + 1 }}</view
......@@ -61,7 +64,14 @@
>
<view
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)"
>{{ index2 + 1 }}</view
>
......@@ -71,9 +81,6 @@
</view>
</view>
</view>
<view class="submitBox" v-if="ExamStatus === 1">
<view class="submit" @click="savePaper">立即提交</view>
</view>
<van-toast id="van-toast" />
</view>
</template>
......@@ -94,18 +101,13 @@ import { submitPaper } from "../../api/exam";
export default {
props: {
paperData: Object,
ExamStuId: Number,
SubmitTimes: Number,
StartTime: String,
ExamStatus: Number,
},
setup(props, ctx) {
let Gid = uni.getStorageSync("userInfo").Id;
console.log(108, props);
let data = reactive({
msg: { GuestId: Gid, PaperId: 5, PublishId: 1 },
questionList: props.paperData.Paper.GroupList,
});
console.log(108, props.paperData);
let methods = {
changeNumToHan,
chooseTopic(index, index1, index2) {
......@@ -119,55 +121,6 @@ export default {
back() {
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 {
...toRefs(data),
......@@ -181,7 +134,7 @@ export default {
.answer-sheets {
box-sizing: border-box;
padding: 30rpx;
height: calc(100vh - 300rpx);
height: calc(100vh - 200rpx);
overflow-y: auto;
}
.name,
......@@ -267,4 +220,15 @@ export default {
color: #ffffff !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>
......@@ -323,18 +323,26 @@
/>
</view>
</view>
<view class="answer-con" v-if="isShowAnswer">
<answer
:paperData="peaperDetail"
:ExamStuId="Exam_Student_Id"
:StartTime="StartTime"
:ExamStatus="ExamStatus"
:SubmitTimes="SubmitTimes"
@hideAnswer="hideAnswerSheet"
@chooseTopic="jumpTopic"
ref="answer"
/>
<view v-if="isShowAnswer">
<view class="answer-con" v-if="!isShowAnswerSee">
<answer
:paperData="peaperDetail"
:ExamStuId="Exam_Student_Id"
:StartTime="StartTime"
:ExamStatus="ExamStatus"
:SubmitTimes="SubmitTimes"
@hideAnswer="hideAnswerSheet"
@chooseTopic="jumpTopic"
ref="answer"
/>
<!-- 答题卡查看对错 -->
<view v-if="isShowAnswerSee">
<answerSee :paperData="peaperDetail" @chooseTopic="jumpTopic" />
</view>
</view>
</view>
<view class="answer-con" v-if="isShowNotice">
<examNotice :paperData="peaperDetail" @hideNotice="hideNotice" />
</view>
......@@ -376,7 +384,8 @@ import Dataquestion from "../../components/subject/Dataquestion.vue";
import SortingProblem from "../../components/subject/SortingProblem.vue";
import Connect from "../../components/subject/Connect.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"; //考前须知
export default {
components: {
......@@ -400,6 +409,7 @@ export default {
SharingChoose,
Connect,
answer,
answerSee,
examNotice,
},
setup(props, context) {
......@@ -426,6 +436,7 @@ export default {
StartTime: "", //页面加载后的时间
SubmitTimes: 0, //后台设置几分钟后可提交
isShowNotice: false, //是否显示考前须知
isShowAnswerSee: false,
});
let methods = {
changeNumToHan,
......@@ -447,7 +458,7 @@ export default {
data.peaperDetail = res.Data;
//-1-缺考, 0-未开始,1-已开始,2-已考试,3-已阅卷
this.ExamStatus = res.Data.ExamStatusTemp;
console.log(277, this.ExamStatus);
console.log(277, data.peaperDetail);
this.SubmitTimes = res.Data.Publish.SubmitTimes;
//判断是答卷
if (res.Data.ExamStatusTemp == 1) {
......@@ -575,7 +586,7 @@ export default {
...methods,
};
},
onLoad(options) {
async onLoad(options) {
if (options.GuestId) {
this.msg.GuestId = options.GuestId;
}
......@@ -594,7 +605,11 @@ export default {
) {
this.msg.isShowAnswer = true;
}
this.getPaperDetail();
await this.getPaperDetail();
if (options.showScore) {
this.isShowAnswer = true;
this.isShowAnswerSee = true;
}
},
};
</script>
......
<template>
<view>
<van-nav-bar fixed>
<template #left>
<van-icon name="cross" style="font-size: 32rpx; color: #111" @click="back" />
</template>
<template #title>
<view style="
font-size: 32rpx;
color: #111;
font-family: PingFang SC;
font-weight: 800;
">考试成绩</view>
</template>
</van-nav-bar>
<view class="examScoreMain">
<view class="exam_Progress">
<van-circle v-model="dataList.TotalScore"
:rate="dataList.Publish.ExamScore"
:speed="100"
color="#fff"
layer-color="#0097d8"
:text="dataList.TotalScore"
/>
</view>
<view>
<img style="width:100%;height:322px;" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/examTop.png" alt="" />
</view>
</view>
<view class="exam_Bottom">
<view class="exam_View">
<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>
<view>
<van-nav-bar fixed>
<template #left>
<van-icon
name="cross"
style="font-size: 32rpx; color: #111"
@click="back"
/>
</template>
<template #title>
<view
style="
font-size: 32rpx;
color: #111;
font-family: PingFang SC;
font-weight: 800;
"
>考试成绩</view
>
</template>
</van-nav-bar>
<view class="examScoreMain">
<view class="exam_Progress">
<van-circle
v-model="dataList.TotalScore"
:rate="dataList.Publish.ExamScore"
:speed="100"
color="#fff"
layer-color="#0097d8"
:text="dataList.TotalScore"
/>
</view>
<view>
<img
style="width: 100%; height: 322px"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/examTop.png"
alt=""
/>
</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>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
import {
getPaperDetail
} from "../../api/exam";
export default {
props: {
},
setup(props, ctx) {
let Gid = uni.getStorageSync("userInfo").Id;
let data = reactive({
value:50,
Exam_Student_Id: 0,
msg: {
GuestId: 0,
PaperId: 0,
PublishId: 0,
isShowAnswer: true
},
dataList:{}
});
let methods = {
//返回首页
backToIndex(){
uni.navigateBack();
},
async getPaperDetail() {
let res = await getPaperDetail(data.msg);
if (res) {
if (res.Code == 1) {
data.dataList = res.Data;
console.log(res,'数据');
}
}
},
};
return {
...toRefs(data),
...methods,
};
},
onLoad(options) {
if (options.GuestId) {
this.msg.GuestId = options.GuestId;
}
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();
},
};
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
import { getPaperDetail } from "../../api/exam";
export default {
props: {},
setup(props, ctx) {
let data = reactive({
value: 50,
Exam_Student_Id: 0,
msg: {
GuestId: 0,
PaperId: 0,
PublishId: 0,
isShowAnswer: true,
},
dataList: {},
});
let methods = {
//返回首页
back() {
uni.navigateBack();
},
async getPaperDetail() {
let res = await getPaperDetail(data.msg);
if (res) {
if (res.Code == 1) {
data.dataList = res.Data;
}
}
},
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 {
...toRefs(data),
...methods,
};
},
onLoad(options) {
if (options.GuestId) {
this.msg.GuestId = options.GuestId;
}
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>
<style scoped>
.examScoreMain{
position: relative;
}
.exam_Progress{
position: absolute;
top:132px;
left:37%;
}
.exam_Bottom{
padding:30rpx;
}
.exam_View{
width:100%;
height:100rpx;
border-radius:20rpx;
display:flex;
align-items: center;
justify-content: center;
background-color: #fff;
color:#111111;
font-size:26rpx;
font-weight: bold;
box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85);
}
.exam_Pingyu{
padding:30rpx;
height:490rpx;
border-radius:20rpx;
background-color: #fff;
margin-top:30rpx;
box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85);
}
.teacher_Say{
font-size:32rpx;
color:#0F1B35;
font-weight: bold;
}
.teacher_Inner{
color:#0F1B35;
font-size:26rpx;
margin-top:24rpx;
line-height: 45rpx;
height:350rpx;
overflow-y: scroll;
font-family: PingFang SC;
}
.examScoreMain {
position: relative;
}
.exam_Progress {
position: absolute;
top: 132px;
left: 37%;
}
.exam_Bottom {
padding: 30rpx;
}
.exam_View {
width: 100%;
height: 100rpx;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #fff;
color: #111111;
font-size: 26rpx;
font-weight: bold;
box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85);
}
.exam_Pingyu {
padding: 30rpx;
height: 490rpx;
border-radius: 20rpx;
background-color: #fff;
margin-top: 30rpx;
box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85);
}
.teacher_Say {
font-size: 32rpx;
color: #0f1b35;
font-weight: bold;
}
.teacher_Inner {
color: #0f1b35;
font-size: 26rpx;
margin-top: 24rpx;
line-height: 45rpx;
height: 350rpx;
overflow-y: scroll;
font-family: PingFang SC;
}
</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