feat: 添加考试试卷相关接口

xgf-training-dev
mengfanliang 2025-02-19 18:13:40 +08:00
parent 40bfdf1cf7
commit 3c7f0e696b
6 changed files with 582 additions and 549 deletions

View File

@ -1,78 +1,80 @@
import {post, upload, uploads} from "../utils/request";
import {setSecurityMeasures} from "@/utils/submitHomeworkProcess";
import { post, upload, uploads } from '../utils/request'
import { setSecurityMeasures } from '@/utils/submitHomeworkProcess'
export const submitLogin = (params) => post("/app/admin/check", params) // 登录
export const getIDCardDeduplication = (params) => post("/app/user/goCheck", params) // 身份证去重
export const getUserDeduplication = (params) => post("/app/user/goCheck", params) // 用户名去重
export const getPhoneNumberDeduplication = (params) => post("/app/user/hasPhoneForApp", params) // 手机号去重
export const setRegister = (params) => post("/app/admin/register", params) // 注册
export const setForgotPassword = (params) => post("/app/admin/forgetPassword", params) // 忘记密码
export const getElectronicWorkCard = (params) => post("/app/user/getUserDetailInfoByUserIdForApp", params) // 电子工牌
export const getElectronicWorkCardQRCode = (params) => post("/app/user/generateQRCodeImageByUserId", params) // 电子工牌二维码
export const getEmployedBy = (params) => post("/app/employmentApplyManagement/getEmploymentRecordByUserIdOrCorpInfoId", params) // 就职单位列表
export const setResignationApplication = (params) => post("/app/employmentApplyManagement/edit", params) // 离职申请
export const resign = (params) => post("/app/user/resign", params) // 离职申请
export const setRelatedPartyScanning = (params) => post("/app/user/updateUserInfoAfterScanQRCode", params) // 相关方扫码
export const getDataDictionary = (params) => post("/app/dictionaries/getLevels", params) // 数据字典
export const setUploadAttachments = (params) => upload("/app/imgFiles/addSingleImg", params) // 上传附件
export const removeUploadAttachments = (params) => post("/app/imgFiles/deleteImg", params) // 删除附件
export const setRelatedPartyRegistration = (params) => post("/app/user/saveUser", params) // 相关方注册
export const setRelatedPartyUpdate = (params) => post("/app/user/editUser", params) // 相关方修改
export const checkRelatedUnitsPersonCount = (params) => post("/app/user/checkUserCountForApp", params) // 检查相关方单位流动人员数和单位总人数
export const getServiceUnitList = (params) => post("/app/user/getRelatedUnitsListByUserId", params) // 服务单位列表
export const getServiceUnitView = (params) => post("/app/user/getRelatedUnitsDetailById", params) // 服务单位查看
export const setFeedbackUpload = (params) => upload("/app/feedback/upload", params) //反馈问题附件
export const setFeedbackAdd = (params) => post("/app/feedback/add", params) //反馈问题提交
export const getVersion = (params) => post("/app/versionmanager/getVersion", params) //版本更新
export const setUpdatePassword = (params) => post("/app/user/editUserPasswordByUserId", params) //修改密码
export const getUserInfo = (params) => post("/app/user/getDetailByUserIdAndCorpInfoId", params) //用户信息
export const setUserInfo = (params) => post("/app/user/edit", params) //修改用户信息
export const setEntry = (params) => post("/app/user/entry", params) //用户入职
export const getCertificateInformationList = (params) => post("/app/specialUser/list", params) //证书信息列表
export const getCertificateInformationView = (params) => post("/app/specialUser/goEdit", params) //证书信息查看
export const setCertificateInformationAdd = (params) => uploads("/app/specialUser/add", params) //证书信息添加
export const setCertificateInformationEdit = (params) => uploads("/app/specialUser/edit", params) //证书信息修改
export const setCertificateInformationEditPost = (params) => post("/app/specialUser/edit", params) //证书信息修改
export const getDeptTree = (params) => post("/api/department/listzTree", params) //用户信息
export const getEMPLOYMENTAPPLYMANAGEMENTID = (params) => post("/app/user/getEMPLOYMENTAPPLYMANAGEMENTID",
params) //获取EMPLOYMENTAPPLYMANAGEMENTID
export const submitLogin = (params) => post('/app/admin/check', params) // 登录
export const getIDCardDeduplication = (params) => post('/app/user/goCheck', params) // 身份证去重
export const getUserDeduplication = (params) => post('/app/user/goCheck', params) // 用户名去重
export const getPhoneNumberDeduplication = (params) => post('/app/user/hasPhoneForApp', params) // 手机号去重
export const setRegister = (params) => post('/app/admin/register', params) // 注册
export const setForgotPassword = (params) => post('/app/admin/forgetPassword', params) // 忘记密码
export const getElectronicWorkCard = (params) => post('/app/user/getUserDetailInfoByUserIdForApp', params) // 电子工牌
export const getElectronicWorkCardQRCode = (params) => post('/app/user/generateQRCodeImageByUserId', params) // 电子工牌二维码
export const getEmployedBy = (params) => post('/app/employmentApplyManagement/getEmploymentRecordByUserIdOrCorpInfoId', params) // 就职单位列表
export const setResignationApplication = (params) => post('/app/employmentApplyManagement/edit', params) // 离职申请
export const resign = (params) => post('/app/user/resign', params) // 离职申请
export const setRelatedPartyScanning = (params) => post('/app/user/updateUserInfoAfterScanQRCode', params) // 相关方扫码
export const getDataDictionary = (params) => post('/app/dictionaries/getLevels', params) // 数据字典
export const setUploadAttachments = (params) => upload('/app/imgFiles/addSingleImg', params) // 上传附件
export const removeUploadAttachments = (params) => post('/app/imgFiles/deleteImg', params) // 删除附件
export const setRelatedPartyRegistration = (params) => post('/app/user/saveUser', params) // 相关方注册
export const setRelatedPartyUpdate = (params) => post('/app/user/editUser', params) // 相关方修改
export const checkRelatedUnitsPersonCount = (params) => post('/app/user/checkUserCountForApp', params) // 检查相关方单位流动人员数和单位总人数
export const getServiceUnitList = (params) => post('/app/user/getRelatedUnitsListByUserId', params) // 服务单位列表
export const getServiceUnitView = (params) => post('/app/user/getRelatedUnitsDetailById', params) // 服务单位查看
export const setFeedbackUpload = (params) => upload('/app/feedback/upload', params) //反馈问题附件
export const setFeedbackAdd = (params) => post('/app/feedback/add', params) //反馈问题提交
export const getVersion = (params) => post('/app/versionmanager/getVersion', params) // 版本更新
export const setUpdatePassword = (params) => post('/app/user/editUserPasswordByUserId', params) //修改密码
export const getUserInfo = (params) => post('/app/user/getDetailByUserIdAndCorpInfoId', params) //用户信息
export const setUserInfo = (params) => post('/app/user/edit', params) //修改用户信息
export const setEntry = (params) => post('/app/user/entry', params) //用户入职
export const getCertificateInformationList = (params) => post('/app/specialUser/list', params) //证书信息列表
export const getCertificateInformationView = (params) => post('/app/specialUser/goEdit', params) //证书信息查看
export const setCertificateInformationAdd = (params) => uploads('/app/specialUser/add', params) //证书信息添加
export const setCertificateInformationEdit = (params) => uploads('/app/specialUser/edit', params) //证书信息修改
export const setCertificateInformationEditPost = (params) => post('/app/specialUser/edit', params) //证书信息修改
export const getDeptTree = (params) => post('/api/department/listzTree', params) //用户信息
export const getEMPLOYMENTAPPLYMANAGEMENTID = (params) => post('/app/user/getEMPLOYMENTAPPLYMANAGEMENTID', params) //获取EMPLOYMENTAPPLYMANAGEMENTID
// 以下接口八项作业流程使用
export const getCorpInfoList = (params) => post("/app/util/getCorp", params) //获取公司列表
export const getConfinedSpaceSelectList = (params) => post("/app/csSpe/getSpace", params) //获取受限空间名称选择列表
export const getConfinedSpaceGasInfo = (params) => post("/app/csSpe/getGasInfo",params) //获取受限空间气体检测详情
export const setConfinedSpaceGasInfoSave = (params) => post("/app/csSpe/initGas", params) //受限空间气体检测详情保存
export const setConfinedSpaceGasDelete = (params) => post("/app/csSpe/deleteGas", params) //保存受限空间气体检测删除
export const getHotWorkGasAll = (params) => post("/app/elSpe/getAll", params) // 获取动火作业的所有受限空间气体检测数据
export const getHotWorkGasInfo = (params) => post("/app/elSpe/getInfo", params) //获取动火作业的受限空间气体检测详情
export const getHotWorkGasInfoSave = (params) => post("/app/elSpe/init", params) //获取动火作业的受限空间气体检测详情保存
export const getHotWorkGasDelete = (params) => post("/app/elSpe/delete", params) // 动火作业的受限空间气体检测删除
export const setHotWorkRecord = (params) => post("/app/deHw/initRecord", params) // 动火作业延迟监火保存记录
export const deleteHotWorkRecord = (params) => post("/app/deHw/deleteRecord", params) //获取动火作业的受限空间气体检测详情
export const getHotWorkRecord = (params) => post("/app/deHw/getRecords", params) //获取动火作业的受限空间气体检测详情保存
export const getOtherAssignmentsSelectList = (params) => post("/app/Task/getAllUnEndList", params) //关联的其他特殊作业及安全作业票编号选择列表
export const getRiskIdentificationResultsSelectList = (params) => post("/app/eightWork/getInfo", params) //风险辨识结果选择列表
export const getHotWorkMethodSelectList = (params) => post("/app/util/getDicList", params) // 动火方法选择列表
export const getQyDicList = (params) => post("/app/util/otherSysDic", params) // 动火方法选择列表
export const setTaskSave = (params) => post("/app/Task/init", params) //八项作业、隐患整改、安全环保检查任务保存更新接口
export const getCurrentNextOperation = (params) => post("/app/Task/getSupplementInfo", params) //获取当前任务的下一步操作
export const addFormInfo = (params) => post("/app/Task/addSupplementInfo", params) //审批过程中添加其他信息
export const getDepartmentTree = (params) => post("/app/util/getDepartmentTree", params) //获取部门树
export const getUserList = (params) => post("/app/util/getUserList", params) //获取人员
export const getToDoTaskList = (params) => post("/app/Task/getAllList", params) //获取待办列表
export const getTaskTechnologicalProcess = (params) => post("/app/Task/getAgencyList", params) //获取流程
export const getTaskInfo = (params) => post("/app/Task/getInfo", params) //查看信息
export const setTaskFile = (params) => upload("/app/util/uploadFile", params) //上传文件
export const setTaskSign = (params) => post("/app/Task/sign", params) //审批意见签字提交
export const setSecurityMeasuresSave = (params) => post("/app/Task/setQues", params) //安全措施提交
export const setOtherSecurityMeasuresSave = (params) => post("/app/Task/setOtherQues", params) //其它安全措施提交
export const getHistoricalApprovalRecords = (params) => post("/app/Task/getHis", params); // 历史审批记录
export const getCorpInfoList = (params) => post('/app/util/getCorp', params) //获取公司列表
export const getConfinedSpaceSelectList = (params) => post('/app/csSpe/getSpace', params) //获取受限空间名称选择列表
export const getConfinedSpaceGasInfo = (params) => post('/app/csSpe/getGasInfo', params) //获取受限空间气体检测详情
export const setConfinedSpaceGasInfoSave = (params) => post('/app/csSpe/initGas', params) //受限空间气体检测详情保存
export const setConfinedSpaceGasDelete = (params) => post('/app/csSpe/deleteGas', params) //保存受限空间气体检测删除
export const getHotWorkGasAll = (params) => post('/app/elSpe/getAll', params) // 获取动火作业的所有受限空间气体检测数据
export const getHotWorkGasInfo = (params) => post('/app/elSpe/getInfo', params) //获取动火作业的受限空间气体检测详情
export const getHotWorkGasInfoSave = (params) => post('/app/elSpe/init', params) //获取动火作业的受限空间气体检测详情保存
export const getHotWorkGasDelete = (params) => post('/app/elSpe/delete', params) // 动火作业的受限空间气体检测删除
export const setHotWorkRecord = (params) => post('/app/deHw/initRecord', params) // 动火作业延迟监火保存记录
export const deleteHotWorkRecord = (params) => post('/app/deHw/deleteRecord', params) //获取动火作业的受限空间气体检测详情
export const getHotWorkRecord = (params) => post('/app/deHw/getRecords', params) //获取动火作业的受限空间气体检测详情保存
export const getOtherAssignmentsSelectList = (params) => post('/app/Task/getAllUnEndList', params) //关联的其他特殊作业及安全作业票编号选择列表
export const getRiskIdentificationResultsSelectList = (params) => post('/app/eightWork/getInfo', params) //风险辨识结果选择列表
export const getHotWorkMethodSelectList = (params) => post('/app/util/getDicList', params) // 动火方法选择列表
export const getQyDicList = (params) => post('/app/util/otherSysDic', params) // 动火方法选择列表
export const setTaskSave = (params) => post('/app/Task/init', params) //八项作业、隐患整改、安全环保检查任务保存更新接口
export const getCurrentNextOperation = (params) => post('/app/Task/getSupplementInfo', params) //获取当前任务的下一步操作
export const addFormInfo = (params) => post('/app/Task/addSupplementInfo', params) //审批过程中添加其他信息
export const getDepartmentTree = (params) => post('/app/util/getDepartmentTree', params) //获取部门树
export const getUserList = (params) => post('/app/util/getUserList', params) //获取人员
export const getToDoTaskList = (params) => post('/app/Task/getAllList', params) //获取待办列表
export const getTaskTechnologicalProcess = (params) => post('/app/Task/getAgencyList', params) //获取流程
export const getTaskInfo = (params) => post('/app/Task/getInfo', params) //查看信息
export const setTaskFile = (params) => upload('/app/util/uploadFile', params) //上传文件
export const setTaskSign = (params) => post('/app/Task/sign', params) //审批意见签字提交
export const setSecurityMeasuresSave = (params) => post('/app/Task/setQues', params) //安全措施提交
export const setOtherSecurityMeasuresSave = (params) => post('/app/Task/setOtherQues', params) //其它安全措施提交
export const getHistoricalApprovalRecords = (params) => post('/app/Task/getHis', params) // 历史审批记录
// 结束
// ****************************************************
// ************* 以下接口培训管理流程使用 ***************
// ********************* start ***********************
export const getIsUploadFace = (params) => post("/app/user/getUserFace", params); // 获取是否上传人脸信息
export const getClassList = (params) => post("/app/stagestudentrelation/pageTaskByUser", params); //获取班级列表
export const joinClass = (params) => uploads("/app/student/joinClass", params); // 实名认证信息提交
export const getIsUploadFace = (params) => post('/app/user/getUserFace', params) // 获取是否上传人脸信息
export const getClassList = (params) => post('/app/stagestudentrelation/pageTaskByUser', params) //获取班级列表
export const joinClass = (params) => uploads('/app/student/joinClass', params) // 实名认证信息提交
export const getTaskScoreInfo = (params) => post('/app/stageexam/findResult', params) // 考试成绩详情
export const getExamExercises = (params) => post('/app/stageexam/getExam', params) // 考试习题
export const setTestPaperSubmission = (params) => post('/app/stageexam/submit', params) // 考试交卷
// ********************* end ***********************

View File

@ -1,463 +1,477 @@
<template>
<view class="content">
<view class="top">
<view class="time">
<text style="margin-right: 14rpx;" class="iconfont">&#xed63;</text>
<text>倒计时</text>
<u-count-down :time="info.ANSWERSHEETTIME * 60 * 1000" format="mm 分 ss 秒" auto-start millisecond @finish="fnCountDownFinish" />
</view>
</view>
<view class="content">
<view class="top">
<view class="time">
<text style="margin-right: 14rpx" class="iconfont">&#xed63;</text>
<text>倒计时</text>
<u-count-down :time="info.ANSWERSHEETTIME * 60 * 1000" format="mm 分 ss 秒" auto-start millisecond @finish="fnCountDownFinish" />
</view>
</view>
<view class="topic">
<view class="title">
<text>
<text class="tag_title">
{{ handleCalcQuestType(options[current].QUESTIONTYPE) }}
</text>
{{ current + 1 }}.{{ options[current].QUESTIONDRY }}
</text>
</view>
<view v-show="options[current].QUESTIONTYPE === '1'" class="options">
<view class="item" :class="{ active: options[current].checked === 'A' }" @click="fnChooseTopic('radio', 'A')">
<text class="option">A</text>
<text class="text">{{ options[current].OPTIONA }}</text>
</view>
<view class="item" :class="{ active: options[current].checked === 'B' }" @click="fnChooseTopic('radio', 'B')">
<text class="option">B</text>
<text class="text">{{ options[current].OPTIONB }}</text>
</view>
<view class="item" :class="{ active: options[current].checked === 'C' }" @click="fnChooseTopic('radio', 'C')">
<text class="option">C</text>
<text class="text">{{ options[current].OPTIONC }}</text>
</view>
<view class="item" :class="{ active: options[current].checked === 'D' }" @click="fnChooseTopic('radio', 'D')">
<text class="option">D</text>
<text class="text">{{ options[current].OPTIOND }}</text>
</view>
</view>
<view v-show="options[current].QUESTIONTYPE === '2'" class="options">
<view class="item" :class="{
active:
options[current].checked &&
options[current].checked.indexOf('A') !== -1,
}" @click="fnChooseTopic('multiple', 'A')">
<text class="option">A</text>
<text class="text">{{ options[current].OPTIONA }}</text>
</view>
<view class="item" :class="{
active:
options[current].checked &&
options[current].checked.indexOf('B') !== -1,
}" @click="fnChooseTopic('multiple', 'B')">
<text class="option">B</text>
<text class="text">{{ options[current].OPTIONB }}</text>
</view>
<view class="item" :class="{
active:
options[current].checked &&
options[current].checked.indexOf('C') !== -1,
}" @click="fnChooseTopic('multiple', 'C')">
<text class="option">C</text>
<text class="text">{{ options[current].OPTIONC }}</text>
</view>
<view class="item" :class="{
active:
options[current].checked &&
options[current].checked.indexOf('D') !== -1,
}" @click="fnChooseTopic('multiple', 'D')">
<text class="option">D</text>
<text class="text">{{ options[current].OPTIOND }}</text>
</view>
</view>
<view v-show="options[current].QUESTIONTYPE === '3'" class="options">
<view class="item" :class="{ active: options[current].checked === 'A' }" @click="fnChooseTopic('judge', 'A')">
<text class="option">{{ options[current].OPTIONA }}</text>
<text class="text"></text>
</view>
<view class="item" :class="{ active: options[current].checked === 'B' }" @click="fnChooseTopic('judge', 'B')">
<text class="option">{{ options[current].OPTIONB }}</text>
<text class="text"></text>
</view>
</view>
<view v-show="options[current].QUESTIONTYPE === '4'" class="options">
<view class="item">
<u-textarea v-model="options[current].checked" auto-height count />
</view>
</view>
</view>
<view class="footer">
<u-button v-show="current !== 0" :style="{ width: '45%' }" text="上一题" @click="fnPreviousQuestion" />
<u-button v-show="current !== options.length - 1" type="primary"
:style="{ width: current === 0 ? '100%' : '45%' }" text="下一题" @click="fnNextQuestion" />
<u-button v-show="current === options.length - 1" type="primary" :style="{ width: '45%' }" text="交卷"
@click="fnHandInThePaper" />
</view>
</view>
<view class="topic">
<view class="title">
<text>
<text class="tag_title">
{{ handleCalcQuestType(options[current].QUESTIONTYPE) }}
</text>
{{ current + 1 }}.{{ options[current].QUESTIONDRY }}
</text>
</view>
<view v-show="options[current].QUESTIONTYPE === '1'" class="options">
<view class="item" :class="{ active: options[current].checked === 'A' }" @click="fnChooseTopic('radio', 'A')">
<text class="option">A</text>
<text class="text">{{ options[current].OPTIONA }}</text>
</view>
<view class="item" :class="{ active: options[current].checked === 'B' }" @click="fnChooseTopic('radio', 'B')">
<text class="option">B</text>
<text class="text">{{ options[current].OPTIONB }}</text>
</view>
<view class="item" :class="{ active: options[current].checked === 'C' }" @click="fnChooseTopic('radio', 'C')">
<text class="option">C</text>
<text class="text">{{ options[current].OPTIONC }}</text>
</view>
<view class="item" :class="{ active: options[current].checked === 'D' }" @click="fnChooseTopic('radio', 'D')">
<text class="option">D</text>
<text class="text">{{ options[current].OPTIOND }}</text>
</view>
</view>
<view v-show="options[current].QUESTIONTYPE === '2'" class="options">
<view
class="item"
:class="{
active: options[current].checked && options[current].checked.indexOf('A') !== -1
}"
@click="fnChooseTopic('multiple', 'A')"
>
<text class="option">A</text>
<text class="text">{{ options[current].OPTIONA }}</text>
</view>
<view
class="item"
:class="{
active: options[current].checked && options[current].checked.indexOf('B') !== -1
}"
@click="fnChooseTopic('multiple', 'B')"
>
<text class="option">B</text>
<text class="text">{{ options[current].OPTIONB }}</text>
</view>
<view
class="item"
:class="{
active: options[current].checked && options[current].checked.indexOf('C') !== -1
}"
@click="fnChooseTopic('multiple', 'C')"
>
<text class="option">C</text>
<text class="text">{{ options[current].OPTIONC }}</text>
</view>
<view
class="item"
:class="{
active: options[current].checked && options[current].checked.indexOf('D') !== -1
}"
@click="fnChooseTopic('multiple', 'D')"
>
<text class="option">D</text>
<text class="text">{{ options[current].OPTIOND }}</text>
</view>
</view>
<view v-show="options[current].QUESTIONTYPE === '3'" class="options">
<view class="item" :class="{ active: options[current].checked === 'A' }" @click="fnChooseTopic('judge', 'A')">
<text class="option">{{ options[current].OPTIONA }}</text>
<text class="text"></text>
</view>
<view class="item" :class="{ active: options[current].checked === 'B' }" @click="fnChooseTopic('judge', 'B')">
<text class="option">{{ options[current].OPTIONB }}</text>
<text class="text"></text>
</view>
</view>
<view v-show="options[current].QUESTIONTYPE === '4'" class="options">
<view class="item">
<u-textarea v-model="options[current].checked" auto-height count />
</view>
</view>
</view>
<view class="footer">
<u-button v-show="current !== 0" :style="{ width: '45%' }" text="上一题" @click="fnPreviousQuestion" />
<u-button v-show="current !== options.length - 1" type="primary" :style="{ width: current === 0 ? '100%' : '45%' }" text="下一题" @click="fnNextQuestion" />
<u-button v-show="current === options.length - 1" type="primary" :style="{ width: '45%' }" text="交卷" @click="fnHandInThePaper" />
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
// import {
// getExamExercises,
// getStrengthenExam,
// setTestPaperSubmission,
// } from "@/api";
import {
getExamExercises,
// getStrengthenExam,
setTestPaperSubmission,
} from '../../api'
export default {
data() {
return {
STAGEEXAMPAPERINPUT_ID: "",
STAGEEXAMPAPER_ID: "",
CLASS_ID: "",
POST_ID: "",
STUDENT_ID: "",
NUMBEROFEXAMS: "",
entrySite: "",
info: {},
options: [{}],
current: 0,
questionTypeMap: {
1: '单选',
2: '多选',
3: '判断',
4: '填空',
}
};
},
onLoad(query) {
// this.STAGEEXAMPAPERINPUT_ID = query.STAGEEXAMPAPERINPUT_ID;
// this.STAGEEXAMPAPER_ID = query.STAGEEXAMPAPER_ID;
// this.CLASS_ID = query.CLASS_ID;
// this.POST_ID = query.POST_ID;
// this.STUDENT_ID = query.STUDENT_ID;
// this.NUMBEROFEXAMS = query.NUMBEROFEXAMS;
// this.entrySite = query.entrySite;
this.fnGetData();
},
onBackPress(event) {
if (event.from === "backbutton") {
uni.$u.toast("考试过程中不允许退出");
return true;
}
return false;
},
computed: {
userInfo() {
return this.$store.getters.getUserInfo;
},
},
methods: {
async fnGetData() {
let resData = {};
// if (this.entrySite === "strengththen") {
// resData = await getStrengthenExam({
// STRENGTHEN_STAGEEXAMPAPER_INPUT_ID: this.STAGEEXAMPAPERINPUT_ID,
// CLASS_ID: this.CLASS_ID,
// POST_ID: this.POST_ID,
// STUDENT_ID: this.STUDENT_ID,
// NUMBEROFEXAMS: this.NUMBEROFEXAMS,
// });
// } else {
// resData = await getExamExercises({
// STAGEEXAMPAPERINPUT_ID: this.STAGEEXAMPAPERINPUT_ID,
// STAGEEXAMPAPER_ID: this.STAGEEXAMPAPER_ID,
// CLASS_ID: this.CLASS_ID,
// POST_ID: this.POST_ID,
// STUDENT_ID: this.STUDENT_ID,
// NUMBEROFEXAMS: this.NUMBEROFEXAMS,
// });
// }
data() {
return {
// STAGEEXAMPAPERINPUT_ID: '',
// STAGEEXAMPAPER_ID: '',
// CLASS_ID: '',
// POST_ID: '',
// STUDENT_ID: '',
// NUMBEROFEXAMS: '',
routeQuery: {},
entrySite: '',
info: {},
options: [{}],
current: 0,
questionTypeMap: {
1: '单选',
2: '多选',
3: '判断',
4: '填空'
}
}
},
onLoad(query) {
console.log('query :>> ', query);
this.routeQuery = query
// this.STAGEEXAMPAPER_ID = query.STAGEEXAMPAPER_ID;
// this.entrySite = query.entrySite;
this.fnGetData()
},
onBackPress(event) {
if (event.from === 'backbutton') {
uni.$u.toast('考试过程中不允许退出')
return true
}
return false
},
computed: {
userInfo() {
return this.$store.getters.getUserInfo
}
},
methods: {
async fnGetData() {
const { stageexampaperinputId, classId, postId, studentId, numberofexams } = this.routeQuery
const resData = await getExamExercises({
STAGEEXAMPAPERINPUT_ID: stageexampaperinputId,
// STAGEEXAMPAPER_ID: this.STAGEEXAMPAPER_ID,
CLASS_ID: classId,
POST_ID: postId,
STUDENT_ID: studentId,
NUMBEROFEXAMS: numberofexams
})
// if (this.entrySite === "strengththen") {
// resData = await getStrengthenExam({
// STRENGTHEN_STAGEEXAMPAPER_INPUT_ID: this.STAGEEXAMPAPERINPUT_ID,
// CLASS_ID: this.CLASS_ID,
// POST_ID: this.POST_ID,
// STUDENT_ID: this.STUDENT_ID,
// NUMBEROFEXAMS: this.NUMBEROFEXAMS,
// });
// } else {
// resData = await getExamExercises({
// STAGEEXAMPAPERINPUT_ID: this.STAGEEXAMPAPERINPUT_ID,
// STAGEEXAMPAPER_ID: this.STAGEEXAMPAPER_ID,
// CLASS_ID: this.CLASS_ID,
// POST_ID: this.POST_ID,
// STUDENT_ID: this.STUDENT_ID,
// NUMBEROFEXAMS: this.NUMBEROFEXAMS,
// });
// }
// this.info = resData.pd;
this.info = { ...this.info, ANSWERSHEETTIME: 30 }
this.options = [
{
QUESTIONDRY: "题干题干题干题干题干1 ( ) .",
QUESTIONTYPE: "1",
OPTIONA: '这是选项A',
OPTIONB: '这是选项B',
OPTIONC: '这是选项C',
OPTIOND: '这是选项D',
},
{
QUESTIONDRY: "题干题干题干题干题干2 ()",
QUESTIONTYPE: "2",
OPTIONA: '这是选项A',
OPTIONB: '这是选项B',
OPTIONC: '这是选项C',
OPTIOND: '这是选项D',
},
{
QUESTIONDRY: "未带安全头盔可正常进入堆场进行工业,以上说法是否正确?",
QUESTIONTYPE: "3",
OPTIONA: '对',
OPTIONB: '错',
},
{
QUESTIONDRY: "当进入施工现场后, 应立刻对_____设施做全面检查?",
QUESTIONTYPE: "4",
OPTIONA: '对',
OPTIONB: '错',
},
];
// if (resData.NUMBEROFEXAMS > 0) {
// uni.showModal({
// title: "",
// content: `${resData.NUMBEROFEXAMS}`,
// showCancel: false,
// });
// } else if (resData.NUMBEROFEXAMS === "-9999") {
// uni.showModal({
// title: "",
// content: `60`,
// showCancel: false,
// });
// } else {
// uni.showModal({
// title: "",
// content: ``,
// showCancel: false,
// success: (res) => {
// if (res.confirm) {
// uni.navigateBack();
// }
// },
// });
// }
},
fnChooseTopic(type, checked) {
if (!this.options[this.current].checked) {
this.$set(this.options[this.current], "checked", "");
}
if (type === "judge" || type === "radio") {
if (this.options[this.current].checked === checked) {
this.options[this.current].checked = "";
} else {
this.options[this.current].checked = checked;
}
}
if (type === "multiple") {
if (this.options[this.current].checked) {
const checkedArr = this.options[this.current].checked.split(",");
if (checkedArr.indexOf(checked) !== -1) {
checkedArr.splice(checkedArr.indexOf(checked), 1);
this.options[this.current].checked = checkedArr.join(",");
} else {
checkedArr.push(checked);
checkedArr.sort();
this.options[this.current].checked = checkedArr.join(",");
}
} else {
this.options[this.current].checked = checked;
}
}
},
handleCalcQuestType(type) {
return `(${this.questionTypeMap[type]})`
},
fnIsFinish() {
if (!this.options[this.current].checked) {
uni.showModal({
title: "温馨提示",
content: "请对本题进行作答。",
showCancel: false,
});
return false;
}
return true;
},
/**
* 下一题按钮点击事件
*/
fnNextQuestion() {
if (!this.fnIsFinish()) return;
this.current++;
},
/**
* 上一题按钮点击事件
*/
fnPreviousQuestion() {
this.current--;
},
/**
* 交卷按钮点击事件
*/
fnHandInThePaper() {
if (!this.fnIsFinish()) return;
uni.showModal({
title: "温馨提示",
content: `题目已全部做完,确认交卷吗?`,
success: (res) => {
if (res.confirm) {
this.fnSubmit();
}
}
});
},
fnCountDownFinish() {
uni.$u.toast("考试时间已结束");
for (let i = 0; i < this.options.length; i++) {
if (!this.options[i].checked) {
this.options[i].checked = "";
}
}
this.fnSubmit();
},
async fnSubmit() {
uni.navigateBack({ delta: 2 });
// for (let i = 0; i < this.options.length; i++) {
// if (this.options[i].QUESTIONTYPE === "2") {
// this.options[i].checked = this.options[i].checked.replace(/,/g, "");
// }
// }
// const resData = await setTestPaperSubmission({
// USERNAME: this.userInfo.NAME,
// entrySite: this.entrySite,
// STAGEEXAMPAPERINPUT_ID: this.STAGEEXAMPAPERINPUT_ID,
// CLASS_ID: this.CLASS_ID,
// STUDENT_ID: this.STUDENT_ID,
// NUMBEROFEXAMS: this.NUMBEROFEXAMS,
// PASSSCORE: this.info.PASSSCORE,
// EXAMSCORE: this.info.EXAMSCORE,
// EXAMTIMEBEGIN: this.info.EXAMTIMEBEGIN,
// options: JSON.stringify(this.options),
// });
// if (resData.examResult === "0") {
// uni.showModal({
// title: "",
// content: `${resData.examScore}`,
// showCancel: false,
// success: (res) => {
// if (res.confirm) {
// if (this.entrySite === "video_study")
// uni.navigateBack({ delta: 3 });
// else uni.navigateBack();
// }
// },
// });
// } else {
// uni.showModal({
// title: "",
// content: `${resData.examScore}`,
// showCancel: false,
// success: (res) => {
// if (res.confirm) {
// if (this.entrySite === "video_study")
// uni.navigateBack({ delta: 3 });
// else if (this.entrySite === "strengththen")
// uni.navigateBack({ delta: 2 });
// else uni.navigateBack();
// }
// },
// });
// }
},
},
};
// this.info = resData.pd;
this.info = { ...this.info, ANSWERSHEETTIME: 30 }
this.options = [
{
QUESTIONDRY: '题干题干题干题干题干1 ( ) .',
QUESTIONTYPE: '1',
OPTIONA: '这是选项A',
OPTIONB: '这是选项B',
OPTIONC: '这是选项C',
OPTIOND: '这是选项D'
},
{
QUESTIONDRY: '题干题干题干题干题干2 ()',
QUESTIONTYPE: '2',
OPTIONA: '这是选项A',
OPTIONB: '这是选项B',
OPTIONC: '这是选项C',
OPTIOND: '这是选项D'
},
{
QUESTIONDRY: '未带安全头盔可正常进入堆场进行工业,以上说法是否正确?',
QUESTIONTYPE: '3',
OPTIONA: '对',
OPTIONB: '错'
},
{
QUESTIONDRY: '当进入施工现场后, 应立刻对_____设施做全面检查?',
QUESTIONTYPE: '4',
OPTIONA: '对',
OPTIONB: '错'
}
]
// if (resData.NUMBEROFEXAMS > 0) {
// uni.showModal({
// title: "",
// content: `${resData.NUMBEROFEXAMS}`,
// showCancel: false,
// });
// } else if (resData.NUMBEROFEXAMS === "-9999") {
// uni.showModal({
// title: "",
// content: `60`,
// showCancel: false,
// });
// } else {
// uni.showModal({
// title: "",
// content: ``,
// showCancel: false,
// success: (res) => {
// if (res.confirm) {
// uni.navigateBack();
// }
// },
// });
// }
},
fnChooseTopic(type, checked) {
if (!this.options[this.current].checked) {
this.$set(this.options[this.current], 'checked', '')
}
if (type === 'judge' || type === 'radio') {
if (this.options[this.current].checked === checked) {
this.options[this.current].checked = ''
} else {
this.options[this.current].checked = checked
}
}
if (type === 'multiple') {
if (this.options[this.current].checked) {
const checkedArr = this.options[this.current].checked.split(',')
if (checkedArr.indexOf(checked) !== -1) {
checkedArr.splice(checkedArr.indexOf(checked), 1)
this.options[this.current].checked = checkedArr.join(',')
} else {
checkedArr.push(checked)
checkedArr.sort()
this.options[this.current].checked = checkedArr.join(',')
}
} else {
this.options[this.current].checked = checked
}
}
},
handleCalcQuestType(type) {
return `(${this.questionTypeMap[type]})`
},
fnIsFinish() {
if (!this.options[this.current].checked) {
uni.showModal({
title: '温馨提示',
content: '请对本题进行作答。',
showCancel: false
})
return false
}
return true
},
/**
* 下一题按钮点击事件
*/
fnNextQuestion() {
if (!this.fnIsFinish()) return
this.current++
},
/**
* 上一题按钮点击事件
*/
fnPreviousQuestion() {
this.current--
},
/**
* 交卷按钮点击事件
*/
fnHandInThePaper() {
if (!this.fnIsFinish()) return
uni.showModal({
title: '温馨提示',
content: `题目已全部做完,确认交卷吗?`,
success: (res) => {
if (res.confirm) {
this.fnSubmit()
}
}
})
},
fnCountDownFinish() {
uni.$u.toast('考试时间已结束')
for (let i = 0; i < this.options.length; i++) {
if (!this.options[i].checked) {
this.options[i].checked = ''
}
}
this.fnSubmit()
},
async fnSubmit() {
// uni.navigateBack({ delta: 2 })
for (let i = 0; i < this.options.length; i++) {
if (this.options[i].QUESTIONTYPE === "2") {
this.options[i].checked = this.options[i].checked.replace(/,/g, "");
}
}
const resData = await setTestPaperSubmission({
USERNAME: this.userInfo.NAME,
entrySite: this.entrySite,
STAGEEXAMPAPERINPUT_ID: this.STAGEEXAMPAPERINPUT_ID,
CLASS_ID: this.CLASS_ID,
STUDENT_ID: this.STUDENT_ID,
NUMBEROFEXAMS: this.NUMBEROFEXAMS,
PASSSCORE: this.info.PASSSCORE,
EXAMSCORE: this.info.EXAMSCORE,
EXAMTIMEBEGIN: this.info.EXAMTIMEBEGIN,
options: JSON.stringify(this.options),
});
if (resData.examResult === "0") {
uni.showModal({
title: "温馨提示",
content: `您的成绩为${resData.examScore}分,很遗憾您没有通过本次考试,请再接再厉!`,
showCancel: false,
success: (res) => {
if (res.confirm) {
if (this.entrySite === "video_study")
uni.navigateBack({ delta: 3 });
else uni.navigateBack();
}
},
});
} else {
uni.showModal({
title: "温馨提示",
content: `您的成绩为${resData.examScore}分,恭喜您通过本次考试,请继续保持!`,
showCancel: false,
success: (res) => {
if (res.confirm) {
if (this.entrySite === "video_study")
uni.navigateBack({ delta: 3 });
else if (this.entrySite === "strengththen")
uni.navigateBack({ delta: 2 });
else uni.navigateBack();
}
},
});
}
}
}
}
</script>
<style scoped lang="scss">
@import '/static/fonts/iconfont_timer.css';
.content {
.top {
padding: 17rpx;
.time {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
color: #363636;
font-size: 28rpx;
.top {
padding: 17rpx;
.time {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
color: #363636;
font-size: 28rpx;
::v-deep {
.u-count-down__text {
display: inline;
color: #363636;
font-size: 28rpx;
line-height: normal;
}
}
}
}
::v-deep {
.u-count-down__text {
display: inline;
color: #363636;
font-size: 28rpx;
line-height: normal;
}
}
}
}
.topic {
margin: 20rpx;
padding: 20rpx 20rpx 150rpx;
box-sizing: border-box;
.topic {
margin: 20rpx;
padding: 20rpx 20rpx 150rpx;
box-sizing: border-box;
.title {
font-size: 32rpx;
font-weight: 600;
.title {
font-size: 32rpx;
font-weight: 600;
.question-type {
border-radius: 40rpx;
padding: 4rpx 14rpx;
border: 1rpx solid #3c9cff;
font-size: 24rpx;
color: #3c9cff;
}
.question-type {
border-radius: 40rpx;
padding: 4rpx 14rpx;
border: 1rpx solid #3c9cff;
font-size: 24rpx;
color: #3c9cff;
}
.tag_title {
font-size: 28rpx;
background-color: #b3b3b3;
color: #FFF;
border-radius: 8rpx;
padding: 2rpx 10rpx;
margin-right: 10rpx;
}
}
.tag_title {
font-size: 28rpx;
background-color: #b3b3b3;
color: #fff;
border-radius: 8rpx;
padding: 2rpx 10rpx;
margin-right: 10rpx;
}
}
.options {
margin-top: 40rpx;
.options {
margin-top: 40rpx;
.item {
position: relative;
margin-top: 40rpx;
color: #696868;
.item {
position: relative;
margin-top: 40rpx;
color: #696868;
&.active {
color: #3c9cff;
&.active {
color: #3c9cff;
.option {
background-color: #3c9cff;
color: #fff;
}
}
.option {
background-color: #3c9cff;
color: #fff;
}
}
.option {
background-color: #eee;
border-radius: 80rpx;
width: 65rpx;
height: 65rpx;
line-height: 65rpx;
text-align: center;
font-size: 30rpx;
display: inline-block;
}
.option {
background-color: #eee;
border-radius: 80rpx;
width: 65rpx;
height: 65rpx;
line-height: 65rpx;
text-align: center;
font-size: 30rpx;
display: inline-block;
}
.text {
margin-left: 30rpx;
height: 60rpx;
line-height: 60rpx;
}
}
}
}
.text {
margin-left: 30rpx;
height: 60rpx;
line-height: 60rpx;
}
}
}
}
.footer {
display: flex;
position: fixed;
bottom: 0;
justify-content: space-between;
width: 100%;
left: 0;
padding: 20rpx;
box-sizing: border-box;
background: #fff;
.footer {
display: flex;
position: fixed;
bottom: 0;
justify-content: space-between;
width: 100%;
left: 0;
padding: 20rpx;
box-sizing: border-box;
background: #fff;
button {
border-radius: 10rpx;
}
}
button {
border-radius: 10rpx;
}
}
}
</style>

View File

@ -92,6 +92,8 @@
</template>
<script>
import { getTaskScoreInfo } from "../../api";
export default {
data() {
return {
@ -99,8 +101,7 @@ export default {
currentPage: 1,
totalPage: 0,
questionList: [],
//
current: 0,
current: 0, //
questionTypeMap: {
1: '单选题',
2: '多选题',
@ -111,14 +112,20 @@ export default {
}
},
onShow() {
this.resetList()
onLoad(query) {
const { stagestudentrelationId, classId } = query
this.getData(stagestudentrelationId, classId)
},
mounted() {},
methods: {
async getData() {
async getData(stagestudentrelationId, classId) {
// const resData = await getTaskScoreInfo({
// stagestudentrelationId,
// classId
// })
// console.log('resData :>> ', resData);
this.questionList = [
{
stageexamrecordId: '7cea826c3c974cb69028dd0624b632ba',

View File

@ -45,8 +45,8 @@ export default {
isFirst: "", // 是否为第一次开启摄像头
type: "", // 摄像头使用类别
// showButton: "yes",
params: {}, // 额外携带的参数
btnTextStr: "拍照"
routeQueryparams: {}, // 额外携带的参数
btnTextStr: "拍照"
};
},
onReady() {
@ -71,7 +71,7 @@ export default {
if (query.type === "learning_certification") this.btnTextStr = "开始考试";
this.type = query.type;
// this.showButton = query.showButton || "yes";
this.params = query.params ? JSON.parse(query.params) : {};
this.routeQueryparams = query ?? {};
},
onBackPress(event) {
if (event.from === "backbutton") {
@ -111,17 +111,19 @@ export default {
src: imgPath,
dst: imgPath,
overwrite: true,
quality: 40,
quality: 40
},
(zipRes) => {
setTimeout(() => {
const reader = new plus.io.FileReader();
reader.onloadend = async (res) => {
const speech = res.target.result;
// 获取 base 64 图片编码的前缀
const USERAVATARPREFIX = speech.substring(
0,
speech.indexOf("base64,") + 7,
);
// 获取 base 64 图片的二进制到文本
const USERAVATARURL = speech.substring(
speech.indexOf("base64,") + 7,
);
@ -146,9 +148,10 @@ export default {
// await this.$store.dispatch("setVerification", true);
uni.$u.toast("认证成功");
// uni.navigateBack();
uni.$u.route({
url: '/pages/train_management/course_exam'
})
uni.$u.route({
url: '/pages/train_management/course_exam',
params: { ...this.routeQueryparams }
})
}
} catch (e) {
if(e && e.msg){

View File

@ -31,7 +31,7 @@
<view> <text class="content_label">任务状态: </text>{{ handleCalcTaskStatus(item.state) }} </view>
<view class="action-row">
<u-button size="mini" type="primary" text="签到信息" :disabled="item.userSignPath === '0'" @click="signInInformation(item.classId)" />
<u-button size="mini" type="primary" text="考试记录" :disabled="item.stageexamstate === '1' || item.stageexamstate === '4'" @click="ExamRecord(item.classId)" />
<u-button size="mini" type="primary" text="考试记录" :disabled="item.stageexamstate === '1' || item.stageexamstate === '4'" @click="ExamRecord(item)" />
</view>
</view>
</view>
@ -45,7 +45,7 @@
</template>
<script>
import { getClassList } from '../../api'
import { getClassList, getIsUploadFace } from '../../api'
export default {
data() {
@ -69,8 +69,7 @@ export default {
},
async onLoad(query) {
console.log('页面加载完成 :>> ', query)
// await this.getUserFaceCompleted()
await this.getUserFaceCompleted()
},
methods: {
@ -99,17 +98,17 @@ export default {
//
uni.scanCode({
// scanType: ['qrCode'], //
onlyFromCamera: false, //
hideAlbum: false, // ,,
onlyFromCamera: false, //
hideAlbum: false, // ,
success: function (response) {
const { id, type } = JSON.parse(response.result);
const { stageexampaperinputId, classId, postId, studentId, numberofexams, type } = JSON.parse(response.result)
if (type === '0') {
//
uni.$u.route({
url: '/pages/train_management/realname_info_auth',
params: {
type: 'scan_face',
classId: id
classId
}
})
} else if (type === '1') {
@ -118,7 +117,11 @@ export default {
url: '/pages/train_management/face_authentication',
params: {
type: 'learning_certification',
classId: id
stageexampaperinputId,
classId,
postId,
studentId,
numberofexams
}
})
}
@ -134,28 +137,29 @@ export default {
/**
* 获取是否已经完成上传人脸信息
*/
// async getUserFaceCompleted() {
// const userFaceData = await getIsUploadFace()
// console.log('userFaceData :>> ', userFaceData)
// if (!userFaceData?.data) {
// uni.showModal({
// title: '',
// content: '!',
// success: function (res) {
// if (res.confirm) {
// uni.$u.route({
// url: '/pages/train_management/face_authentication',
// params: {
// type: 'facial_input'
// }
// })
// } else if (res.cancel) {
// uni.navigateBack({ delta: 1 });
// }
// }
// })
// }
// },
async getUserFaceCompleted() {
const userFaceData = await getIsUploadFace()
console.log('userFaceData :>> ', userFaceData)
if (!userFaceData?.data) {
uni.showModal({
title: '温馨提示',
content: '检测到您还未完成人脸信息读取,请先完成人脸信息认证!',
success: function (res) {
if (res.confirm) {
uni.$u.route({
url: '/pages/train_management/face_authentication',
params: {
type: 'facial_input'
}
})
}
if (res.cancel) {
uni.navigateBack({ delta: 1 })
}
}
})
}
},
handleCalcTaskStatus(type) {
return this.taskStatusMap[type]
},
@ -173,11 +177,13 @@ export default {
/**
* 考试记录
*/
ExamRecord(classId) {
ExamRecord(record) {
const { stagestudentrelationId, classId } = record
uni.$u.route({
url: '/pages/train_management/exam_record',
params: {
classId
classId,
stagestudentrelationId
}
})
}

View File

@ -1,4 +1,5 @@
let requestPath = 'https://qggf.qhdsafety.com/xgfApi/'; // 后台请求地址
// let requestPath = 'https://qggf.qhdsafety.com/xgfApi/'; // 后台请求地址
let requestPath = 'http://192.168.0.37:8058/xgf_gwj'; // 后台请求地址
// let requestPath = 'https://skqhdg.porthebei.com:9006/qa-prevention-xgf/'; // 后台请求地址
// let requestPath = 'https://qgxgf.qhdsafety.com/qa-prevention-xgf/'; // 外网地址
import store from '../store/index'