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
83db1f02
Commit
83db1f02
authored
Jul 01, 2021
by
maolipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:.........
parent
7ba3f190
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
23 deletions
+19
-23
src/modules/teach-tool/paper-manage/components/BatchScore.tsx
+19
-23
No files found.
src/modules/teach-tool/paper-manage/components/BatchScore.tsx
View file @
83db1f02
...
...
@@ -4,7 +4,7 @@ import "./BatchScore.less"
import
_
from
"underscore"
;
interface
Rule
{
typeKey
:
"
SINGLE_CHOICE"
|
"MULTI_CHOICE"
|
"JUDGE"
|
"GAP_FILLING"
|
"INDEFINIT
E_CHOICE"
,
typeKey
:
"
GAP_FILLING"
|
"INDEFINITE_CHOICE"
|
"JUDGE"
|
"MULTI_CHOICE"
|
"SINGL
E_CHOICE"
,
score
:
number
,
portionScore
:
number
,
totalQuestion
:
number
,
...
...
@@ -19,7 +19,7 @@ interface BatchScoreProps {
export
default
function
BatchScore
(
props
:
BatchScoreProps
)
{
const
[
rules
,
setRules
]
=
useState
<
Rule
[]
>
(
props
.
rules
)
const
[
rules
,
setRules
]
=
useState
<
Rule
[]
>
(
_
.
sortBy
(
props
.
rules
,
"typeKey"
)
)
const
[
singleCount
,
setSingleCount
]
=
useState
<
number
[]
>
([
0
])
const
[
multiCount
,
setMultiCount
]
=
useState
<
number
[]
>
([
0
])
const
[
judgeCount
,
setJudgeCount
]
=
useState
<
number
[]
>
([
0
])
...
...
@@ -81,15 +81,14 @@ export default function BatchScore(props:BatchScoreProps) {
<
InputNumber
min=
{
1
}
max=
{
100
}
defaultValue=
{
_
.
find
(
rules
,(
it
)
=>
{
return
it
.
typeKey
===
"SINGLE_CHOICE"
})?.
score
}
value=
{
rules
[
4
].
score
}
defaultValue=
{
rules
[
4
].
score
}
style=
{
inputNumberStyle
}
onChange=
{
(
v
)
=>
{
setRules
(
_
.
map
(
rules
,(
item
)
=>
{
if
(
item
.
typeKey
===
"SINGLE_CHOICE"
)
{
item
.
score
=
Number
(
v
)
}
return
item
}))
v
=
Math
.
round
(
v
)
let
_rules
=
[...
rules
]
rules
[
4
].
score
=
v
setRules
(
_rules
)
}
}
/>
分
</
span
>
...
...
@@ -101,30 +100,27 @@ export default function BatchScore(props:BatchScoreProps) {
<
InputNumber
min=
{
1
}
max=
{
100
}
defaultValue=
{
_
.
find
(
rules
,(
it
)
=>
{
return
it
.
typeKey
===
"MULTI_CHOICE"
})?.
score
}
defaultValue=
{
rules
[
3
].
score
}
value=
{
rules
[
3
].
score
}
style=
{
inputNumberStyle
}
onChange=
{
(
v
)
=>
{
setRules
(
_
.
map
(
rules
,(
item
)
=>
{
if
(
item
.
typeKey
===
"MULTI_CHOICE"
)
{
item
.
score
=
Number
(
v
)
}
return
item
}))
v
=
Math
.
round
(
v
)
let
_r
=
[...
rules
]
_r
[
3
].
score
=
v
setRules
(
_r
)
}
}
/>
分,漏选得
<
InputNumber
min=
{
0
}
max=
{
_
.
find
(
rules
,(
it
)
=>
{
return
it
.
typeKey
===
"MULTI_CHOICE"
})?
.
score
}
max=
{
rules
[
3
]
.
score
}
defaultValue=
{
0
}
style=
{
inputNumberStyle
}
onChange=
{
(
v
)
=>
{
setRules
(
_
.
map
(
rules
,(
item
)
=>
{
if
(
item
.
typeKey
===
"MULTI_CHOICE"
)
{
item
.
portionScore
=
Number
(
v
)
}
return
item
}))
v
=
Math
.
round
(
v
)
let
_r
=
[...
rules
]
_r
[
3
].
portionScore
=
v
setRules
(
_r
)
}
}
/>
分
</
span
>
...
...
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