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
dd8a438d
Commit
dd8a438d
authored
Mar 25, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:填空测试
parent
b45fc574
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
21 deletions
+36
-21
src/modules/teach-tool/AddNewQuestion.jsx
+1
-3
src/modules/teach-tool/components/NewQuestionTab.jsx
+35
-17
src/modules/teach-tool/components/QuestionEditor.jsx
+0
-1
No files found.
src/modules/teach-tool/AddNewQuestion.jsx
View file @
dd8a438d
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-25 13:46:35
* @LastEditors: yuananting
* @LastEditTime: 2021-03-25 1
6:56:40
* @LastEditTime: 2021-03-25 1
8:25:34
* @Description: 助学工具-题库-题目管理-新增题目
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -95,7 +95,6 @@ class AddNewQuestion extends Component {
return
item
;
})
.
join
(
""
);
console
.
log
(
"1.接口返回:"
,
result
)
this
.
setState
({
gapFillingContent
:
result
});
break
;
case
"INDEFINITE_CHOICE"
:
...
...
@@ -284,7 +283,6 @@ class AddNewQuestion extends Component {
gapFillingContent
,
indefiniteChoiceContent
,
}
=
this
.
state
;
console
.
log
(
"2.主页面渲染:"
,
gapFillingContent
)
const
categoryId
=
getParameterByName
(
"categoryId"
);
return
(
<
div
className=
"page add-new-question"
>
...
...
src/modules/teach-tool/components/NewQuestionTab.jsx
View file @
dd8a438d
...
...
@@ -2,12 +2,21 @@
* @Author: yuananting
* @Date: 2021-02-25 14:34:29
* @LastEditors: yuananting
* @LastEditTime: 2021-03-25 1
7:54:40
* @LastEditTime: 2021-03-25 1
8:30:21
* @Description: 助学工具-题库-题目管理-新建题目Tab
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
React
,
{
Component
}
from
"react"
;
import
{
Form
,
Radio
,
message
,
Checkbox
,
Tag
,
Modal
,
Input
,
Popover
}
from
"antd"
;
import
{
Form
,
Radio
,
message
,
Checkbox
,
Tag
,
Modal
,
Input
,
Popover
,
}
from
"antd"
;
import
"./NewQuestionTab.less"
;
import
QuestionEditor
from
"./QuestionEditor"
;
import
{
PlusOutlined
,
CloseOutlined
}
from
"@ant-design/icons"
;
...
...
@@ -33,7 +42,6 @@ class NewQuestionTab extends Component {
questionAnswerDescList
,
showBox
,
}
=
questionInfo
;
console
.
log
(
"3. 子组件接收:"
,
gapFillingAnswerList
)
this
.
state
=
{
stemContent
:
JSON
.
parse
(
JSON
.
stringify
(
questionStemList
)),
// 题干内容
gapFillingAnswer
:
JSON
.
parse
(
JSON
.
stringify
(
gapFillingAnswerList
)),
// 填空题-选项列表
...
...
@@ -95,15 +103,18 @@ class NewQuestionTab extends Component {
}
shouldComponentUpdate
(
nextProps
,
nextState
)
{
console
.
log
(
"nextProps"
,
nextProps
)
const
{
questionInfo
}
=
nextProps
;
if
(
this
.
props
.
questionInfo
!==
questionInfo
)
{
// if (questionInfo.gapFillingAnswerList !== this.state.gapFillingAnswer) {
console
.
log
(
"4. 组件更新:"
,
questionInfo
.
gapFillingAnswerList
)
this
.
setState
(
{
console
.
log
(
"4. 组件更新:"
,
questionInfo
.
gapFillingAnswerList
);
this
.
setState
(
{
gapFillingAnswer
:
JSON
.
parse
(
JSON
.
stringify
(
questionInfo
.
gapFillingAnswerList
)),
},
()
=>
console
.
log
(
"___________________"
,
this
.
state
.
gapFillingAnswer
));
// }
JSON
.
stringify
(
questionInfo
.
gapFillingAnswerList
)
),
},
()
=>
console
.
log
(
"___________________"
,
this
.
state
.
gapFillingAnswer
)
);
this
.
setState
(
{
stemContent
:
JSON
.
parse
(
...
...
@@ -575,13 +586,9 @@ class NewQuestionTab extends Component {
}
changeBlankCount
=
(
data
,
idx
)
=>
{
console
.
log
(
"__changeBlankCount_data___"
,
data
)
console
.
log
(
111
,
data
,
idx
);
const
{
gapFillingAnswer
}
=
this
.
state
;
console
.
log
(
"88888___gapFillingAnswer__"
,
this
.
state
.
gapFillingAnswer
)
let
_gap
=
this
.
state
.
gapFillingAnswer
;
console
.
log
(
"___gap0000"
,
_gap
,
this
.
state
.
gapFillingAnswer
)
console
.
log
(
"___changeBlankCount__gapFillingAnswer____"
,
gapFillingAnswer
)
console
.
log
(
"***_gap:111"
,
_gap
)
if
(
data
.
length
<=
idx
)
{
_gap
.
splice
(
idx
,
1
);
}
else
{
...
...
@@ -603,7 +610,6 @@ class NewQuestionTab extends Component {
item
.
editInput
=
false
;
return
item
;
});
console
.
log
(
"***_gap:222"
,
_gap
)
}
this
.
setState
(
...
...
@@ -694,7 +700,6 @@ class NewQuestionTab extends Component {
renderGapFillingAnswer
=
(
optionItem
,
optionIndex
)
=>
{
const
{
gapFillingAnswer
}
=
this
.
state
;
console
.
log
(
"5. 答案渲染:"
,
gapFillingAnswer
)
const
list
=
gapFillingAnswer
[
optionIndex
]
&&
gapFillingAnswer
[
optionIndex
].
correctAnswerList
;
...
...
@@ -1183,7 +1188,20 @@ class NewQuestionTab extends Component {
label=
{
<
span
>
答案
{
" "
}
<
Popover
content=
{
<
div
><
div
style=
{
{
marginBottom
:
"16px"
}
}
>
一空可设置多个答案,答对任意一个即视为正确
</
div
><
img
width=
"400px"
src=
"https://image.xiaomaiketang.com/xm/gaptip.png"
alt=
""
/></
div
>
}
>
<
Popover
content=
{
<
div
>
<
div
style=
{
{
marginBottom
:
"16px"
}
}
>
一空可设置多个答案,答对任意一个即视为正确
</
div
>
<
img
width=
"400px"
src=
"https://image.xiaomaiketang.com/xm/gaptip.png"
alt=
""
/>
</
div
>
}
>
<
span
className=
"icon iconfont"
style=
{
{
color
:
"#BFBFBF"
,
fontSize
:
14
}
}
...
...
src/modules/teach-tool/components/QuestionEditor.jsx
View file @
dd8a438d
...
...
@@ -160,7 +160,6 @@ class QuestionEditor extends Component {
}
editorRoot
.
config
.
onchange
=
(
html
)
=>
{
console
.
log
(
"onchange"
)
const
conLen
=
html
.
replace
(
/<
(?!
img|input
)
.*
?
>/g
,
""
).
length
;
counter
++
;
const
{
focusFlag
}
=
this
.
state
;
...
...
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