Commit 449c3bb3 by yuananting

fix:解决题库样式调整合并冲突

parents b77bf3a8 3867d55e
...@@ -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-06-08 10:44:42 * @LastEditTime: 2021-06-09 12:03:58
* @Description: 助学工具-新建/复制/编辑试卷 * @Description: 助学工具-新建/复制/编辑试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -73,7 +73,7 @@ class OperatePaper extends Component { ...@@ -73,7 +73,7 @@ class OperatePaper extends Component {
}, },
selectQuestionModal: null, selectQuestionModal: null,
paperPreviewModal: null, paperPreviewModal: null,
quickSortModalVisible: false, quickSortModalVisible: false, // 快捷排序弹窗显隐
selectQuestionList: [], selectQuestionList: [],
currentOperate: "", currentOperate: "",
currentNav: "", currentNav: "",
...@@ -736,6 +736,52 @@ class OperatePaper extends Component { ...@@ -736,6 +736,52 @@ class OperatePaper extends Component {
totalScore, totalScore,
} = formData; } = formData;
const { match } = this.props; const { match } = this.props;
const selectQuestionList = [...this.state.selectQuestionList];
const questionTypeEnum = {
SINGLE_CHOICE: "【单选题】",
MULTI_CHOICE: "【多选题】",
JUDGE: "【判断题】",
GAP_FILLING: "【填空题】",
INDEFINITE_CHOICE: "【不定项选择题】",
};
const typeColumns = [
{
title: "题型",
dataIndex: "typeKey",
key: "typeKey",
render: (text, record, index) => <span style={{color: '#333333'}}>{questionTypeEnum[text]}</span>,
},
{
title: "操作",
key: "action",
align: 'right',
render: (text, record, index) => (
<Space size="middle">
<span
style={{color: index > 0 ? '#2966FF' : '#CCCCCC', cursor: 'pointer'}}
onClick={() => {
index > 0 && this.handleMoveTypeSorter(index, -1);
}}
>
上移
</span>
<span style={{color: '#BFBFBF'}}> | </span>
<span
style={{color: index < 4 ? '#2966FF' : '#CCCCCC', cursor: 'pointer'}}
onClick={() => {
index < 4 && this.handleMoveTypeSorter(index, 1);
}}
>
下移
</span>
</Space>
),
},
];
return ( return (
<div> <div>
<div className="page operate-paper-page"> <div className="page operate-paper-page">
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 14:34:29 * @Date: 2021-02-25 14:34:29
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-06-04 17:09:25 * @LastEditTime: 2021-06-09 12:02:55
* @Description: 助学工具-题库-操作题目Tab * @Description: 助学工具-题库-操作题目Tab
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -67,10 +67,16 @@ class OperateQuestionTab extends Component { ...@@ -67,10 +67,16 @@ class OperateQuestionTab extends Component {
componentDidMount() { componentDidMount() {
const { questionTypeKey } = this.props; const { questionTypeKey } = this.props;
const isEditCurrent = getParameterByName("id") && getParameterByName("type") === questionTypeKey; const isEditCurrent =
getParameterByName("id") &&
getParameterByName("type") === questionTypeKey;
const optionSize = isEditCurrent ? 20 : 4; const optionSize = isEditCurrent ? 20 : 4;
if (["INDEFINITE_CHOICE", "MULTI_CHOICE", "SINGLE_CHOICE"].includes(questionTypeKey)) { if (
// 选择题(单选 多选 不定项)-插入4条默认选项 ["INDEFINITE_CHOICE", "MULTI_CHOICE", "SINGLE_CHOICE"].includes(
questionTypeKey
)
) {
// 选择题(单选 多选 不定项)-插入4条默认选项
for (var i = 0; i < optionSize; i++) { for (var i = 0; i < optionSize; i++) {
this.handleAddOption(); this.handleAddOption();
this.setState({ this.setState({
...@@ -630,9 +636,9 @@ class OperateQuestionTab extends Component { ...@@ -630,9 +636,9 @@ class OperateQuestionTab extends Component {
this.state.stemContent, this.state.stemContent,
(contentItem) => contentItem.type === "RICH_TEXT" (contentItem) => contentItem.type === "RICH_TEXT"
); );
if(stemContent.textLength > 1000) { if (stemContent.textLength > 1000) {
validateError++; validateError++;
} }
let stem = stemContent.content.replace(/<[^>]+>/g, ""); let stem = stemContent.content.replace(/<[^>]+>/g, "");
stem = stem.replace(/\&nbsp\;/gi, ""); stem = stem.replace(/\&nbsp\;/gi, "");
stem = stem.replace(/\s+/g, ""); stem = stem.replace(/\s+/g, "");
...@@ -690,7 +696,7 @@ class OperateQuestionTab extends Component { ...@@ -690,7 +696,7 @@ class OperateQuestionTab extends Component {
optionUnChecked = item.isCorrectAnswer optionUnChecked = item.isCorrectAnswer
? optionUnChecked ? optionUnChecked
: optionUnChecked + 1; : optionUnChecked + 1;
if(optionContent[0].textLength > 1000) { if (optionContent[0].textLength > 1000) {
validateError++; validateError++;
} }
let optionInput = optionContent[0].content.replace(/<[^>]+>/g, ""); let optionInput = optionContent[0].content.replace(/<[^>]+>/g, "");
...@@ -1036,11 +1042,11 @@ class OperateQuestionTab extends Component { ...@@ -1036,11 +1042,11 @@ class OperateQuestionTab extends Component {
return dom ? ( return dom ? (
<div <div
className="question-item_question-content" className="question-item_question-content"
style={{ style={
display: ["PICTURE", "VIDEO"].includes(type) !["PICTURE", "VIDEO"].includes(type)
? "inline-grid" ? { display: "flex" }
: "flex", : { float: "left" }
}} }
key={index} key={index}
> >
{dom} {dom}
...@@ -1190,10 +1196,8 @@ class OperateQuestionTab extends Component { ...@@ -1190,10 +1196,8 @@ class OperateQuestionTab extends Component {
data-label="正确答案" data-label="正确答案"
> >
{_.map(chooseOptions, (optionItem, optionIndex) => { {_.map(chooseOptions, (optionItem, optionIndex) => {
const { const { questionOptionContentList, isCorrectAnswer } =
questionOptionContentList, optionItem;
isCorrectAnswer,
} = optionItem;
optionItem.optionSort = optionIndex; optionItem.optionSort = optionIndex;
const mediaBtn = ["VOICE", "AUDIO", "PICTURE"]; const mediaBtn = ["VOICE", "AUDIO", "PICTURE"];
const placeHold = const placeHold =
......
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