|
|
|
@ -5,7 +5,7 @@ import { PageContainer } from '@ant-design/pro-layout';
|
|
|
|
|
import { useParams, useRequest, history } from 'umi';
|
|
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
|
|
const { Text, Link } = Typography;
|
|
|
|
|
import { getRulesPaper, getPaperQuestionList, finishExamination, getPersonPaperId } from './examAnser';
|
|
|
|
|
import { getRulesPaper, getPaperQuestionList, finishExamination, getPersonPaperId,getExaminationPersonApplyInfo } from './examAnser';
|
|
|
|
|
import type { CardListItemDataType } from '../data';
|
|
|
|
|
import styles from './style.less';
|
|
|
|
|
import cookie from 'react-cookies';
|
|
|
|
@ -75,7 +75,7 @@ const CardList = () => {
|
|
|
|
|
// 解析可见
|
|
|
|
|
const [parsingShow, setParsingShow] = useState(false)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [testInfo, setTestInfo] = useState({})
|
|
|
|
|
const [lastBtnShow, setLastBtnShow] = useState(true)
|
|
|
|
|
const [nextBtnShow, setNextBtnShow] = useState(false)
|
|
|
|
|
|
|
|
|
@ -84,7 +84,7 @@ const CardList = () => {
|
|
|
|
|
const [questionNum, setQuestioNum] = useState(0)
|
|
|
|
|
|
|
|
|
|
const [timeData, setTimeData] = useState(0);
|
|
|
|
|
|
|
|
|
|
const [num,setNum]=useState(0);
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
|
|
|
|
let secondValue = params.time; // 秒 截至时间 - 服务器当前时间
|
|
|
|
@ -120,6 +120,24 @@ const CardList = () => {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const personInfo = useRequest(() => {
|
|
|
|
|
return getExaminationPersonApplyInfo({
|
|
|
|
|
examination_id: params.examination_id,
|
|
|
|
|
person_id: cookie.load('person_id')
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
formatResult: (result) => {
|
|
|
|
|
return result;
|
|
|
|
|
},
|
|
|
|
|
onSuccess: (result) => {
|
|
|
|
|
if (result.success) {
|
|
|
|
|
console.log('result准考证',result);
|
|
|
|
|
setTestInfo(result.bean);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { run } = useRequest(getPaperQuestionList,
|
|
|
|
|
{
|
|
|
|
|
refreshDeps: [rulesPaperInfo],
|
|
|
|
@ -137,7 +155,7 @@ const CardList = () => {
|
|
|
|
|
const question_type_count = [
|
|
|
|
|
{ count: 0, question_type: 0, type_name: '单选' },
|
|
|
|
|
{ count: 0, question_type: 1, type_name: '多选' },
|
|
|
|
|
{ count: 0, question_type: 2, type_name: '填空' },
|
|
|
|
|
{ count: 0, question_type: 2, type_name: '判断' },
|
|
|
|
|
];
|
|
|
|
|
if (result.question_list.length !== 0) {
|
|
|
|
|
setRuleId(result.question_list[0].rules_id)
|
|
|
|
@ -211,7 +229,7 @@ const CardList = () => {
|
|
|
|
|
// const timeDiff = params.duration / 1000 - time;
|
|
|
|
|
|
|
|
|
|
const timeDiff=params.time-time;
|
|
|
|
|
console.log('timeDiff',timeDiff)
|
|
|
|
|
// console.log('timeDiff',timeDiff)
|
|
|
|
|
history.push(`/dashboard/qualification/result/${result.data.pass_score}/${result.data.score}/${result.data.sum_score}/${params.examination_id}/${params.examination_name}/${timeDiff}`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -221,7 +239,6 @@ const CardList = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
// 已选择题目回显
|
|
|
|
|
formRef?.current?.setFieldsValue({ note: questionNow.answerId });
|
|
|
|
@ -315,6 +332,7 @@ const CardList = () => {
|
|
|
|
|
bordered
|
|
|
|
|
dataSource={e.children}
|
|
|
|
|
renderItem={(item, index) => {
|
|
|
|
|
setNum(index+1);
|
|
|
|
|
// console.log(item, 'list')
|
|
|
|
|
return <List.Item
|
|
|
|
|
id={item.id}
|
|
|
|
@ -349,16 +367,17 @@ const CardList = () => {
|
|
|
|
|
<Col span={13} style={{ background: '#ffffff', padding: 0 }}>
|
|
|
|
|
<ProCard
|
|
|
|
|
title={
|
|
|
|
|
questionNow.question_type === 0 ? "一、单选器" : questionNow.question_type === 1 ? "二、多选题" : questionNow.question_type === 2 ? "判断题" : ""
|
|
|
|
|
questionNow.question_type === 0 ? "一、单选题" : questionNow.question_type === 1 ? "二、多选题" : questionNow.question_type === 2 ? "判断题" : ""
|
|
|
|
|
}
|
|
|
|
|
extra={false}
|
|
|
|
|
split='vertical'
|
|
|
|
|
bordered
|
|
|
|
|
borderedshia1
|
|
|
|
|
headerBordered
|
|
|
|
|
>
|
|
|
|
|
<Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}>
|
|
|
|
|
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
|
|
|
|
|
{questionNow?.question_stem}
|
|
|
|
|
{num}. {questionNow?.question_stem}
|
|
|
|
|
|
|
|
|
|
{/* {console.log(questionNow.answerId, 'answerId', questionNow.answerId)} */}
|
|
|
|
|
</Typography>
|
|
|
|
|
<Space direction="vertical" style={{ fontSize: 16 }}>
|
|
|
|
@ -366,15 +385,12 @@ const CardList = () => {
|
|
|
|
|
ref={formRef} name="control-ref"
|
|
|
|
|
>
|
|
|
|
|
{/*{console.log('questionNow',questionNow)}*/}
|
|
|
|
|
<Form.Item name="note" label="Note" rules={[{ required: true }]}>
|
|
|
|
|
<Form.Item name="note">
|
|
|
|
|
|
|
|
|
|
{questionNow.question_type === 0 ?
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
|
|
|
|
|
|
<Radio.Group>
|
|
|
|
|
<Space direction="vertical">{questionNow?.answers?.map((item, index) => {
|
|
|
|
|
s
|
|
|
|
|
return <Radio key={item.id}
|
|
|
|
|
onChange={() => {
|
|
|
|
|
const qArr = []
|
|
|
|
@ -492,6 +508,10 @@ s
|
|
|
|
|
<Col span={5} style={{ paddingLeft: 24 }}>
|
|
|
|
|
<div style={{ background: '#ffffff', padding: 24 }}>
|
|
|
|
|
<Space direction="vertical" style={{ width: '100%' }}>
|
|
|
|
|
<strong>考生姓名:</strong>
|
|
|
|
|
<Typography>{testInfo?.person_name}</Typography>
|
|
|
|
|
<strong>准考证号:</strong>
|
|
|
|
|
<Typography>{testInfo?.admission_number}</Typography>
|
|
|
|
|
<strong>剩余时间</strong>
|
|
|
|
|
<Typography>{formatSeconds(timeData)}</Typography>
|
|
|
|
|
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
|
|
|
|
|