|
|
|
@ -158,10 +158,21 @@ const CardList = () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 根据题型返回题数、分数、总分
|
|
|
|
|
const showQuestionTypeSocore = (questionType) => {
|
|
|
|
|
let num = 0
|
|
|
|
|
let name = 0
|
|
|
|
|
questionTypeList.map((e) => {
|
|
|
|
|
e.question_type === questionType ? name = e.question_type_name : "";
|
|
|
|
|
e.question_type === questionType ? num = e.question_list.length : ""
|
|
|
|
|
})
|
|
|
|
|
return `${name} (共${num}题)`
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<PageContainer content={content} extraContent={false}>
|
|
|
|
|
<Row>
|
|
|
|
|
{/* {console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)} */}
|
|
|
|
|
{console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)}
|
|
|
|
|
|
|
|
|
|
{/* {console.log(questionTypeList, 'uestionTypeList')} */}
|
|
|
|
|
<Col span={6} style={{ paddingRight: 24 }}>
|
|
|
|
@ -220,11 +231,11 @@ const CardList = () => {
|
|
|
|
|
</div>
|
|
|
|
|
</ProCard>
|
|
|
|
|
</Col>
|
|
|
|
|
{console.log(questionNow, 'questionNow.index[1]')}
|
|
|
|
|
|
|
|
|
|
<Col span={13} style={{ background: '#ffffff', padding: 0 }}>
|
|
|
|
|
<ProCard
|
|
|
|
|
title={
|
|
|
|
|
questionNow.question_type === 0 ? "一、单选题" : questionNow.question_type === 1 ? "二、多选题" : questionNow.question_type === 2 ? "判断题" : ""
|
|
|
|
|
}
|
|
|
|
|
title={showQuestionTypeSocore(questionNow.question_type)}
|
|
|
|
|
extra={false}
|
|
|
|
|
split='vertical'
|
|
|
|
|
bordered
|
|
|
|
@ -232,7 +243,7 @@ const CardList = () => {
|
|
|
|
|
>
|
|
|
|
|
<Space direction="vertical" style={{ width: '100%', padding: '24px 48px' }}>
|
|
|
|
|
<Typography style={{ marginBottom: 16, fontSize: 18 }}>
|
|
|
|
|
{questionNow.id ? questionNow.index[0] + 1 : ""} 、{questionNow?.question_stem}
|
|
|
|
|
{JSON.stringify(questionNow) !== {} ? questionNow.index[1] + 1 : ""} 、{questionNow?.question_stem}
|
|
|
|
|
|
|
|
|
|
</Typography>
|
|
|
|
|
<Space direction="vertical" style={{ fontSize: 16 }}>
|
|
|
|
@ -357,12 +368,6 @@ const CardList = () => {
|
|
|
|
|
// runSavePersonAnswer({
|
|
|
|
|
// answer_ids: e.target.value,
|
|
|
|
|
// question_id: questionNow.question_id,
|
|
|
|
|
// record_id: rulesPaperInfo.record_id
|
|
|
|
|
// })
|
|
|
|
|
// console.log("答题:", questionAnswer, qArr, questionNow)
|
|
|
|
|
// 修改答题卡状态 写入答案以及修改答题状态
|
|
|
|
|
const qX = questionNow?.question_type;
|
|
|
|
|
const qI = questionNow?.index;
|
|
|
|
|
questionList[questionNow.index[0]].question_list[questionNow.index[1]].answerSelect = questionAnswer;
|
|
|
|
|
if (questionAnswer === questionNow.answertrue) {
|
|
|
|
|
questionList[questionNow.index[0]].question_list[questionNow.index[1]].state = 0
|
|
|
|
@ -380,88 +385,71 @@ const CardList = () => {
|
|
|
|
|
|
|
|
|
|
})}</Space></Radio.Group>
|
|
|
|
|
) : ""
|
|
|
|
|
}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Form>
|
|
|
|
|
</Space>
|
|
|
|
|
|
|
|
|
|
<Radio.Group onChange={() => { return true }} value={0} size="large">
|
|
|
|
|
<Space direction="vertical" style={{ fontSize: 16 }}>
|
|
|
|
|
<Button type="primary" onClick={() => {
|
|
|
|
|
setParsingShow(!parsingShow)
|
|
|
|
|
}}>查看解析</Button>
|
|
|
|
|
<div style={{ display: (parsingShow ? 'block' : 'none') }} dangerouslySetInnerHTML={{ __html: questionNow.parsing }} />
|
|
|
|
|
</Space>
|
|
|
|
|
</Radio.Group>
|
|
|
|
|
</Space>
|
|
|
|
|
</ProCard>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={5} style={{ paddingLeft: 24 }}>
|
|
|
|
|
<div style={{ background: '#ffffff', padding: 24 }}>
|
|
|
|
|
<Space direction="vertical" style={{ width: '100%' }}>
|
|
|
|
|
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
|
|
|
|
|
<strong>答题序号</strong>
|
|
|
|
|
<Typography>{questionNowNum}/{questionNum}</Typography>
|
|
|
|
|
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
|
|
|
|
|
<Button
|
|
|
|
|
size="large"
|
|
|
|
|
disabled={lastBtnShow}
|
|
|
|
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
|
|
|
|
paperInfo.map((e, i) => {
|
|
|
|
|
|
|
|
|
|
if (e.question_id === questionNow.question_id) {
|
|
|
|
|
const nextTemp = paperInfo[i - 1]
|
|
|
|
|
const questionList = questionTypeList
|
|
|
|
|
let nextData = {}
|
|
|
|
|
questionList[nextTemp.index[0]].question_list.map((item, index) => {
|
|
|
|
|
if (item.question_id === nextTemp.question_id) {
|
|
|
|
|
nextData = item
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
setQuestionNow(nextData)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
block>上一题</Button>
|
|
|
|
|
} <div style={{ background: '#ffffff', padding: 24 }}>
|
|
|
|
|
<Space direction="vertical" style={{ width: '100%' }}>
|
|
|
|
|
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
|
|
|
|
|
<strong>答题序号</strong>
|
|
|
|
|
<Typography>{questionNowNum}/{questionNum}</Typography>
|
|
|
|
|
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
|
|
|
|
|
<Button
|
|
|
|
|
size="large"
|
|
|
|
|
disabled={lastBtnShow}
|
|
|
|
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
|
|
|
|
paperInfo.map((e, i) => {
|
|
|
|
|
|
|
|
|
|
if (e.question_id === questionNow.question_id) {
|
|
|
|
|
const nextTemp = paperInfo[i - 1]
|
|
|
|
|
const questionList = questionTypeList
|
|
|
|
|
let nextData = {}
|
|
|
|
|
questionList[nextTemp.index[0]].question_list.map((item, index) => {
|
|
|
|
|
if (item.question_id === nextTemp.question_id) {
|
|
|
|
|
nextData = item
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
setQuestionNow(nextData)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<Button size="large"
|
|
|
|
|
disabled={nextBtnShow}
|
|
|
|
|
block onClick={() => {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
paperInfo.map((e, i) => {
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
if (e.question_id === questionNow.question_id) {
|
|
|
|
|
const nextTemp = paperInfo[i + 1]
|
|
|
|
|
const questionList = questionTypeList
|
|
|
|
|
let nextData = {}
|
|
|
|
|
questionList[nextTemp.index[0]].question_list.map((item, index) => {
|
|
|
|
|
if (item.question_id === nextTemp.question_id) {
|
|
|
|
|
nextData = item
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
setQuestionNow(nextData)
|
|
|
|
|
}
|
|
|
|
|
block>上一题</Button>
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
<Button size="large"
|
|
|
|
|
disabled={nextBtnShow}
|
|
|
|
|
block onClick={() => {
|
|
|
|
|
|
|
|
|
|
}}>下一题</Button>
|
|
|
|
|
<Button size="large" type="primary"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
paperInfo.map((e, i) => {
|
|
|
|
|
|
|
|
|
|
history.goBack();
|
|
|
|
|
}}
|
|
|
|
|
block>返回</Button>
|
|
|
|
|
</Space>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row >
|
|
|
|
|
</PageContainer >
|
|
|
|
|
);
|
|
|
|
|
if (e.question_id === questionNow.question_id) {
|
|
|
|
|
const nextTemp = paperInfo[i + 1]
|
|
|
|
|
const questionList = questionTypeList
|
|
|
|
|
let nextData = {}
|
|
|
|
|
questionList[nextTemp.index[0]].question_list.map((item, index) => {
|
|
|
|
|
if (item.question_id === nextTemp.question_id) {
|
|
|
|
|
nextData = item
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
setQuestionNow(nextData)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}}>下一题</Button>
|
|
|
|
|
<Button size="large" type="primary"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
|
|
|
|
history.goBack();
|
|
|
|
|
}}
|
|
|
|
|
block>返回</Button>
|
|
|
|
|
</Space>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row >
|
|
|
|
|
</PageContainer >
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default CardList;
|
|
|
|
|
export default CardList;
|
|
|
|
|