|
|
@ -195,7 +195,7 @@ export default () => {
|
|
|
|
|
|
|
|
|
|
|
|
/** 组卷,查询试题临时表(当前选题列表) */
|
|
|
|
/** 组卷,查询试题临时表(当前选题列表) */
|
|
|
|
const { data: questions, run } = useRequest(async (params) => {
|
|
|
|
const { data: questions, run } = useRequest(async (params) => {
|
|
|
|
console.log('questions', questions)
|
|
|
|
console.log('questions::::', questions)
|
|
|
|
const _data = await queryTempQuestionList(params);
|
|
|
|
const _data = await queryTempQuestionList(params);
|
|
|
|
return _data;
|
|
|
|
return _data;
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
@ -209,7 +209,7 @@ export default () => {
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
const _data = [0, 0, 0]; // 当前仅支持 单选 / 多选 / 判断 的顺序
|
|
|
|
const _data = [0, 0, 0]; // 当前仅支持 单选 / 多选 / 判断 的顺序
|
|
|
|
console.log('questions-info', questions)
|
|
|
|
console.log('questions-info', questions)
|
|
|
|
questions?.forEach((item) => {
|
|
|
|
questions?.forEach((item: { question_type: any; }) => {
|
|
|
|
_data[Number(item?.question_type)] += 1
|
|
|
|
_data[Number(item?.question_type)] += 1
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@ -236,7 +236,7 @@ export default () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 获取组卷详情
|
|
|
|
const { data: paperData, run: runPaper } = useRequest(async (params) => {
|
|
|
|
const { data: paperData, run: runPaper } = useRequest(async (params) => {
|
|
|
|
console.log('paperData', paperData)
|
|
|
|
console.log('paperData', paperData)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -315,6 +315,11 @@ export default () => {
|
|
|
|
rules_type: 0,
|
|
|
|
rules_type: 0,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取 paper_uuid
|
|
|
|
|
|
|
|
const pager = await queryRulesPaper({ rules_id: params?.id || rulesId });
|
|
|
|
|
|
|
|
setUuidPaper(pager?.question_list[0]?.paper_uuid)
|
|
|
|
|
|
|
|
console.log('###paper_uuid==', pager?.question_list[0]?.paper_uuid)
|
|
|
|
|
|
|
|
|
|
|
|
setRulesId(data?.rules_id) // 保存规则id
|
|
|
|
setRulesId(data?.rules_id) // 保存规则id
|
|
|
|
//run({paper_uuid:1}); // 获取当前选题列表
|
|
|
|
//run({paper_uuid:1}); // 获取当前选题列表
|
|
|
|
// console.log('模拟考试基本信息', fileds)
|
|
|
|
// console.log('模拟考试基本信息', fileds)
|
|
|
@ -322,11 +327,27 @@ export default () => {
|
|
|
|
setRulesName(fileds?.rules_name) // 设置模拟考试规则名称
|
|
|
|
setRulesName(fileds?.rules_name) // 设置模拟考试规则名称
|
|
|
|
console.log('fileds', fileds)
|
|
|
|
console.log('fileds', fileds)
|
|
|
|
console.log('formRef', formRef.current?.getFieldValue(''))
|
|
|
|
console.log('formRef', formRef.current?.getFieldValue(''))
|
|
|
|
// await waitTime(2000);
|
|
|
|
|
|
|
|
setCurrentStep(1) // 设置步骤号
|
|
|
|
setCurrentStep(1) // 设置步骤号
|
|
|
|
runScore({rules_id: data?.rules_id}) //
|
|
|
|
runScore({rules_id: data?.rules_id}) //
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果有保存的试卷,显示当前选题列表数据
|
|
|
|
|
|
|
|
if(pager?.question_list[0]?.paper_uuid){
|
|
|
|
|
|
|
|
console.log('has......')
|
|
|
|
|
|
|
|
// 获取数据
|
|
|
|
|
|
|
|
run({
|
|
|
|
|
|
|
|
paper_uuid: pager?.question_list[0]?.paper_uuid,
|
|
|
|
|
|
|
|
page_size: 1000,
|
|
|
|
|
|
|
|
page_number: 1
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
console.log('no has ....')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//runPaper({ rules_id: params?.id || rulesId }) // 获取组卷详情
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('###')
|
|
|
|
|
|
|
|
console.log('uuidPaper', uuidPaper)
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Row gutter={24}>
|
|
|
|
<Row gutter={24}>
|
|
|
@ -445,15 +466,13 @@ export default () => {
|
|
|
|
message.error(msg);
|
|
|
|
message.error(msg);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// question 请选择试题 请选择试题
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
runPaper({ rules_id: params?.id || rulesId })
|
|
|
|
runPaper({ rules_id: params?.id || rulesId })
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div style={{ margin: '0' }}>
|
|
|
|
<div style={{ margin: '0' }}>
|
|
|
|
|
|
|
|
{/*uuidPaper*/}
|
|
|
|
<Typography style={{ padding: 24, fontSize: 24, textAlign: 'center' }}>{rulesName}</Typography>
|
|
|
|
<Typography style={{ padding: 24, fontSize: 24, textAlign: 'center' }}>{rulesName}</Typography>
|
|
|
|
{/** 一旦录入另一项将禁用,清空组卷后可选另一项 */}
|
|
|
|
{/** 一旦录入另一项将禁用,清空组卷后可选另一项 */}
|
|
|
|
<Row>
|
|
|
|
<Row>
|
|
|
@ -532,12 +551,14 @@ export default () => {
|
|
|
|
<div style={{ height: 'auto', backgroundColor: '#f0f0f0', textAlign: 'right', padding: 5, opacity: 1 }}>
|
|
|
|
<div style={{ height: 'auto', backgroundColor: '#f0f0f0', textAlign: 'right', padding: 5, opacity: 1 }}>
|
|
|
|
<Button disabled={idx === 0} onClick={async ()=>{
|
|
|
|
<Button disabled={idx === 0} onClick={async ()=>{
|
|
|
|
const success = await handleExchangeSortNum(uuidPaper,[questions[idx-1]?.id, item?.id].toString(), rulesId)
|
|
|
|
const success = await handleExchangeSortNum(uuidPaper,[questions[idx-1]?.id, item?.id].toString(), rulesId)
|
|
|
|
|
|
|
|
// 刷新试题列表
|
|
|
|
if (success) {
|
|
|
|
if (success) {
|
|
|
|
|
|
|
|
// 当前选题列表数据
|
|
|
|
run({
|
|
|
|
run({
|
|
|
|
paper_uuid: uuidPaper,
|
|
|
|
paper_uuid: uuidPaper,
|
|
|
|
page_size: 1000,
|
|
|
|
page_size: 1000,
|
|
|
|
page_number: 1
|
|
|
|
page_number: 1
|
|
|
|
}); // 获取当前选题列表
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}}><ArrowUpOutlined /></Button>
|
|
|
|
}}><ArrowUpOutlined /></Button>
|
|
|
|
<Button disabled={idx+1 === questions?.length} onClick={async ()=>{
|
|
|
|
<Button disabled={idx+1 === questions?.length} onClick={async ()=>{
|
|
|
@ -583,7 +604,7 @@ export default () => {
|
|
|
|
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
|
|
|
|
<Divider style={{ margin: '6px 0', opacity: 0.5 }} />
|
|
|
|
<Space direction="vertical">
|
|
|
|
<Space direction="vertical">
|
|
|
|
{questionType.map((item) => {
|
|
|
|
{questionType.map((item) => {
|
|
|
|
return <Typography>{item?.name} 共 {typeQuestionCount[Number(item.code)]} 题, 共 {typeQuestionCount[Number(item.code)] * scoreData?.filter(val=>(val.question_type === Number(item?.code)))[0]?.score} 分</Typography>
|
|
|
|
return <Typography>{item?.name} 共 {typeQuestionCount[Number(item.code)]} 题, 共 {typeQuestionCount[Number(item.code)] * scoreData?.filter(val=>(val.question_type === Number(item?.code)))[0]?.score || 0} 分</Typography>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
</Space>
|
|
|
|
</Space>
|
|
|
@ -733,9 +754,15 @@ export default () => {
|
|
|
|
const passSocre = setterRef.current?.getValue() // 获取通过分数线
|
|
|
|
const passSocre = setterRef.current?.getValue() // 获取通过分数线
|
|
|
|
const sumCore = setterRef.current?.getSum() // 获取总分
|
|
|
|
const sumCore = setterRef.current?.getSum() // 获取总分
|
|
|
|
if(passSocre > sumCore){
|
|
|
|
if(passSocre > sumCore){
|
|
|
|
message.error('通过分数线不能大于总分,请修改通过分数线');
|
|
|
|
message.error('“通过分数线”不能大于总分,请修改“通过分数线”');
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(values.filter(item=>(item?.score_harf > item?.score)).length > 0){
|
|
|
|
|
|
|
|
message.error('“错选漏选分数”不能大于该题型分,请修改“通错选漏选得分”');
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log('批量设置分值v::::2', values);
|
|
|
|
console.log('批量设置分值v::::2', values);
|
|
|
|
// 题型分数
|
|
|
|
// 题型分数
|
|
|
|
const { code, data: paper, msg } = await saveQuestionTypeScore({ rules_id: Number(params?.id || rulesId), type_score: JSON.stringify(values) })
|
|
|
|
const { code, data: paper, msg } = await saveQuestionTypeScore({ rules_id: Number(params?.id || rulesId), type_score: JSON.stringify(values) })
|
|
|
|