|
@@ -320,26 +320,31 @@ const _sfc_main = {
|
|
title: "正在提交答案..."
|
|
title: "正在提交答案..."
|
|
});
|
|
});
|
|
let answerContent = "";
|
|
let answerContent = "";
|
|
|
|
+ let answerOptions = [];
|
|
if (this.currentAnswer.questionType === 0) {
|
|
if (this.currentAnswer.questionType === 0) {
|
|
answerContent = this.currentAnswer.answer;
|
|
answerContent = this.currentAnswer.answer;
|
|
|
|
+ answerOptions = [];
|
|
} else if (this.currentAnswer.questionType === 1 || this.currentAnswer.questionType === 3) {
|
|
} else if (this.currentAnswer.questionType === 1 || this.currentAnswer.questionType === 3) {
|
|
const selectedIndex = this.currentAnswer.answer;
|
|
const selectedIndex = this.currentAnswer.answer;
|
|
const selectedOption = this.currentQuestion.options[selectedIndex];
|
|
const selectedOption = this.currentQuestion.options[selectedIndex];
|
|
console.log("selectedOption", selectedOption);
|
|
console.log("selectedOption", selectedOption);
|
|
- answerContent = selectedOption.id ? selectedOption.id.toString() : selectedIndex.toString();
|
|
|
|
|
|
+ const optionId = selectedOption.id ? selectedOption.id : selectedIndex;
|
|
|
|
+ answerContent = optionId.toString();
|
|
|
|
+ answerOptions = [optionId];
|
|
} else if (this.currentAnswer.questionType === 2) {
|
|
} else if (this.currentAnswer.questionType === 2) {
|
|
const selectedIndices = this.currentAnswer.answer;
|
|
const selectedIndices = this.currentAnswer.answer;
|
|
const selectedOptionIds = selectedIndices.map((index) => {
|
|
const selectedOptionIds = selectedIndices.map((index) => {
|
|
const option = this.currentQuestion.options[index];
|
|
const option = this.currentQuestion.options[index];
|
|
return option.id ? option.id : index;
|
|
return option.id ? option.id : index;
|
|
});
|
|
});
|
|
- answerContent = selectedOptionIds.join(",");
|
|
|
|
|
|
+ answerOptions = selectedOptionIds;
|
|
}
|
|
}
|
|
const submitData = {
|
|
const submitData = {
|
|
job_id: JSON.parse(common_vendor.index.getStorageSync("selectedJob")).id,
|
|
job_id: JSON.parse(common_vendor.index.getStorageSync("selectedJob")).id,
|
|
applicant_id: JSON.parse(common_vendor.index.getStorageSync("userInfo")).id,
|
|
applicant_id: JSON.parse(common_vendor.index.getStorageSync("userInfo")).id,
|
|
question_id: this.currentAnswer.questionId,
|
|
question_id: this.currentAnswer.questionId,
|
|
- answer_content: answerContent,
|
|
|
|
|
|
+ // answer_content: answerContent,
|
|
|
|
+ answer_options: answerOptions,
|
|
answer_duration: this.currentAnswer.answerDuration || 0,
|
|
answer_duration: this.currentAnswer.answerDuration || 0,
|
|
tenant_id: 1
|
|
tenant_id: 1
|
|
};
|
|
};
|