Commit 9333b10a authored by 黄奎's avatar 黄奎

新增页面

parent 12483eb2
...@@ -156,6 +156,19 @@ export function GetPaper(data) { ...@@ -156,6 +156,19 @@ export function GetPaper(data) {
}) })
} }
/**
* 考试获取考试题目
* @param {JSON参数} data
*/
export function queryPaperDetails(data) {
return request({
url: '/AppletIndex/GetPaperDetails',
method: 'post',
data
})
}
/** /**
* 保存试卷信息 * 保存试卷信息
* @param {JSON参数} data * @param {JSON参数} data
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
</template> </template>
<template v-if="props.row.PaperType==2"> <template v-if="props.row.PaperType==2">
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="goExameEdit(props.row)" label="编辑" <q-btn flat size="xs" color="primary" style="font-weight:400" @click="goExameEdit(props.row)" label="编辑"
v-if="currentUserInfo.Id==props.row.CreateBy &&(props.row.ExamineStatus==0||props.row.ExamineStatus==3||props.row.ExamineStatus==4)" /> />
</template> </template>
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px"> <q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px">
<q-list> <q-list>
......
...@@ -49,23 +49,7 @@ ...@@ -49,23 +49,7 @@
</template> </template>
<template v-slot:body-cell-optioned="props"> <template v-slot:body-cell-optioned="props">
<q-td :props="props"> <q-td :props="props">
<!-- <q-btn
flat
size="xs"
color="accent"
style="font-weight: 400"
label="停课"
@click="ShowStopLesson(props.row)"
v-if="props.row.GuestState === 1"
/>
<q-btn
flat
size="xs"
color="accent"
style="font-weight: 400"
label="课耗明细"
@click="goUrl(props.row)"
/> -->
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
......
<style>
.examPaperInfo_Top {
height: 83px;
border-bottom: 1px solid #d9d9d9;
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 100px;
}
.Exam-main {
height: auto !important;
overflow: hidden;
margin: 20px 100px;
}
.Exam-left {
width: 29%;
border-right: 1px solid #d9d9d9;
border-bottom: 1px solid #d9d9d9;
border-radius: 3px;
border-top: 1px solid #d9d9d9;
background: #f0f0f0;
padding-top: 20px;
padding-bottom: 0px;
}
.f1 {
float: left;
}
.Exam-right {
width: 65%;
min-height: 795px;
background: #fff;
border-radius: 3px;
overflow-y: auto;
border: 1px solid #d9d9d9;
margin-left: 20px;
}
.Left-ptitel {
font-size: 14px;
color: #777;
padding-left: 18px;
}
.Left-ptitel span {
font-size: 14px;
color: #333;
}
.Left-ptitel i {
color: #c90000;
font-style: normal;
}
.Left-list {
width: 100%;
border-top: 1px solid #d9d9d9;
}
.List-ul {
margin: 0;
padding: 0;
}
.List-ul li {
height: 33px;
border-bottom: 1px solid #f3f3f3;
list-style-type: none;
}
.List-ul-li-checked {
background: #a6a6a6;
color: #333;
width: 328px;
}
.List-ul li {
display: block;
padding-left: 25px;
line-height: 33px;
font-size: 12px;
height: 33px;
border-bottom: 1px solid #f3f3f3;
color: #555;
text-decoration: none;
display: flex;
}
.List-ul-li-checked b {
color: #000;
}
.Showbtn {
display: block;
width: 90px;
float: right;
padding-top: 8px;
z-index: 1000;
}
.Left-btn {
height: 58px;
padding: 20px 0 20px 20px;
width: 100%;
border-bottom: 1px solid #d9d9d9;
display: flex;
justify-content: space-between;
align-items: center;
}
.List-bt {
width: 100%;
height: 27px;
margin-left: 1px;
background: #fdfdfd;
font-size: 14px;
line-height: 27px;
padding-left: 10px;
}
.List-bt i {
position: relative;
top: 1px;
left: 5px;
}
.List-bt i:hover {
color: #2961fe;
cursor: pointer;
}
.List-ul li:hover {
background: #a6a6a6;
color: #333;
}
.checkUl {
background: #a6a6a6;
color: #333;
}
.List-ul li:hover .exam_ListSHow {
display: block;
}
.left-btn-list {
padding: 5px 10px;
display: inline-block;
color: #555;
border-radius: 3px;
font-size: 14px;
border: 1px solid #999;
margin-right: 10px;
cursor: pointer;
}
#btn1 {
background: #26a69a !important;
}
.difficulty_Degree {
display: inline-block;
width: 80px;
text-align: right;
line-height: 56px;
}
.Left-list::-webkit-scrollbar {
width: 3px;
height: 3px;
background-color: #F5F5F5;
}
/*!*定义滚动条轨道 内阴影+圆角*!*/
.Left-list::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #F5F5F5;
}
/*!*定义滑块 内阴影+圆角*!*/
.Left-list::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: -webkit-gradient(linear, 0 0, 0 100%, color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.5, transparent), to(transparent));
background-color: #0ae;
}
.commonDalei {
display: flex;
align-content: center;
margin-bottom: 20px;
}
.examPaper .edui-editor {
z-index: 99 !important;
}
.List-bt input {
outline: none;
height: 25px;
}
.exam_DetailList {
width: 80%;
display: inline-block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 5px;
}
.exam_ListSHow {
display: none;
}
.exam_ListSHow i:hover {
color: #2961fe;
}
.pGroupName {
color: #202020;
font-size: 16px;
}
.paper_Title p {
display: inline;
}
.pGNameDiv {
font-size: 12px;
margin-top: 20px;
}
.Exam-main .common_TiTable {
border-spacing: 0;
}
.examPaperInfo_Top .vClozeQuestion .clozeTest_question_tit {
margin: 15px 0;
}
</style>
<template>
<div class="examPaper page-body">
<div class="examPaperInfo_Top">
<div>
<div>
{{DataObj.PaperName}} <br />
创建人:{{DataObj.CreateByName}} &nbsp;&nbsp;&nbsp;题量:{{examNum}} &nbsp;&nbsp;&nbsp; 满分:{{examScore}}
<q-checkbox size="xs" v-model="isShowAnswer" label="显示答案" />
</div>
</div>
<div style="width:20%;text-align:right;">
<q-btn color="accent" size="sm" class="q-mr-md" @click="goBack()" label="返回" />
</div>
</div>
<div class="Exam-main">
<template v-if="DataObj&&DataObj.GroupList&&DataObj.GroupList.length>0">
<div v-for="(gItem,gIndex) in DataObj.GroupList" :key="gIndex">
<div class="pGNameDiv"><span class="pGroupName">{{NoToChinese(gIndex+1)}}{{gItem.GroupName}}</span> (共
{{gItem.DetailsList.length}} 题,{{gItem.GScore}}分)</div>
<div v-for="(dItem,dIndex) in gItem.DetailsList" :key="dIndex">
<span>{{dIndex+1}}</span>
<span class="paper_Title" v-html="dItem.Title"></span>
<span style="margin:10px 0;display:inline-block;">
({{dItem.Score}}分)
</span>
<!--单选题-->
<v-single v-if="dItem.QuestionTypeKey=='single'||dItem.QuestionTypeKey=='single-number'"
:questionObj="dItem" :isShowAnswer="isShowAnswer">
</v-single>
<!--多选题-->
<v-multiple v-if="dItem.QuestionTypeKey=='multiple'" :questionObj="dItem" :isShowAnswer="isShowAnswer">
</v-multiple>
<!--填空题-->
<v-fillin v-if="dItem.QuestionTypeKey=='fill-in'" :questionObj="dItem" :isShowAnswer="isShowAnswer">
</v-fillin>
<!--判断题-->
<v-judge v-if="dItem.QuestionTypeKey=='judge'" :questionObj="dItem" :isShowAnswer="isShowAnswer"></v-judge>
<!--简答题、名词解释、论述题、计算题、口语题、其它-->
<v-shortanswer v-if="dItem.QuestionTypeKey=='short-answer'||dItem.QuestionTypeKey=='noun-explanation'||dItem.QuestionTypeKey=='essay-question'
||dItem.QuestionTypeKey=='calculation' || dItem.QuestionTypeKey=='spoken'|| dItem.QuestionTypeKey=='other'
" :questionObj="dItem" :isShowAnswer="isShowAnswer"> </v-shortanswer>
<!--分录题、资料题-->
<v-entryproblem v-if="dItem.QuestionTypeKey=='entry-problem'|| dItem.QuestionTypeKey=='data-question'"
:questionObj="dItem" :isShowAnswer="isShowAnswer">
</v-entryproblem>
<!--连线题-->
<v-matching v-if="dItem.QuestionTypeKey=='matching'" :questionObj="dItem" :isShowAnswer="isShowAnswer">
</v-matching>
<!--排序题-->
<v-sortingproblem v-if="dItem.QuestionTypeKey=='sorting-problem'" :questionObj="dItem"
:isShowAnswer="isShowAnswer"></v-sortingproblem>
<!--完型填空-->
<v-cloze v-if="dItem.QuestionTypeKey=='cloze'" :questionObj="dItem" :isShowAnswer="isShowAnswer"></v-cloze>
<!--阅读理解、听力题-->
<v-readingcomprehensio
v-if="dItem.QuestionTypeKey=='reading-comprehensio'||dItem.QuestionTypeKey=='listening'"
:questionObj="dItem" :isShowAnswer="isShowAnswer"></v-readingcomprehensio>
<!--共用选择题-->
<v-sharingchoose v-if="dItem.QuestionTypeKey=='sharing-choose'" :questionObj="dItem"
:isShowAnswer="isShowAnswer">
</v-sharingchoose>
</div>
</div>
</template>
</div>
</div>
</template>
<script>
import vSingle from '../../components/questiontype/v-single'
import vMultiple from '../../components/questiontype/v-multiple'
import vFillin from '../../components/questiontype/v-fillin'
import vJudge from '../../components/questiontype/v-judge'
import vShortanswer from '../../components/questiontype/v-shortanswer'
import vEntryproblem from '../../components/questiontype/v-entryproblem'
import vMatching from '../../components/questiontype/v-matching'
import vSortingproblem from '../../components/questiontype/v-sortingproblem'
import vCloze from '../../components/questiontype/v-cloze'
import vReadingcomprehensio from '../../components/questiontype/v-readingcomprehensio'
import vSharingchoose from '../../components/questiontype/v-sharingchoose'
import {
GetPaperDetails,
} from '../../api/teacher/index';
export default {
components: {
vSingle,
vMultiple,
vFillin,
vJudge,
vShortanswer,
vEntryproblem,
vMatching,
vSortingproblem,
vCloze,
vReadingcomprehensio,
vSharingchoose
},
meta: {
title: "试卷详情"
},
watch: {
},
data() {
return {
msg: {
Id: 1,
GuestId: 60,
PaperId: 5
},
//试卷对象
DataObj: {
PaperId: 0, //试卷编号
PaperName: '', //试卷名称
QuestionBandIds: "", //关联题库编号
DifficultyType: 1, //试卷难易程度
GenerateType: 2, //组卷类型(1-智能组卷,2-手动组卷,3-智能导入)
CreateNum: 1, //生成试卷套数
PaperType: 2, //试卷类型(1-文件夹,2-试卷)
ParentId: 0, //父节点编号,
GroupList: [], //试卷答题分类
CreateByName: "", //创建人
},
isShowAnswer: false, //是否显示答案
examScore: 0, //总分,
examNum: 0, //总题量
}
},
created() {
},
mounted() {
this.GetPaperDetails()
},
methods: {
NoToChinese(str) {
str = str + '';
var len = str.length - 1;
var idxs = ['', '十', '百', '千', '万', '十', '百', '千', '亿', '十', '百', '千', '万', '十', '百', '千', '亿'];
var num = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
return str.replace(/([1-9]|0+)/g, function ($, $1, idx, full) {
var pos = 0;
if ($1[0] != '0') {
pos = len - idx;
if (idx == 0 && $1[0] == 1 && idxs[len - idx] == '十') {
return idxs[len - idx];
}
return num[$1[0]] + idxs[len - idx];
} else {
var left = len - idx;
var right = len - idx + $1.length;
if (Math.floor(right / 4) - Math.floor(left / 4) > 0) {
pos = left - left % 4;
}
if (pos) {
return idxs[pos] + num[$1[0]];
} else if (idx + $1.length >= len) {
return '';
} else {
return num[$1[0]]
}
}
});
},
//获取试卷详情
GetPaperInfo() {
GetPaper(this.msg).then(res => {
var tempData = res.Data;
console.log("tempData",tempData);
if (res.Code == 1) {
this.DataObj.PaperId = tempData.PaperId;
this.DataObj.PaperName = tempData.PaperName;
this.DataObj.QuestionBandIds = tempData.QuestionBandIds;
this.DataObj.DifficultyType = tempData.DifficultyType;
this.DataObj.GenerateType = tempData.GenerateType;
this.DataObj.CreateNum = tempData.CreateNum;
this.DataObj.PaperType = tempData.PaperType;
this.DataObj.ParentId = tempData.ParentId;
this.DataObj.CreateByName = tempData.CreateByName;
if (tempData.GroupList && tempData.GroupList.length > 0) {
this.DataObj.GroupList = tempData.GroupList;
}
this.calcPaper();
}
})
},
//计算试卷相关
calcPaper() {
this.examScore = 0;
this.examNum = 0;
if (this.DataObj && this.DataObj.GroupList) {
this.DataObj.GroupList.forEach(x => {
if (x.DetailsList && x.DetailsList.length > 0) {
this.examNum += x.DetailsList.length;
x.DetailsList.forEach(y => {
if (y.Score) {
this.examScore += Number(y.Score);
}
})
}
})
}
},
//返回
goBack() {
this.$router.push({
path: '/exam/examPaper'
})
}
}
}
</script>
<!--组卷--> <!--组卷-->
<style> <style>
.examCreat_Top { .examCreat_Top {
width: 100%; width: 100%;
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
padding: 0 10px; padding: 0 10px;
margin-bottom: 20px; margin-bottom: 20px;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
.examTi_List { .examTi_List {
border: 1px solid #ddd; border: 1px solid #ddd;
margin-bottom: 20px; margin-bottom: 20px;
} }
.examCreat_Top i:hover { .examCreat_Top i:hover {
color: red; color: red;
cursor: pointer; cursor: pointer;
} }
.setCt { .setCt {
margin-bottom: 12px; margin-bottom: 12px;
} }
.setCt:after { .setCt:after {
content: "020"; content: "020";
display: block; display: block;
height: 0; height: 0;
clear: both; clear: both;
visibility: hidden; visibility: hidden;
} }
.papPub_Left { .papPub_Left {
display: inline-block; display: inline-block;
width: 104px; width: 104px;
line-height: 34px; line-height: 34px;
} }
.f1 { .f1 {
float: left; float: left;
} }
.pcomRow { .pcomRow {
align-items: center; align-items: center;
} }
.selectClass { .selectClass {
width: 1026px; width: 1026px;
border: 1px dashed #e1e1e5; border: 1px dashed #e1e1e5;
padding-top: 12px; padding-top: 12px;
border-radius: 4px; border-radius: 4px;
padding: 12px 4px 0 4px; padding: 12px 4px 0 4px;
margin-top: 5px; margin-top: 5px;
} }
.selectClass span { .selectClass span {
display: inline-block; display: inline-block;
background: #f2f5fa; background: #f2f5fa;
padding: 0 10px; padding: 0 10px;
height: 26px; height: 26px;
line-height: 26px; line-height: 26px;
border-radius: 14px; border-radius: 14px;
color: #181e33; color: #181e33;
margin-left: 10px; margin-left: 10px;
margin-bottom: 12px; margin-bottom: 12px;
position: relative; position: relative;
font-size: 12px; font-size: 12px;
cursor: pointer; cursor: pointer;
} }
.selectClass span i { .selectClass span i {
position: absolute; position: absolute;
right: -8px; right: -8px;
top: -10px; top: -10px;
display: none; display: none;
color: gray; color: gray;
cursor: pointer; cursor: pointer;
} }
.selectClass span:hover i {
display: block;
}
.paper_QuesDes {
font-size: 12px;
color: #a8a8b3;
display: block;
margin: 0 0 15px 28px;
}
#paper_Publish {
padding-left: 60px !important;
}
#paper_Publish .edui-editor {
z-index: 99 !important;
}
.selectClass span:hover i {
display: block;
}
.paper_QuesDes {
font-size: 12px;
color: #a8a8b3;
display: block;
margin: 0 0 15px 28px;
}
#paper_Publish {
padding-left: 60px !important;
}
#paper_Publish .edui-editor {
z-index: 99 !important;
}
</style> </style>
<template> <template>
<div class="page-body" id="paper_Publish"> <div class="page-body" id="paper_Publish">
...@@ -101,19 +105,9 @@ ...@@ -101,19 +105,9 @@
<span class="papPub_Left f1">发放对象</span> <span class="papPub_Left f1">发放对象</span>
<div class="f1" style="margin-top: 5px"> <div class="f1" style="margin-top: 5px">
<!-- <q-btn color="accent" size="sm" @click="showClassStu" class="q-mr-md" label="选择学员"  /><br /> --> <!-- <q-btn color="accent" size="sm" @click="showClassStu" class="q-mr-md" label="选择学员"  /><br /> -->
<div <div class="selectClass" v-if="postMsg.StudentList && postMsg.StudentList.length > 0">
class="selectClass" <span v-for="(item, index) in postMsg.StudentList" :key="index" style="padding-left: 5px">{{ item.GuestName }}
v-if="postMsg.StudentList && postMsg.StudentList.length > 0" <i class="iconfont icon-shanchu1" @click="delStudentName(index)"></i>
>
<span
v-for="(item, index) in postMsg.StudentList"
:key="index"
style="padding-left: 5px"
>{{ item.GuestName }}
<i
class="iconfont icon-shanchu1"
@click="delStudentName(index)"
></i>
</span> </span>
</div> </div>
</div> </div>
...@@ -121,41 +115,16 @@ ...@@ -121,41 +115,16 @@
<div class="setCt"> <div class="setCt">
<span class="papPub_Left f1">发放时间</span> <span class="papPub_Left f1">发放时间</span>
<div class="f1"> <div class="f1">
<q-input <q-input filled v-model="postMsg.ExamStartTime" style="width: 308px" mask="####-##-## ##:##:##" label="开始时间"
filled ref="StartTime" disable :rules="[(val) => !!val || '请选择开始时间']">
v-model="postMsg.ExamStartTime"
style="width: 308px"
mask="####-##-## ##:##:##"
label="开始时间"
ref="StartTime"
disable
:rules="[(val) => !!val || '请选择开始时间']"
>
<template v-slot:append> <template v-slot:append>
<q-icon name="event" class="cursor-pointer"> <q-icon name="event" class="cursor-pointer">
<q-popup-proxy <q-popup-proxy ref="qDateProxy" transition-show="scale" transition-hide="scale">
ref="qDateProxy"
transition-show="scale"
transition-hide="scale"
>
<div class="q-gutter-md row items-start"> <div class="q-gutter-md row items-start">
<q-date <q-date v-model="postMsg.ExamStartTime" mask="YYYY-MM-DD HH:mm:ss"></q-date>
v-model="postMsg.ExamStartTime" <q-time v-model="postMsg.ExamStartTime" format24h mask="YYYY-MM-DD HH:mm:ss" />
mask="YYYY-MM-DD HH:mm:ss"
></q-date>
<q-time
v-model="postMsg.ExamStartTime"
format24h
mask="YYYY-MM-DD HH:mm:ss"
/>
</div> </div>
<q-btn <q-btn v-close-popup label="关闭" color="primary" flat style="float: right" />
v-close-popup
label="关闭"
color="primary"
flat
style="float: right"
/>
</q-popup-proxy> </q-popup-proxy>
</q-icon> </q-icon>
</template> </template>
...@@ -165,41 +134,16 @@ ...@@ -165,41 +134,16 @@
<div class="setCt"> <div class="setCt">
<span class="papPub_Left f1">结束时间</span> <span class="papPub_Left f1">结束时间</span>
<div class="f1"> <div class="f1">
<q-input <q-input filled v-model="postMsg.ExamEndTime" style="width: 308px" mask="####-##-## ##:##:##" label="结束时间"
filled ref="ExamEndTime" disable :rules="[(val) => !!val || '请选择结束时间']">
v-model="postMsg.ExamEndTime"
style="width: 308px"
mask="####-##-## ##:##:##"
label="结束时间"
ref="ExamEndTime"
disable
:rules="[(val) => !!val || '请选择结束时间']"
>
<template v-slot:append> <template v-slot:append>
<q-icon name="event" class="cursor-pointer"> <q-icon name="event" class="cursor-pointer">
<q-popup-proxy <q-popup-proxy ref="qDateProxy2" transition-show="scale" transition-hide="scale">
ref="qDateProxy2"
transition-show="scale"
transition-hide="scale"
>
<div class="q-gutter-md row items-start"> <div class="q-gutter-md row items-start">
<q-date <q-date v-model="postMsg.ExamEndTime" mask="YYYY-MM-DD HH:mm:ss"></q-date>
v-model="postMsg.ExamEndTime" <q-time v-model="postMsg.ExamEndTime" format24h mask="YYYY-MM-DD HH:mm:ss" />
mask="YYYY-MM-DD HH:mm:ss"
></q-date>
<q-time
v-model="postMsg.ExamEndTime"
format24h
mask="YYYY-MM-DD HH:mm:ss"
/>
</div> </div>
<q-btn <q-btn v-close-popup label="关闭" color="primary" flat style="float: right" />
v-close-popup
label="关闭"
color="primary"
flat
style="float: right"
/>
</q-popup-proxy> </q-popup-proxy>
</q-icon> </q-icon>
</template> </template>
...@@ -209,16 +153,8 @@ ...@@ -209,16 +153,8 @@
<div class="setCt"> <div class="setCt">
<span class="papPub_Left f1">考试限时</span> <span class="papPub_Left f1">考试限时</span>
<div class="f1"> <div class="f1">
<q-input <q-input filled bottom-slots maxlength="10" style="width: 308px" v-model="postMsg.ExamTimes" label="考试限时"
filled :dense="false" disable>
bottom-slots
maxlength="10"
style="width: 308px"
v-model="postMsg.ExamTimes"
label="考试限时"
:dense="false"
disable
>
<template v-slot:append> <template v-slot:append>
<span style="font-size: 12px">分钟</span> <span style="font-size: 12px">分钟</span>
</template> </template>
...@@ -228,16 +164,8 @@ ...@@ -228,16 +164,8 @@
<div class="setCt"> <div class="setCt">
<span class="papPub_Left f1">限时提交</span> <span class="papPub_Left f1">限时提交</span>
<div class="f1"> <div class="f1">
<q-input <q-input filled bottom-slots maxlength="10" style="width: 308px" v-model="postMsg.SubmitTimes" label="限时提交"
filled :dense="false" disable>
bottom-slots
maxlength="10"
style="width: 308px"
v-model="postMsg.SubmitTimes"
label="限时提交"
:dense="false"
disable
>
<template v-slot:append> <template v-slot:append>
<span style="font-size: 12px">分钟内不允许提交</span> <span style="font-size: 12px">分钟内不允许提交</span>
</template> </template>
...@@ -247,15 +175,7 @@ ...@@ -247,15 +175,7 @@
<div class="setCt"> <div class="setCt">
<span class="papPub_Left f1">限时进入</span> <span class="papPub_Left f1">限时进入</span>
<div class="f1"> <div class="f1">
<q-input <q-input filled bottom-slots maxlength="10" v-model="postMsg.EnterTimes" label="限时进入" :dense="false" disable>
filled
bottom-slots
maxlength="10"
v-model="postMsg.EnterTimes"
label="限时进入"
:dense="false"
disable
>
<template v-slot:append> <template v-slot:append>
<span style="font-size: 12px">分钟后不允许参加考试</span> <span style="font-size: 12px">分钟后不允许参加考试</span>
</template> </template>
...@@ -265,42 +185,17 @@ ...@@ -265,42 +185,17 @@
<div class="setCt"> <div class="setCt">
<span class="papPub_Left f1">防作弊设置</span> <span class="papPub_Left f1">防作弊设置</span>
<div class="f1"> <div class="f1">
<q-checkbox <q-checkbox size="xs" v-model="postMsg.IsQuestionRandom" :true-value="1" :false-value="0" label="题目乱序"
size="xs" disable />
v-model="postMsg.IsQuestionRandom"
:true-value="1"
:false-value="0"
label="题目乱序"
disable
/>
<div class="paper_QuesDes">学生接收到的题目显示顺序不同</div> <div class="paper_QuesDes">学生接收到的题目显示顺序不同</div>
<q-checkbox <q-checkbox size="xs" v-model="postMsg.IsOptionRandom" :true-value="1" :false-value="0" label="选项乱序" disable />
size="xs"
v-model="postMsg.IsOptionRandom"
:true-value="1"
:false-value="0"
label="选项乱序"
disable
/>
<div class="paper_QuesDes">学生接收到的题目选项顺序不同</div> <div class="paper_QuesDes">学生接收到的题目选项顺序不同</div>
<q-checkbox <q-checkbox size="xs" v-model="postMsg.IsLeaveAnswer" :true-value="1" :false-value="0" label="学生离开作答页面"
size="xs" disable />
v-model="postMsg.IsLeaveAnswer"
:true-value="1"
:false-value="0"
label="学生离开作答页面"
disable
/>
<template> <template>
<span style="position: relative; top: 2px"> <span style="position: relative; top: 2px">
&nbsp;<el-input &nbsp;<el-input style="width: 80px" size="small" v-model="postMsg.LeaveTimes"
style="width: 80px" @keyup.native="checkInteger(postMsg, 'LeaveTimes')" maxlength="5" disabled></el-input>
size="small"
v-model="postMsg.LeaveTimes"
@keyup.native="checkInteger(postMsg, 'LeaveTimes')"
maxlength="5"
disabled
></el-input>
&nbsp;次,系统强制收卷 &nbsp;次,系统强制收卷
</span> </span>
</template> </template>
...@@ -308,31 +203,13 @@ ...@@ -308,31 +203,13 @@
系统强制收卷后,教师重新发放试卷,学生可以继续作答 系统强制收卷后,教师重新发放试卷,学生可以继续作答
</div> </div>
<div style="margin-bottom: 15px"> <div style="margin-bottom: 15px">
<q-checkbox <q-checkbox size="xs" v-model="postMsg.IsDisableMultiTerminal" :true-value="1" :false-value="0"
size="xs" label="禁止学生多终端考试" disable />
v-model="postMsg.IsDisableMultiTerminal"
:true-value="1"
:false-value="0"
label="禁止学生多终端考试"
disable
/>
</div> </div>
<q-checkbox <q-checkbox size="xs" v-model="postMsg.IsExamType" :true-value="1" :false-value="0" label="只允许" disable />
size="xs"
v-model="postMsg.IsExamType"
:true-value="1"
:false-value="0"
label="只允许"
disable
/>
<template> <template>
<span style="position: relative; top: 2px"> <span style="position: relative; top: 2px">
&nbsp;<el-select &nbsp;<el-select style="width: 80px" size="small" v-model="postMsg.ExamTypeValue" disabled>
style="width: 80px"
size="small"
v-model="postMsg.ExamTypeValue"
disabled
>
<el-option :value="1" label="App"></el-option> <el-option :value="1" label="App"></el-option>
<el-option :value="2" label="PC"></el-option> <el-option :value="2" label="PC"></el-option>
</el-select> </el-select>
...@@ -343,57 +220,28 @@ ...@@ -343,57 +220,28 @@
</div> </div>
<div class="setCt"> <div class="setCt">
<span class="papPub_Left f1">考试须知</span> <span class="papPub_Left f1">考试须知</span>
<UeEditor <UeEditor v-model="postMsg.ExamNotice" :config="config" style="margin: 30px 0 0 110px; z-index: 1; width: 1026px"
v-model="postMsg.ExamNotice" ref="UE_Title" disabled></UeEditor>
:config="config"
style="margin: 30px 0 0 110px; z-index: 1; width: 1026px"
ref="UE_Title"
disabled
></UeEditor>
</div> </div>
<div style="margin: 20px 0">高级设置</div> <div style="margin: 20px 0">高级设置</div>
<div class="setCt"> <div class="setCt">
<span class="papPub_Left f1">交卷设置</span> <span class="papPub_Left f1">交卷设置</span>
<q-checkbox <q-checkbox size="xs" v-model="postMsg.IsAutoSubmit" :true-value="1" :false-value="0" label="考试到达截止时间后自动提交"
size="xs" disable />
v-model="postMsg.IsAutoSubmit"
:true-value="1"
:false-value="0"
label="考试到达截止时间后自动提交"
disable
/>
</div> </div>
<div class="setCt"> <div class="setCt">
<span class="papPub_Left f1">评分设置</span> <span class="papPub_Left f1">评分设置</span>
<div class="f1"> <div class="f1">
<q-checkbox <q-checkbox size="xs" v-model="postMsg.FillInIsSubject" :true-value="1" :false-value="0" label="填空类型的题目设为主观题"
size="xs" disable />
v-model="postMsg.FillInIsSubject"
:true-value="1"
:false-value="0"
label="填空类型的题目设为主观题"
disable
/>
<div class="paper_QuesDes"> <div class="paper_QuesDes">
填空题类型的包括填空题、分录题、资料题,设为主观题后需教师手动批阅 填空题类型的包括填空题、分录题、资料题,设为主观题后需教师手动批阅
</div> </div>
<q-checkbox <q-checkbox size="xs" v-model="postMsg.FillInIsIgnore" :true-value="1" :false-value="0" label="填空题答案不区分大小写"
size="xs" disable />
v-model="postMsg.FillInIsIgnore"
:true-value="1"
:false-value="0"
label="填空题答案不区分大小写"
disable
/>
<div class="paper_QuesDes">勾选后,英文大写和小写都可以得分</div> <div class="paper_QuesDes">勾选后,英文大写和小写都可以得分</div>
<q-checkbox <q-checkbox size="xs" v-model="postMsg.IsHalfScore" :true-value="1" :false-value="0" label="多选题未选全给一半分"
size="xs" disable />
v-model="postMsg.IsHalfScore"
:true-value="1"
:false-value="0"
label="多选题未选全给一半分"
disable
/>
<div class="paper_QuesDes">不勾选时全选对才给分</div> <div class="paper_QuesDes">不勾选时全选对才给分</div>
</div> </div>
</div> </div>
...@@ -406,158 +254,158 @@ ...@@ -406,158 +254,158 @@
disable disable
/> --> /> -->
</div> </div>
<classstutreeForm <classstutreeForm v-if="isShowClassStu" @close="closeClassStuForm" @success="getClassStuList">
v-if="isShowClassStu"
@close="closeClassStuForm"
@success="getClassStuList"
>
</classstutreeForm> </classstutreeForm>
</div> </div>
</template> </template>
<script> <script>
import UeEditor from "../../components/editor/UeEditor"; import UeEditor from "../../components/editor/UeEditor";
import classstutreeForm from "../../components/exam/classstutree-form"; import classstutreeForm from "../../components/exam/classstutree-form";
import { savePublishExam, queryExamPublish } from "../../api/teacher/index"; import {
export default { savePublishExam,
components: { queryExamPublish
classstutreeForm, } from "../../api/teacher/index";
UeEditor, export default {
}, components: {
meta: { classstutreeForm,
title: "发布考试", UeEditor,
},
data() {
return {
postMsg: {
Id: 0, //发布编号
PaperId: 0, //试卷编号
PublishType: 1, // 发放类型(1-按班级发放,2-指定学生发放)
ExamStartTime: "2021-08-20 10:00:00", //考试开始时间
ExamEndTime: "2021-08-20 12:00:00", //考试结束时间
ExamTimes: 0, //考试限时
SubmitTimes: 0, //限时提交(多少分钟内不允许提交)
EnterTimes: 0, //限时进入(多少分钟后不允许参加考试)
IsQuestionRandom: 0, //题目乱序(1-是)
IsOptionRandom: 0, //选项乱序(1-是)
IsLeaveAnswer: 0, //学生离开作答页面(1-是)
LeaveTimes: 0, //离开次数
IsDisableMultiTerminal: 0, //是否禁用多终端(1-是)
IsExamType: 0, //是否只允许(App、PC)考试(1-是)
ExamTypeValue: 1, //考试终端类型(1-App,2-PC)
ExamNotice: "", //考试须知
PassScore: 0, //及格分数
IsAutoSubmit: 1, //考试到达截止时间后自动提交(1-是)
FillInIsSubject: 0, //填空类型的题目设为主观题(1-是)
FillInIsIgnore: 0, //填空题答案不区分大小写(1-是)
IsHalfScore: 1, //多选题未选全给一半分(1-是)
StudentList: [],
},
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
isShowClassStu: false, //是否显示学员弹窗
};
},
created() {
if (this.$route.query && this.$route.query.PaperId) {
this.postMsg.PaperId = decodeURI(this.$route.query.PaperId);
}
if (this.$route.query && this.$route.query.Id) {
this.postMsg.Id = decodeURI(this.$route.query.Id);
this.getExamInfo();
}
},
mounted() {},
methods: {
//删除发放对象
delStudentName(index) {
this.postMsg.StudentList.splice(index, 1);
}, },
getExamInfo() { meta: {
queryExamPublish({ title: "发布考试",
Id: this.postMsg.Id,
}).then((res) => {
if (res.Code == 1) {
var tempData = res.Data;
if (tempData) {
this.postMsg.Id = tempData.Id;
this.postMsg.PaperId = tempData.PaperId;
this.postMsg.PublishType = tempData.PublishType;
this.postMsg.ExamStartTime = tempData.ExamStartTime;
this.postMsg.ExamEndTime = tempData.ExamEndTime;
this.postMsg.ExamTimes = tempData.ExamTimes;
this.postMsg.SubmitTimes = tempData.SubmitTimes;
this.postMsg.EnterTimes = tempData.EnterTimes;
this.postMsg.IsQuestionRandom = tempData.IsQuestionRandom;
this.postMsg.IsOptionRandom = tempData.IsOptionRandom;
this.postMsg.IsLeaveAnswer = tempData.IsLeaveAnswer;
this.postMsg.LeaveTimes = tempData.LeaveTimes;
this.postMsg.IsDisableMultiTerminal =
tempData.IsDisableMultiTerminal;
this.postMsg.IsExamType = tempData.IsExamType;
this.postMsg.ExamTypeValue = tempData.ExamTypeValue;
this.postMsg.ExamNotice = tempData.ExamNotice;
this.postMsg.PassScore = tempData.PassScore;
this.postMsg.IsAutoSubmit = tempData.IsAutoSubmit;
this.postMsg.FillInIsSubject = tempData.FillInIsSubject;
this.postMsg.FillInIsIgnore = tempData.FillInIsIgnore;
this.postMsg.IsHalfScore = tempData.IsHalfScore;
if (tempData.StudentList && tempData.StudentList.length > 0) {
this.postMsg.StudentList = tempData.StudentList;
}
}
}
});
},
//显示班级学员弹窗
showClassStu() {
this.isShowClassStu = true;
}, },
//关闭班级学员弹窗 data() {
closeClassStuForm() { return {
this.isShowClassStu = false; postMsg: {
Id: 0, //发布编号
PaperId: 0, //试卷编号
PublishType: 1, // 发放类型(1-按班级发放,2-指定学生发放)
ExamStartTime: "2021-08-20 10:00:00", //考试开始时间
ExamEndTime: "2021-08-20 12:00:00", //考试结束时间
ExamTimes: 0, //考试限时
SubmitTimes: 0, //限时提交(多少分钟内不允许提交)
EnterTimes: 0, //限时进入(多少分钟后不允许参加考试)
IsQuestionRandom: 0, //题目乱序(1-是)
IsOptionRandom: 0, //选项乱序(1-是)
IsLeaveAnswer: 0, //学生离开作答页面(1-是)
LeaveTimes: 0, //离开次数
IsDisableMultiTerminal: 0, //是否禁用多终端(1-是)
IsExamType: 0, //是否只允许(App、PC)考试(1-是)
ExamTypeValue: 1, //考试终端类型(1-App,2-PC)
ExamNotice: "", //考试须知
PassScore: 0, //及格分数
IsAutoSubmit: 1, //考试到达截止时间后自动提交(1-是)
FillInIsSubject: 0, //填空类型的题目设为主观题(1-是)
FillInIsIgnore: 0, //填空题答案不区分大小写(1-是)
IsHalfScore: 1, //多选题未选全给一半分(1-是)
StudentList: [],
},
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
isShowClassStu: false, //是否显示学员弹窗
};
}, },
//获取选中的需要列表 created() {
getClassStuList(array) { if (this.$route.query && this.$route.query.PaperId) {
if (array && array.length > 0) { this.postMsg.PaperId = decodeURI(this.$route.query.PaperId);
array.forEach((item) => { }
this.postMsg.StudentList.push({ if (this.$route.query && this.$route.query.Id) {
GuestId: item.GuestId, this.postMsg.Id = decodeURI(this.$route.query.Id);
ClassId: item.ClassId, this.getExamInfo();
OrderId: item.OrderId,
CourseId: item.CourseId,
GuestName: item.Name,
});
});
} }
this.isShowClassStu = false;
}, },
//发布考试 mounted() {},
setPublishExam() { methods: {
savePublishExam(this.postMsg).then((res) => { //删除发放对象
if (res.Code == 1) { delStudentName(index) {
this.$q.notify({ this.postMsg.StudentList.splice(index, 1);
icon: "iconfont icon-chenggong", },
color: "accent", getExamInfo() {
timeout: 2000, queryExamPublish({
message: "操作成功!", Id: this.postMsg.Id,
position: "top", }).then((res) => {
}); if (res.Code == 1) {
this.$router.push({ var tempData = res.Data;
path: "/exam/examlist", if (tempData) {
query: {}, this.postMsg.Id = tempData.Id;
}); this.postMsg.PaperId = tempData.PaperId;
} else { this.postMsg.PublishType = tempData.PublishType;
this.$q.notify({ this.postMsg.ExamStartTime = tempData.ExamStartTime;
type: "negative", this.postMsg.ExamEndTime = tempData.ExamEndTime;
position: "top", this.postMsg.ExamTimes = tempData.ExamTimes;
message: `操作失败!`, this.postMsg.SubmitTimes = tempData.SubmitTimes;
this.postMsg.EnterTimes = tempData.EnterTimes;
this.postMsg.IsQuestionRandom = tempData.IsQuestionRandom;
this.postMsg.IsOptionRandom = tempData.IsOptionRandom;
this.postMsg.IsLeaveAnswer = tempData.IsLeaveAnswer;
this.postMsg.LeaveTimes = tempData.LeaveTimes;
this.postMsg.IsDisableMultiTerminal =
tempData.IsDisableMultiTerminal;
this.postMsg.IsExamType = tempData.IsExamType;
this.postMsg.ExamTypeValue = tempData.ExamTypeValue;
this.postMsg.ExamNotice = tempData.ExamNotice;
this.postMsg.PassScore = tempData.PassScore;
this.postMsg.IsAutoSubmit = tempData.IsAutoSubmit;
this.postMsg.FillInIsSubject = tempData.FillInIsSubject;
this.postMsg.FillInIsIgnore = tempData.FillInIsIgnore;
this.postMsg.IsHalfScore = tempData.IsHalfScore;
if (tempData.StudentList && tempData.StudentList.length > 0) {
this.postMsg.StudentList = tempData.StudentList;
}
}
}
});
},
//显示班级学员弹窗
showClassStu() {
this.isShowClassStu = true;
},
//关闭班级学员弹窗
closeClassStuForm() {
this.isShowClassStu = false;
},
//获取选中的需要列表
getClassStuList(array) {
if (array && array.length > 0) {
array.forEach((item) => {
this.postMsg.StudentList.push({
GuestId: item.GuestId,
ClassId: item.ClassId,
OrderId: item.OrderId,
CourseId: item.CourseId,
GuestName: item.Name,
});
}); });
} }
}); this.isShowClassStu = false;
},
//发布考试
setPublishExam() {
savePublishExam(this.postMsg).then((res) => {
if (res.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "操作成功!",
position: "top",
});
this.$router.push({
path: "/exam/examlist",
query: {},
});
} else {
this.$q.notify({
type: "negative",
position: "top",
message: `操作失败!`,
});
}
});
},
}, },
}, };
};
</script> </script>
...@@ -1072,6 +1072,11 @@ const routes = [{ ...@@ -1072,6 +1072,11 @@ const routes = [{
component: () => component: () =>
import("pages/exam/paperInfo") import("pages/exam/paperInfo")
}, },
{
path: "/exam/examtest", //学生考试
component: () =>
import("pages/exam/examtest")
},
{ {
path: "/exam/paperCreate", //试卷组卷 path: "/exam/paperCreate", //试卷组卷
component: () => component: () =>
......
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