|
|
@ -132,8 +132,8 @@ const CardList = () => {
|
|
|
|
// 试题列表
|
|
|
|
// 试题列表
|
|
|
|
|
|
|
|
|
|
|
|
const paperList = result.question_list;
|
|
|
|
const paperList = result.question_list;
|
|
|
|
const arr = [[], [], []];
|
|
|
|
let arr=[[],[],[]];
|
|
|
|
const question_type_count = [
|
|
|
|
let question_type_count=[
|
|
|
|
{count:0,question_type:0,type_name:'单选'},
|
|
|
|
{count:0,question_type:0,type_name:'单选'},
|
|
|
|
{count:0,question_type:1,type_name:'多选'},
|
|
|
|
{count:0,question_type:1,type_name:'多选'},
|
|
|
|
{count:0,question_type:2,type_name:'填空'},
|
|
|
|
{count:0,question_type:2,type_name:'填空'},
|
|
|
@ -179,9 +179,7 @@ const CardList = () => {
|
|
|
|
const questionInfo = []
|
|
|
|
const questionInfo = []
|
|
|
|
for (let i = 0; i < questionList.length; i++) {
|
|
|
|
for (let i = 0; i < questionList.length; i++) {
|
|
|
|
questionList[i].children.map((e, index) => {
|
|
|
|
questionList[i].children.map((e, index) => {
|
|
|
|
questionInfo.push({ ...e, index: [i, index] })
|
|
|
|
questionInfo.push({ ...e, index: index })
|
|
|
|
questionList[i].children[index].index = [i, index]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -386,10 +384,10 @@ const CardList = () => {
|
|
|
|
// 修改答题卡状态 写入答案以及修改答题状态
|
|
|
|
// 修改答题卡状态 写入答案以及修改答题状态
|
|
|
|
const qX = questionNow?.question_type;
|
|
|
|
const qX = questionNow?.question_type;
|
|
|
|
const qI = questionNow?.index;
|
|
|
|
const qI = questionNow?.index;
|
|
|
|
questionList[questionNow.index[0]].children[questionNow.index[1]].answerSelect = questionAnswer;
|
|
|
|
questionList[qX].children[qI].answerSelect = questionAnswer;
|
|
|
|
// 答题状态
|
|
|
|
// 答题状态
|
|
|
|
questionList[questionNow.index[0]].children[questionNow.index[1]].state = 1
|
|
|
|
questionList[qX].children[qI].state = 1
|
|
|
|
questionList[questionNow.index[0]].children[questionNow.index[1]].answerId = item.id
|
|
|
|
questionList[qX].children[qI].answerId = item.id
|
|
|
|
// 提交答题卡
|
|
|
|
// 提交答题卡
|
|
|
|
setQuestionTypeList(questionList)
|
|
|
|
setQuestionTypeList(questionList)
|
|
|
|
|
|
|
|
|
|
|
@ -415,10 +413,10 @@ const CardList = () => {
|
|
|
|
// 修改答题卡状态 写入答案以及修改答题状态
|
|
|
|
// 修改答题卡状态 写入答案以及修改答题状态
|
|
|
|
const qX = questionNow?.question_type;
|
|
|
|
const qX = questionNow?.question_type;
|
|
|
|
const qI = questionNow?.index;
|
|
|
|
const qI = questionNow?.index;
|
|
|
|
questionList[questionNow.index[0]].children[questionNow.index[1]].answerSelect = questionAnswer;
|
|
|
|
questionList[qX].children[qI].answerSelect = questionAnswer;
|
|
|
|
// 答题状态
|
|
|
|
// 答题状态
|
|
|
|
questionList[questionNow.index[0]].children[questionNow.index[1]].state = 1
|
|
|
|
questionList[qX].children[qI].state = 1
|
|
|
|
questionList[questionNow.index[0]].children[questionNow.index[1]].answerId = e
|
|
|
|
questionList[qX].children[qI].answerId = e
|
|
|
|
// 提交答题卡
|
|
|
|
// 提交答题卡
|
|
|
|
setQuestionTypeList(questionList)
|
|
|
|
setQuestionTypeList(questionList)
|
|
|
|
|
|
|
|
|
|
|
@ -453,10 +451,10 @@ const CardList = () => {
|
|
|
|
// 修改答题卡状态 写入答案以及修改答题状态
|
|
|
|
// 修改答题卡状态 写入答案以及修改答题状态
|
|
|
|
const qX = questionNow?.question_type;
|
|
|
|
const qX = questionNow?.question_type;
|
|
|
|
const qI = questionNow?.index;
|
|
|
|
const qI = questionNow?.index;
|
|
|
|
questionList[questionNow.index[0]].children[questionNow.index[1]].answerSelect = questionAnswer;
|
|
|
|
questionList[qX].children[qI].answerSelect = questionAnswer;
|
|
|
|
// 答题状态
|
|
|
|
// 答题状态
|
|
|
|
questionList[questionNow.index[0]].children[questionNow.index[1]].state = 1
|
|
|
|
questionList[qX].children[qI].state = 1
|
|
|
|
questionList[questionNow.index[0]].children[questionNow.index[1]].answerId = item.id
|
|
|
|
questionList[qX].children[qI].answerId = item.id
|
|
|
|
// 提交答题卡
|
|
|
|
// 提交答题卡
|
|
|
|
setQuestionTypeList(questionList)
|
|
|
|
setQuestionTypeList(questionList)
|
|
|
|
|
|
|
|
|
|
|
@ -505,9 +503,9 @@ const CardList = () => {
|
|
|
|
const nextTemp = paperInfo[i - 1]
|
|
|
|
const nextTemp = paperInfo[i - 1]
|
|
|
|
const questionList = questionTypeList
|
|
|
|
const questionList = questionTypeList
|
|
|
|
let nextData = {}
|
|
|
|
let nextData = {}
|
|
|
|
questionList[nextTemp.index[0]].children.map((item, index) => {
|
|
|
|
questionList[nextTemp.question_type].children.map((item, index) => {
|
|
|
|
if (item.id === nextTemp.id) {
|
|
|
|
if (item.id === nextTemp.id) {
|
|
|
|
nextData = item
|
|
|
|
nextData = { ...item, index: index }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
setQuestionNow(nextData)
|
|
|
|
setQuestionNow(nextData)
|
|
|
@ -530,9 +528,9 @@ const CardList = () => {
|
|
|
|
const nextTemp = paperInfo[i + 1]
|
|
|
|
const nextTemp = paperInfo[i + 1]
|
|
|
|
const questionList = questionTypeList
|
|
|
|
const questionList = questionTypeList
|
|
|
|
let nextData = {}
|
|
|
|
let nextData = {}
|
|
|
|
questionList[nextTemp.index[0]].children.map((item, index) => {
|
|
|
|
questionList[nextTemp.question_type].children.map((item, index) => {
|
|
|
|
if (item.id === nextTemp.id) {
|
|
|
|
if (item.id === nextTemp.id) {
|
|
|
|
nextData = item
|
|
|
|
nextData = { ...item, index: index }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
setQuestionNow(nextData)
|
|
|
|
setQuestionNow(nextData)
|
|
|
@ -545,6 +543,18 @@ const CardList = () => {
|
|
|
|
<Button size="large" type="primary"
|
|
|
|
<Button size="large" type="primary"
|
|
|
|
onClick={() => {
|
|
|
|
onClick={() => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const questionFinishId = []
|
|
|
|
|
|
|
|
questionTypeList.map((e, i) => {
|
|
|
|
|
|
|
|
questionTypeList[i].children.map((e, index) => {
|
|
|
|
|
|
|
|
const answerId = e.answerId
|
|
|
|
|
|
|
|
answerId !== "" ? questionFinishId.push({
|
|
|
|
|
|
|
|
answer_id: (answerId instanceof Array) ? answerId.join(',') : answerId,
|
|
|
|
|
|
|
|
question_id: e.id,
|
|
|
|
|
|
|
|
question_type: e.question_type
|
|
|
|
|
|
|
|
}) : ""
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const questionFinish = {
|
|
|
|
const questionFinish = {
|
|
|
|
answers: JSON.stringify(questionFinishId),
|
|
|
|
answers: JSON.stringify(questionFinishId),
|
|
|
|
examination_id:params.examination_id,
|
|
|
|
examination_id:params.examination_id,
|
|
|
|