Commit e8aec20f by guomingpang

feat:关闭答题详情B端查看限制。

parent 593e59d0
......@@ -7,19 +7,17 @@
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import React, { useState, useEffect } from 'react';
import { Route, withRouter } from 'react-router-dom';
import { withRouter } from 'react-router-dom';
import User from '@/common/js/user';
import './TestDetailPage.less';
import Service from '@/common/js/service';
import { message, Empty } from 'antd';
import moment from 'moment';
import { message } from 'antd';
import AnswerDescPage from '../components/AnswerDescPage';
import Breadcrumbs from '@/components/Breadcrumbs';
function TestDetailPage(props) {
const examId = props.match.params.testId.replace(/\?.+/, '');
const paperId = window.getParameterByName('paperId');
const [customerId, setCustomerId] = useState('');
const [examDetail, setExamDetail] = useState({
answerAnalysis: '',
resultShow: '',
......@@ -36,34 +34,15 @@ function TestDetailPage(props) {
totalScore: 0,
userCorrectQuestion: 0,
userExamDuration: 0,
userExamState: 'INIT',
userScore: 0,
}); // 考试详情
const [testState, setTestState] = useState({
isDelete: false,
}); // 考试状态
const [paperDetail, setPaperDetail] = useState({}); // 试卷详情
const [questionList, setQuestionList] = useState([]); // 试卷题目列表
const [userAnswerList, setUserAnswerList] = useState([]); // 用户答案列表
const [isScrollShow, setIsScrollShow] = useState(false); // 是否展示回到顶部按钮
const {
answerAnalysis,
resultContent,
resultShow,
examName,
examStartTime,
examEndTime,
totalScore,
totalQuestionCount,
passScore,
examDuration,
examDesc,
userExamDuration,
userExamState,
userScore,
userCorrectQuestion,
} = examDetail;
const { answerAnalysis, resultContent, examName, totalScore, totalQuestionCount, passScore, examDuration, userExamDuration, userScore, userCorrectQuestion } =
examDetail;
useEffect(() => {
bindScroll();
......@@ -120,9 +99,6 @@ function TestDetailPage(props) {
function handleChangeShowErrorPage() {
setIsShowErrorPage(true);
setTestState({
isDelete: true,
});
}
// 用户时长转换
......@@ -228,40 +204,6 @@ function TestDetailPage(props) {
);
}
function customizeRenderEmpty(status) {
return (
<div className='empty-result'>
<Empty
image={status === 'lack' ? 'https://image.xiaomaiketang.com/xm/7xi4YTXmHK.png' : 'https://image.xiaomaiketang.com/xm/bhGtST27Hf.png'}
imageStyle={{
height: '100px',
}}
description={
status === 'lack' ? (
<div className='lack-desc'>
<div className='title'>缺考</div>
<div className='content'>你没有成功交卷哦</div>
</div>
) : (
<div className='after-desc'>
<div className='title'>恭喜你完成考试!</div>
<div className='after-show-box'>
<div>本次考试用时 {window.formatHourTime(Number(userExamDuration || 0))}</div>
<div>
考试结果会在
<span style={{ color: '#333333' }}>
{moment(Number(examEndTime)).format('YYYY.MM.DD HH:mm')}
公布哦
</span>
</div>
</div>
</div>
)
}></Empty>
</div>
);
}
let sortedAnswerList = [];
questionList.map((item) => {
userAnswerList &&
......
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