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
d1475467
Commit
d1475467
authored
Jun 30, 2021
by
maolipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:批量设置分数
parent
6a970535
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
src/modules/teach-tool/paper-manage/OperatePaper.jsx
+28
-1
src/modules/teach-tool/paper-manage/components/BatchScore.tsx
+2
-2
No files found.
src/modules/teach-tool/paper-manage/OperatePaper.jsx
View file @
d1475467
...
...
@@ -776,7 +776,34 @@ class OperatePaper extends Component {
}
return
item
})
this
.
setState
({
selectQuestionList
:
questionList
})
// 各类型题目总分值
const
{
formData
,
scoreRule
}
=
this
.
state
const
{
singleChoiceCnt
,
multiChoiceCnt
,
judgeCnt
,
gapFillingCnt
,
indefiniteChoiceCnt
}
=
formData
const
singleChoiceScore
=
singleChoiceCnt
*
scoreRule
.
find
((
item
)
=>
{
return
item
.
typeKey
===
"SINGLE_CHOICE"
}).
score
const
multiChoiceScore
=
multiChoiceCnt
*
scoreRule
.
find
((
item
)
=>
{
return
item
.
typeKey
===
"MULTI_CHOICE"
}).
score
const
judgeScore
=
judgeCnt
*
scoreRule
.
find
((
item
)
=>
{
return
item
.
typeKey
===
"JUDGE"
}).
score
const
gapFillingScore
=
gapFillingCnt
*
scoreRule
.
find
((
item
)
=>
{
return
item
.
typeKey
===
"GAP_FILLING"
}).
score
const
indefiniteChoiceScore
=
indefiniteChoiceCnt
*
scoreRule
.
find
((
item
)
=>
{
return
item
.
typeKey
===
"INDEFINITE_CHOICE"
}).
score
const
totalScore
=
questionList
.
reduce
((
prev
,
cur
)
=>
{
return
prev
+
Number
(
cur
.
score
)
||
0
;
},
0
);
const
passScore
=
Math
.
round
(
totalScore
*
formData
.
passRate
*
0.01
);
debugger
this
.
setState
({
selectQuestionList
:
questionList
,
formData
:
{
...
formData
,
singleChoiceScore
,
multiChoiceScore
,
judgeScore
,
gapFillingScore
,
indefiniteChoiceScore
,
totalScore
,
passScore
,
}
})
})
}
// 上下移题型
...
...
src/modules/teach-tool/paper-manage/components/BatchScore.tsx
View file @
d1475467
...
...
@@ -28,6 +28,7 @@ export default function BatchScore(props:BatchScoreProps) {
useEffect
(()
=>
{
_
.
map
(
props
.
rules
,(
item
)
=>
{
//更新分数统计
switch
(
item
.
typeKey
)
{
case
"SINGLE_CHOICE"
:
setSingleCount
([
item
.
totalQuestion
,
item
.
totalQuestion
*
item
.
score
])
...
...
@@ -48,8 +49,7 @@ export default function BatchScore(props:BatchScoreProps) {
break
;
}
})
console
.
log
(
"KKKKKKKKKKKKKKK"
)
},[
rules
])
},[
props
.
rules
,
rules
])
if
(
!
props
.
visible
)
{
return
(
""
)
...
...
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