Commit 2bcb8f46 by yuananting

feat:联调

parent 6a844944
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-27 16:15:13 * @Date: 2021-03-27 16:15:13
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-01 14:41:56 * @LastEditTime: 2021-04-02 10:51:10
* @Description: 助学工具-新建试卷 * @Description: 助学工具-新建试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -80,7 +80,7 @@ class NewExaminationPaper extends Component { ...@@ -80,7 +80,7 @@ class NewExaminationPaper extends Component {
AidToolService.queryPaperDetail(query).then((res) => { AidToolService.queryPaperDetail(query).then((res) => {
const { result } = res; const { result } = res;
this.setState({ selectQuestionList: result.questionList, formData: result, },() => { this.setState({ selectQuestionList: result.questionList, formData: result, },() => {
console.log(this.state.formData) this.setFormData([])
}) })
}); });
}; };
...@@ -574,7 +574,7 @@ class NewExaminationPaper extends Component { ...@@ -574,7 +574,7 @@ class NewExaminationPaper extends Component {
<Button>预览</Button> <Button>预览</Button>
<Button <Button
type="primary" type="primary"
onClick={() => this.saveExaminationPaper(totalScore)} onClick={() => this.saveExaminationPaper()}
> >
保存 保存
</Button> </Button>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-27 11:15:03 * @Date: 2021-03-27 11:15:03
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-01 20:12:01 * @LastEditTime: 2021-04-02 12:42:42
* @Description: 助学工具-试卷-预览试卷 * @Description: 助学工具-试卷-预览试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -110,7 +110,7 @@ class PaperPreviewModal extends Component { ...@@ -110,7 +110,7 @@ class PaperPreviewModal extends Component {
}; };
renderOption = (optionItem, questionType) => { renderOption = (optionItem, questionType) => {
const { questionOptionContentList, optionSort} = optionItem const { questionOptionContentList, optionSort } = optionItem;
const textContent = _.filter(questionOptionContentList, (item) => { const textContent = _.filter(questionOptionContentList, (item) => {
return item.type == "RICH_TEXT"; return item.type == "RICH_TEXT";
}); });
...@@ -133,7 +133,7 @@ class PaperPreviewModal extends Component { ...@@ -133,7 +133,7 @@ class PaperPreviewModal extends Component {
return ( return (
<div className="option-line__item"> <div className="option-line__item">
<div className="text"> <div className="text">
{NUM_TO_WORD_MAP[optionSort]}. {textDom} {NUM_TO_WORD_MAP[optionSort]}. {textDom}
</div> </div>
{mediaContent.length > 0 && this.renderMediaContent(mediaContent)} {mediaContent.length > 0 && this.renderMediaContent(mediaContent)}
</div> </div>
...@@ -141,6 +141,42 @@ class PaperPreviewModal extends Component { ...@@ -141,6 +141,42 @@ class PaperPreviewModal extends Component {
} }
}; };
renderAnswer = (optionList, gapFillingAnswerList, questionType) => {
if (questionType === "GAP_FILLING") {
{
_.map(gapFillingAnswerList, (gapItem, gapIndex) => {
console.log("gapFillingAnswerList", gapFillingAnswerList)
const { correctAnswerList } = gapItem;
return (
<div>
<span>【填空{gapIndex + 1}</span>
{_.map(correctAnswerList, (answerItem) => {
return <span>{answerItem}</span>;
})}
</div>
);
});
}
// this.renderGapFillingAnswer(gapFillingAnswerList)
} else {
const correctAnswerOption = _.filter(
optionList,
(item) => item.isCorrectAnswer === 1
);
const correctOptionSort =
correctAnswerOption.length > 0 &&
correctAnswerOption.map((item) => {
return NUM_TO_WORD_MAP[item.optionSort];
});
return (
<div className="answer-line__item">
<span>正确答案</span>
<span>{correctOptionSort.join("、")}</span>
</div>
);
}
};
renderMediaContent = (mediaContent) => { renderMediaContent = (mediaContent) => {
return ( return (
<div className="media"> <div className="media">
...@@ -221,6 +257,7 @@ class PaperPreviewModal extends Component { ...@@ -221,6 +257,7 @@ class PaperPreviewModal extends Component {
questionType, questionType,
score, score,
} = questionItem; } = questionItem;
console.log(optionList);
return ( return (
<div className="question-info-item"> <div className="question-info-item">
{this.renderStem( {this.renderStem(
...@@ -230,13 +267,13 @@ class PaperPreviewModal extends Component { ...@@ -230,13 +267,13 @@ class PaperPreviewModal extends Component {
questionIndex questionIndex
)} )}
{_.map(optionList, (optionItem, optionIndex) => { {_.map(optionList, (optionItem, optionIndex) => {
return this.renderOption( return this.renderOption(optionItem, questionType);
optionItem,
questionType,
optionIndex
);
})} })}
{/* {this.renderAnswer(gapFillingAnswerList, questionType)} */} {this.renderAnswer(
optionList,
gapFillingAnswerList,
questionType
)}
</div> </div>
); );
})} })}
......
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