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

View File

@ -2,7 +2,7 @@
<view class="content"> <view class="content">
<view class="top"> <view class="top">
<view class="time"> <view class="time">
<text style="margin-right: 14rpx;" class="iconfont">&#xed63;</text> <text style="margin-right: 14rpx" class="iconfont">&#xed63;</text>
<text>倒计时</text> <text>倒计时</text>
<u-count-down :time="info.ANSWERSHEETTIME * 60 * 1000" format="mm 分 ss 秒" auto-start millisecond @finish="fnCountDownFinish" /> <u-count-down :time="info.ANSWERSHEETTIME * 60 * 1000" format="mm 分 ss 秒" auto-start millisecond @finish="fnCountDownFinish" />
</view> </view>
@ -36,35 +36,43 @@
</view> </view>
</view> </view>
<view v-show="options[current].QUESTIONTYPE === '2'" class="options"> <view v-show="options[current].QUESTIONTYPE === '2'" class="options">
<view class="item" :class="{ <view
active: class="item"
options[current].checked && :class="{
options[current].checked.indexOf('A') !== -1, active: options[current].checked && options[current].checked.indexOf('A') !== -1
}" @click="fnChooseTopic('multiple', 'A')"> }"
@click="fnChooseTopic('multiple', 'A')"
>
<text class="option">A</text> <text class="option">A</text>
<text class="text">{{ options[current].OPTIONA }}</text> <text class="text">{{ options[current].OPTIONA }}</text>
</view> </view>
<view class="item" :class="{ <view
active: class="item"
options[current].checked && :class="{
options[current].checked.indexOf('B') !== -1, active: options[current].checked && options[current].checked.indexOf('B') !== -1
}" @click="fnChooseTopic('multiple', 'B')"> }"
@click="fnChooseTopic('multiple', 'B')"
>
<text class="option">B</text> <text class="option">B</text>
<text class="text">{{ options[current].OPTIONB }}</text> <text class="text">{{ options[current].OPTIONB }}</text>
</view> </view>
<view class="item" :class="{ <view
active: class="item"
options[current].checked && :class="{
options[current].checked.indexOf('C') !== -1, active: options[current].checked && options[current].checked.indexOf('C') !== -1
}" @click="fnChooseTopic('multiple', 'C')"> }"
@click="fnChooseTopic('multiple', 'C')"
>
<text class="option">C</text> <text class="option">C</text>
<text class="text">{{ options[current].OPTIONC }}</text> <text class="text">{{ options[current].OPTIONC }}</text>
</view> </view>
<view class="item" :class="{ <view
active: class="item"
options[current].checked && :class="{
options[current].checked.indexOf('D') !== -1, active: options[current].checked && options[current].checked.indexOf('D') !== -1
}" @click="fnChooseTopic('multiple', 'D')"> }"
@click="fnChooseTopic('multiple', 'D')"
>
<text class="option">D</text> <text class="option">D</text>
<text class="text">{{ options[current].OPTIOND }}</text> <text class="text">{{ options[current].OPTIOND }}</text>
</view> </view>
@ -87,31 +95,32 @@
</view> </view>
<view class="footer"> <view class="footer">
<u-button v-show="current !== 0" :style="{ width: '45%' }" text="上一题" @click="fnPreviousQuestion" /> <u-button v-show="current !== 0" :style="{ width: '45%' }" text="上一题" @click="fnPreviousQuestion" />
<u-button v-show="current !== options.length - 1" type="primary" <u-button v-show="current !== options.length - 1" type="primary" :style="{ width: current === 0 ? '100%' : '45%' }" text="下一题" @click="fnNextQuestion" />
: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" />
<u-button v-show="current === options.length - 1" type="primary" :style="{ width: '45%' }" text="交卷"
@click="fnHandInThePaper" />
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
// import { import {
// getExamExercises, getExamExercises,
// getStrengthenExam, // getStrengthenExam,
// setTestPaperSubmission, setTestPaperSubmission,
// } from "@/api"; } from '../../api'
export default { export default {
data() { data() {
return { return {
STAGEEXAMPAPERINPUT_ID: "", // STAGEEXAMPAPERINPUT_ID: '',
STAGEEXAMPAPER_ID: "", // STAGEEXAMPAPER_ID: '',
CLASS_ID: "", // CLASS_ID: '',
POST_ID: "", // POST_ID: '',
STUDENT_ID: "", // STUDENT_ID: '',
NUMBEROFEXAMS: "", // NUMBEROFEXAMS: '',
entrySite: "", routeQuery: {},
entrySite: '',
info: {}, info: {},
options: [{}], options: [{}],
current: 0, current: 0,
@ -119,35 +128,40 @@ export default {
1: '单选', 1: '单选',
2: '多选', 2: '多选',
3: '判断', 3: '判断',
4: '填空', 4: '填空'
}
} }
};
}, },
onLoad(query) { onLoad(query) {
// this.STAGEEXAMPAPERINPUT_ID = query.STAGEEXAMPAPERINPUT_ID; console.log('query :>> ', query);
this.routeQuery = query
// this.STAGEEXAMPAPER_ID = query.STAGEEXAMPAPER_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.entrySite = query.entrySite;
this.fnGetData(); this.fnGetData()
}, },
onBackPress(event) { onBackPress(event) {
if (event.from === "backbutton") { if (event.from === 'backbutton') {
uni.$u.toast("考试过程中不允许退出"); uni.$u.toast('考试过程中不允许退出')
return true; return true
} }
return false; return false
}, },
computed: { computed: {
userInfo() { userInfo() {
return this.$store.getters.getUserInfo; return this.$store.getters.getUserInfo
}, }
}, },
methods: { methods: {
async fnGetData() { async fnGetData() {
let resData = {}; 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") { // if (this.entrySite === "strengththen") {
// resData = await getStrengthenExam({ // resData = await getStrengthenExam({
// STRENGTHEN_STAGEEXAMPAPER_INPUT_ID: this.STAGEEXAMPAPERINPUT_ID, // STRENGTHEN_STAGEEXAMPAPER_INPUT_ID: this.STAGEEXAMPAPERINPUT_ID,
@ -171,34 +185,34 @@ export default {
this.info = { ...this.info, ANSWERSHEETTIME: 30 } this.info = { ...this.info, ANSWERSHEETTIME: 30 }
this.options = [ this.options = [
{ {
QUESTIONDRY: "题干题干题干题干题干1 ( ) .", QUESTIONDRY: '题干题干题干题干题干1 ( ) .',
QUESTIONTYPE: "1", QUESTIONTYPE: '1',
OPTIONA: '这是选项A', OPTIONA: '这是选项A',
OPTIONB: '这是选项B', OPTIONB: '这是选项B',
OPTIONC: '这是选项C', OPTIONC: '这是选项C',
OPTIOND: '这是选项D', OPTIOND: '这是选项D'
}, },
{ {
QUESTIONDRY: "题干题干题干题干题干2 ()", QUESTIONDRY: '题干题干题干题干题干2 ()',
QUESTIONTYPE: "2", QUESTIONTYPE: '2',
OPTIONA: '这是选项A', OPTIONA: '这是选项A',
OPTIONB: '这是选项B', OPTIONB: '这是选项B',
OPTIONC: '这是选项C', OPTIONC: '这是选项C',
OPTIOND: '这是选项D', OPTIOND: '这是选项D'
}, },
{ {
QUESTIONDRY: "未带安全头盔可正常进入堆场进行工业,以上说法是否正确?", QUESTIONDRY: '未带安全头盔可正常进入堆场进行工业,以上说法是否正确?',
QUESTIONTYPE: "3", QUESTIONTYPE: '3',
OPTIONA: '对', OPTIONA: '对',
OPTIONB: '错', OPTIONB: '错'
}, },
{ {
QUESTIONDRY: "当进入施工现场后, 应立刻对_____设施做全面检查?", QUESTIONDRY: '当进入施工现场后, 应立刻对_____设施做全面检查?',
QUESTIONTYPE: "4", QUESTIONTYPE: '4',
OPTIONA: '对', OPTIONA: '对',
OPTIONB: '错', OPTIONB: '错'
}, }
]; ]
// if (resData.NUMBEROFEXAMS > 0) { // if (resData.NUMBEROFEXAMS > 0) {
// uni.showModal({ // uni.showModal({
// title: "", // title: "",
@ -226,28 +240,28 @@ export default {
}, },
fnChooseTopic(type, checked) { fnChooseTopic(type, checked) {
if (!this.options[this.current].checked) { if (!this.options[this.current].checked) {
this.$set(this.options[this.current], "checked", ""); this.$set(this.options[this.current], 'checked', '')
} }
if (type === "judge" || type === "radio") { if (type === 'judge' || type === 'radio') {
if (this.options[this.current].checked === checked) { if (this.options[this.current].checked === checked) {
this.options[this.current].checked = ""; this.options[this.current].checked = ''
} else { } else {
this.options[this.current].checked = checked; this.options[this.current].checked = checked
} }
} }
if (type === "multiple") { if (type === 'multiple') {
if (this.options[this.current].checked) { if (this.options[this.current].checked) {
const checkedArr = this.options[this.current].checked.split(","); const checkedArr = this.options[this.current].checked.split(',')
if (checkedArr.indexOf(checked) !== -1) { if (checkedArr.indexOf(checked) !== -1) {
checkedArr.splice(checkedArr.indexOf(checked), 1); checkedArr.splice(checkedArr.indexOf(checked), 1)
this.options[this.current].checked = checkedArr.join(","); this.options[this.current].checked = checkedArr.join(',')
} else { } else {
checkedArr.push(checked); checkedArr.push(checked)
checkedArr.sort(); checkedArr.sort()
this.options[this.current].checked = checkedArr.join(","); this.options[this.current].checked = checkedArr.join(',')
} }
} else { } else {
this.options[this.current].checked = checked; this.options[this.current].checked = checked
} }
} }
}, },
@ -257,102 +271,102 @@ export default {
fnIsFinish() { fnIsFinish() {
if (!this.options[this.current].checked) { if (!this.options[this.current].checked) {
uni.showModal({ uni.showModal({
title: "温馨提示", title: '温馨提示',
content: "请对本题进行作答。", content: '请对本题进行作答。',
showCancel: false, showCancel: false
}); })
return false; return false
} }
return true; return true
}, },
/** /**
* 下一题按钮点击事件 * 下一题按钮点击事件
*/ */
fnNextQuestion() { fnNextQuestion() {
if (!this.fnIsFinish()) return; if (!this.fnIsFinish()) return
this.current++; this.current++
}, },
/** /**
* 上一题按钮点击事件 * 上一题按钮点击事件
*/ */
fnPreviousQuestion() { fnPreviousQuestion() {
this.current--; this.current--
}, },
/** /**
* 交卷按钮点击事件 * 交卷按钮点击事件
*/ */
fnHandInThePaper() { fnHandInThePaper() {
if (!this.fnIsFinish()) return; if (!this.fnIsFinish()) return
uni.showModal({ uni.showModal({
title: "温馨提示", title: '温馨提示',
content: `题目已全部做完,确认交卷吗?`, content: `题目已全部做完,确认交卷吗?`,
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.fnSubmit(); this.fnSubmit()
} }
} }
}); })
}, },
fnCountDownFinish() { fnCountDownFinish() {
uni.$u.toast("考试时间已结束"); uni.$u.toast('考试时间已结束')
for (let i = 0; i < this.options.length; i++) { for (let i = 0; i < this.options.length; i++) {
if (!this.options[i].checked) { if (!this.options[i].checked) {
this.options[i].checked = ""; this.options[i].checked = ''
} }
} }
this.fnSubmit(); this.fnSubmit()
}, },
async 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 }); uni.navigateBack({ delta: 2 });
// for (let i = 0; i < this.options.length; i++) { else uni.navigateBack();
// 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> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -400,7 +414,7 @@ export default {
.tag_title { .tag_title {
font-size: 28rpx; font-size: 28rpx;
background-color: #b3b3b3; background-color: #b3b3b3;
color: #FFF; color: #fff;
border-radius: 8rpx; border-radius: 8rpx;
padding: 2rpx 10rpx; padding: 2rpx 10rpx;
margin-right: 10rpx; margin-right: 10rpx;

View File

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

View File

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

View File

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