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
5cafb6c1
Commit
5cafb6c1
authored
Mar 19, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:填空新增编辑bug
parent
69d82f3b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
11 deletions
+6
-11
src/modules/teach-tool/AddNewQuestion.jsx
+2
-1
src/modules/teach-tool/components/NewQuestionTab.jsx
+3
-3
src/modules/teach-tool/components/QuestionEditor.jsx
+1
-7
No files found.
src/modules/teach-tool/AddNewQuestion.jsx
View file @
5cafb6c1
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-02-25 13:46:35
* @Date: 2021-02-25 13:46:35
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-1
8 14:12:2
2
* @LastEditTime: 2021-03-1
9 19:29:4
2
* @Description: 助学工具-题库-题目管理-新增题目
* @Description: 助学工具-题库-题目管理-新增题目
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -336,6 +336,7 @@ class AddNewQuestion extends Component {
...
@@ -336,6 +336,7 @@ class AddNewQuestion extends Component {
}
}
}
}
questionInfo=
{
gapFillingContent
}
questionInfo=
{
gapFillingContent
}
onSetState=
{
(
newContent
)
=>
{
onSetState=
{
(
newContent
)
=>
{
console
.
log
(
"gapFillingContent:"
,
newContent
)
Object
.
assign
(
gapFillingContent
,
newContent
);
Object
.
assign
(
gapFillingContent
,
newContent
);
}
}
}
}
/>
/>
...
...
src/modules/teach-tool/components/NewQuestionTab.jsx
View file @
5cafb6c1
...
@@ -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-03-19
10:51:4
5
* @LastEditTime: 2021-03-19
20:33:0
5
* @Description: 助学工具-题库-题目管理-新建题目Tab
* @Description: 助学工具-题库-题目管理-新建题目Tab
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -111,7 +111,7 @@ class NewQuestionTab extends Component {
...
@@ -111,7 +111,7 @@ class NewQuestionTab extends Component {
),
),
},
},
()
=>
{
()
=>
{
if
(
this
.
props
.
questionTypeKey
===
"GAP_FillING"
)
{
//
if(this.props.questionTypeKey==="GAP_FillING") {
const
con
=
questionInfo
.
questionStemList
[
0
].
content
;
const
con
=
questionInfo
.
questionStemList
[
0
].
content
;
const
input
=
con
.
match
(
/<input
([^
<>
]
*
)
>/g
)
const
input
=
con
.
match
(
/<input
([^
<>
]
*
)
>/g
)
const
_blanksList
=
input
.
map
(
item
=>
{
const
_blanksList
=
input
.
map
(
item
=>
{
...
@@ -119,7 +119,7 @@ class NewQuestionTab extends Component {
...
@@ -119,7 +119,7 @@ class NewQuestionTab extends Component {
})
})
console
.
log
(
"-----"
,
_blanksList
)
console
.
log
(
"-----"
,
_blanksList
)
this
.
setState
({
blanksList
:
_blanksList
})
this
.
setState
({
blanksList
:
_blanksList
})
}
//
}
}
}
);
// 题干内容
);
// 题干内容
this
.
setState
({
this
.
setState
({
...
...
src/modules/teach-tool/components/QuestionEditor.jsx
View file @
5cafb6c1
...
@@ -143,7 +143,6 @@ class QuestionEditor extends Component {
...
@@ -143,7 +143,6 @@ class QuestionEditor extends Component {
if
(
isEdit
)
{
if
(
isEdit
)
{
const
stemDom
=
document
.
getElementsByClassName
(
"add-fill-line"
);
const
stemDom
=
document
.
getElementsByClassName
(
"add-fill-line"
);
prevList
=
[...
stemDom
].
map
(
item
=>
item
.
id
)
prevList
=
[...
stemDom
].
map
(
item
=>
item
.
id
)
console
.
log
(
'!!!!!!!!!'
,
prevList
)
localStorage
.
setItem
(
'gap_ques_prevList'
,
JSON
.
stringify
(
prevList
));
localStorage
.
setItem
(
'gap_ques_prevList'
,
JSON
.
stringify
(
prevList
));
}
}
let
counter
=
0
let
counter
=
0
...
@@ -166,7 +165,6 @@ class QuestionEditor extends Component {
...
@@ -166,7 +165,6 @@ class QuestionEditor extends Component {
if
(
this
.
state
.
isGapFilling
&&
this
.
state
.
contentType
===
"QUESTION_STEM"
)
{
if
(
this
.
state
.
isGapFilling
&&
this
.
state
.
contentType
===
"QUESTION_STEM"
)
{
const
stemHtml
=
this
.
transferStemDocument
(
html
);
const
stemHtml
=
this
.
transferStemDocument
(
html
);
var
_blanksList
=
stemHtml
.
getElementsByClassName
(
"add-fill-line"
)
var
_blanksList
=
stemHtml
.
getElementsByClassName
(
"add-fill-line"
)
const
ids
=
[...
_blanksList
].
map
(
item
=>
item
.
id
);
const
ids
=
[...
_blanksList
].
map
(
item
=>
item
.
id
);
const
isEdit
=
getParameterByName
(
'id'
);
const
isEdit
=
getParameterByName
(
'id'
);
...
@@ -175,15 +173,11 @@ class QuestionEditor extends Component {
...
@@ -175,15 +173,11 @@ class QuestionEditor extends Component {
prevList
=
prev
&&
JSON
.
parse
(
prev
);
prevList
=
prev
&&
JSON
.
parse
(
prev
);
}
}
console
.
log
(
prevList
,
'++++++++++++++++'
,
ids
)
let
idx
=
0
;
let
idx
=
0
;
if
(
prevList
&&
ids
)
{
if
(
prevList
&&
ids
)
{
idx
=
this
.
getNewArr
(
prevList
,
ids
);
idx
=
this
.
getNewArr
(
prevList
,
ids
);
const
oldLen
=
prevList
.
length
;
const
oldLen
=
prevList
.
length
;
console
.
log
(
555
,
idx
,
oldLen
)
idx
=
idx
>=
oldLen
?
idx
-
oldLen
:
idx
idx
=
idx
>=
oldLen
?
idx
-
oldLen
:
idx
}
}
...
@@ -271,7 +265,7 @@ class QuestionEditor extends Component {
...
@@ -271,7 +265,7 @@ class QuestionEditor extends Component {
this
.
setState
({
this
.
setState
({
visiblePlacehold
:
false
,
visiblePlacehold
:
false
,
});
});
this
.
props
.
changeBlankCount
(
_blanksList
);
//
this.props.changeBlankCount(_blanksList);
};
};
render
()
{
render
()
{
...
...
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