Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
449c3bb3
Commit
449c3bb3
authored
Jun 09, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Plain Diff
fix:解决题库样式调整合并冲突
parents
b77bf3a8
3867d55e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
18 deletions
+68
-18
src/modules/teach-tool/paper-manage/OperatePaper.jsx
+48
-2
src/modules/teach-tool/question-manage/components/OperateQuestionTab.jsx
+20
-16
No files found.
src/modules/teach-tool/paper-manage/OperatePaper.jsx
View file @
449c3bb3
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-03-27 16:15:13
* @LastEditors: yuananting
* @LastEditTime: 2021-06-0
8 10:44:42
* @LastEditTime: 2021-06-0
9 12:03:58
* @Description: 助学工具-新建/复制/编辑试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -73,7 +73,7 @@ class OperatePaper extends Component {
},
selectQuestionModal
:
null
,
paperPreviewModal
:
null
,
quickSortModalVisible
:
false
,
quickSortModalVisible
:
false
,
// 快捷排序弹窗显隐
selectQuestionList
:
[],
currentOperate
:
""
,
currentNav
:
""
,
...
...
@@ -736,6 +736,52 @@ class OperatePaper extends Component {
totalScore
,
}
=
formData
;
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
(
<
div
>
<
div
className=
"page operate-paper-page"
>
...
...
src/modules/teach-tool/question-manage/components/OperateQuestionTab.jsx
View file @
449c3bb3
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-25 14:34:29
* @LastEditors: yuananting
* @LastEditTime: 2021-06-0
4 17:09:2
5
* @LastEditTime: 2021-06-0
9 12:02:5
5
* @Description: 助学工具-题库-操作题目Tab
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -67,10 +67,16 @@ class OperateQuestionTab extends Component {
componentDidMount
()
{
const
{
questionTypeKey
}
=
this
.
props
;
const
isEditCurrent
=
getParameterByName
(
"id"
)
&&
getParameterByName
(
"type"
)
===
questionTypeKey
;
const
isEditCurrent
=
getParameterByName
(
"id"
)
&&
getParameterByName
(
"type"
)
===
questionTypeKey
;
const
optionSize
=
isEditCurrent
?
20
:
4
;
if
([
"INDEFINITE_CHOICE"
,
"MULTI_CHOICE"
,
"SINGLE_CHOICE"
].
includes
(
questionTypeKey
))
{
// 选择题(单选 多选 不定项)-插入4条默认选项
if
(
[
"INDEFINITE_CHOICE"
,
"MULTI_CHOICE"
,
"SINGLE_CHOICE"
].
includes
(
questionTypeKey
)
)
{
// 选择题(单选 多选 不定项)-插入4条默认选项
for
(
var
i
=
0
;
i
<
optionSize
;
i
++
)
{
this
.
handleAddOption
();
this
.
setState
({
...
...
@@ -630,9 +636,9 @@ class OperateQuestionTab extends Component {
this
.
state
.
stemContent
,
(
contentItem
)
=>
contentItem
.
type
===
"RICH_TEXT"
);
if
(
stemContent
.
textLength
>
1000
)
{
if
(
stemContent
.
textLength
>
1000
)
{
validateError
++
;
}
}
let
stem
=
stemContent
.
content
.
replace
(
/<
[^
>
]
+>/g
,
""
);
stem
=
stem
.
replace
(
/
\&
nbsp
\;
/gi
,
""
);
stem
=
stem
.
replace
(
/
\s
+/g
,
""
);
...
...
@@ -690,7 +696,7 @@ class OperateQuestionTab extends Component {
optionUnChecked
=
item
.
isCorrectAnswer
?
optionUnChecked
:
optionUnChecked
+
1
;
if
(
optionContent
[
0
].
textLength
>
1000
)
{
if
(
optionContent
[
0
].
textLength
>
1000
)
{
validateError
++
;
}
let
optionInput
=
optionContent
[
0
].
content
.
replace
(
/<
[^
>
]
+>/g
,
""
);
...
...
@@ -1036,11 +1042,11 @@ class OperateQuestionTab extends Component {
return
dom
?
(
<
div
className=
"question-item_question-content"
style=
{
{
display
:
[
"PICTURE"
,
"VIDEO"
].
includes
(
type
)
?
"inline-grid"
:
"flex"
,
}
}
style=
{
!
[
"PICTURE"
,
"VIDEO"
].
includes
(
type
)
?
{
display
:
"flex"
}
:
{
float
:
"left"
}
}
key=
{
index
}
>
{
dom
}
...
...
@@ -1190,10 +1196,8 @@ class OperateQuestionTab extends Component {
data
-
label=
"正确答案"
>
{
_
.
map
(
chooseOptions
,
(
optionItem
,
optionIndex
)
=>
{
const
{
questionOptionContentList
,
isCorrectAnswer
,
}
=
optionItem
;
const
{
questionOptionContentList
,
isCorrectAnswer
}
=
optionItem
;
optionItem
.
optionSort
=
optionIndex
;
const
mediaBtn
=
[
"VOICE"
,
"AUDIO"
,
"PICTURE"
];
const
placeHold
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment