Commit de92f985 by yuananting

feat:编辑预览接口联调

parent 8bde2114
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-03 15:13:12 * @Date: 2021-03-03 15:13:12
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-01 15:36:48 * @LastEditTime: 2021-04-02 14:12:49
* @Description: 助学工具接口 * @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -71,4 +71,8 @@ export function queryPaperDetail(params: object) { ...@@ -71,4 +71,8 @@ export function queryPaperDetail(params: object) {
export function viewPaper(params: object) { export function viewPaper(params: object) {
return Service.Hades("public/hades/viewPaper", params); return Service.Hades("public/hades/viewPaper", params);
}
export function editPaper(params: object) {
return Service.Hades("public/hades/editPaper", params);
} }
\ No newline at end of file
...@@ -2,11 +2,29 @@ ...@@ -2,11 +2,29 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-11 11:34:37 * @Date: 2021-03-11 11:34:37
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-01 20:09:12 * @LastEditTime: 2021-04-02 14:14:06
* @Description: 助学工具接口 * @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import { queryCategoryTree, addCategory, delCategory, editCategory, editCategoryTree, addQuestion, queryQuestionPageList, deleteQuestion, queryQuestionDetails, editQuestion, batchImport, createPaper, queryPaperPageList, deletePaper, queryPaperDetail, viewPaper } from '@/data-source/aidTool/request-apis'; import {
queryCategoryTree,
addCategory,
delCategory,
editCategory,
editCategoryTree,
addQuestion,
queryQuestionPageList,
deleteQuestion,
queryQuestionDetails,
editQuestion,
batchImport,
createPaper,
queryPaperPageList,
deletePaper,
queryPaperDetail,
viewPaper,
editPaper
} from '@/data-source/aidTool/request-apis';
export default class AidToolService { export default class AidToolService {
// 获取题目分类树 // 获取题目分类树
static queryCategoryTree(params: any) { static queryCategoryTree(params: any) {
...@@ -87,4 +105,9 @@ export default class AidToolService { ...@@ -87,4 +105,9 @@ export default class AidToolService {
static viewPaper(params: any) { static viewPaper(params: any) {
return viewPaper(params); return viewPaper(params);
} }
// 编辑试卷
static editPaper(params: any) {
return editPaper(params);
}
} }
\ No newline at end of file
...@@ -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-02 12:42:42 * @LastEditTime: 2021-04-02 15:07:17
* @Description: 助学工具-试卷-预览试卷 * @Description: 助学工具-试卷-预览试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -145,7 +145,6 @@ class PaperPreviewModal extends Component { ...@@ -145,7 +145,6 @@ class PaperPreviewModal extends Component {
if (questionType === "GAP_FILLING") { if (questionType === "GAP_FILLING") {
{ {
_.map(gapFillingAnswerList, (gapItem, gapIndex) => { _.map(gapFillingAnswerList, (gapItem, gapIndex) => {
console.log("gapFillingAnswerList", gapFillingAnswerList)
const { correctAnswerList } = gapItem; const { correctAnswerList } = gapItem;
return ( return (
<div> <div>
...@@ -157,7 +156,6 @@ class PaperPreviewModal extends Component { ...@@ -157,7 +156,6 @@ class PaperPreviewModal extends Component {
); );
}); });
} }
// this.renderGapFillingAnswer(gapFillingAnswerList)
} else { } else {
const correctAnswerOption = _.filter( const correctAnswerOption = _.filter(
optionList, optionList,
...@@ -171,7 +169,7 @@ class PaperPreviewModal extends Component { ...@@ -171,7 +169,7 @@ class PaperPreviewModal extends Component {
return ( return (
<div className="answer-line__item"> <div className="answer-line__item">
<span>正确答案</span> <span>正确答案</span>
<span>{correctOptionSort.join("、")}</span> {/* <span>【{correctOptionSort.join("、")}】</span> */}
</div> </div>
); );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-29 10:52:26 * @Date: 2021-03-29 10:52:26
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-01 14:01:06 * @LastEditTime: 2021-04-02 19:41:26
* @Description: 助学工具-新建试卷-选择题目弹窗 * @Description: 助学工具-新建试卷-选择题目弹窗
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -21,6 +21,16 @@ class SelectQuestionModal extends Component { ...@@ -21,6 +21,16 @@ class SelectQuestionModal extends Component {
}; };
} }
componentDidMount() {
this.listRef.current.state.selectQuestionKeys = this.props.getSelectedQuestion.map(
(item) => {
item.id = item.questionId;
item.questionTypeEnum = item.questionType;
return item;
}
);
}
getCategoryIdFromSider = (selectedCategoryId) => { getCategoryIdFromSider = (selectedCategoryId) => {
if (selectedCategoryId && selectedCategoryId.length > 0) { if (selectedCategoryId && selectedCategoryId.length > 0) {
this.setState({ selectedCategoryId: selectedCategoryId[0] }); this.setState({ selectedCategoryId: selectedCategoryId[0] });
...@@ -37,14 +47,15 @@ class SelectQuestionModal extends Component { ...@@ -37,14 +47,15 @@ class SelectQuestionModal extends Component {
onOk={() => { onOk={() => {
this.props.setSelectedQuestion( this.props.setSelectedQuestion(
this.listRef.current.state.selectQuestionKeys.map((item) => { this.listRef.current.state.selectQuestionKeys.map((item) => {
item.questionType = item.questionTypeEnum; item.questionId = item.id || item.questionId;
item.score = 2; item.questionType = item.questionTypeEnum || item.questionType;
item.score = item.score || 2;
if ( if (
["MULTI_CHOICE", "GAP_FILLING", "INDEFINITE_CHOICE"].includes( ["MULTI_CHOICE", "GAP_FILLING", "INDEFINITE_CHOICE"].includes(
item.questionTypeEnum item.questionTypeEnum
) )
) { ) {
item.portionScore = 0; item.portionScore = item.portionScore || 0;
} }
return item; return item;
}) })
......
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