Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
22523b6c
Commit
22523b6c
authored
Jun 09, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ai测试
parent
efaeef74
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
28 deletions
+11
-28
src/components/ai-test/exam/index.js
+1
-1
src/components/ai-test/index.js
+0
-18
src/components/ai-test/scores/index.scss
+1
-0
src/components/ai-test/submit-answer/index.js
+9
-9
No files found.
src/components/ai-test/exam/index.js
View file @
22523b6c
...
...
@@ -152,7 +152,7 @@ class Exam extends Component {
const
{
answer
,
time
,
recordId
,
elapsed
}
=
this
.
state
const
{
history
}
=
this
.
props
clearInterval
(
this
.
timer
)
this
.
store
.
setAll
({
time
,
answer
,
recordId
,
elapsed
})
this
.
store
.
se
ssion
.
se
tAll
({
time
,
answer
,
recordId
,
elapsed
})
history
.
push
(
'/ai-test/submit'
)
}
...
...
src/components/ai-test/index.js
View file @
22523b6c
...
...
@@ -8,27 +8,9 @@ import Analysis from "@components/ai-test/analysis"
import
Assist
from
"@components/ai-test/assist"
import
Help
from
'@components/ai-test/share'
import
Report
from
'@components/ai-test/report'
import
storage
from
'store2'
class
AiTest
extends
Component
{
examStore
=
storage
.
namespace
(
'aiTestExam'
)
componentDidMount
()
{
window
.
addEventListener
(
'beforeunload'
,
this
.
handleBeforeUnload
)
}
componentWillUnmount
()
{
this
.
handleBeforeUnload
()
window
.
removeEventListener
(
'beforeunload'
,
this
.
handleBeforeUnload
)
}
handleBeforeUnload
=
()
=>
{
this
.
examStore
.
clearAll
()
}
render
()
{
const
{
match
}
=
this
.
props
return
(
...
...
src/components/ai-test/scores/index.scss
View file @
22523b6c
...
...
@@ -296,6 +296,7 @@
padding
:
10px
;
color
:
#fff
;
font-size
:
0
;
z-index
:
100
;
button
{
width
:
100%
;
...
...
src/components/ai-test/submit-answer/index.js
View file @
22523b6c
...
...
@@ -15,20 +15,21 @@ class SubmitAnswer extends Component {
timer
=
null
state
=
{
time
:
this
.
store
.
get
(
'time'
)
||
{
d
:
0
,
h
:
0
,
m
:
0
,
s
:
0
},
answer
:
this
.
store
.
get
(
'answer'
),
recordId
:
this
.
store
.
get
(
'recordId'
),
time
:
this
.
store
.
session
.
get
(
'time'
)
||
{
d
:
0
,
h
:
0
,
m
:
0
,
s
:
0
},
answer
:
this
.
store
.
session
.
get
(
'answer'
),
recordId
:
this
.
store
.
session
.
get
(
'recordId'
),
analysis
:
[],
results
:
[],
elapsed
:
this
.
store
.
get
(
'elapsed'
),
elapsed
:
this
.
store
.
session
.
get
(
'elapsed'
),
}
componentDidMount
()
{
if
(
isEmpty
(
this
.
state
.
answer
)
||
!
this
.
state
.
recordId
)
{
this
.
props
.
history
.
replace
(
'/ai-test'
)
this
.
store
.
remove
(
'submitted'
)
this
.
store
.
session
.
remove
(
'submitted'
)
}
if
(
this
.
store
.
get
(
'submitted'
))
{
console
.
log
(
this
.
store
.
session
.
get
(
'submitted'
))
if
(
this
.
store
.
session
.
get
(
'submitted'
))
{
this
.
getAnalysis
()
}
else
{
this
.
setCounter
()
...
...
@@ -67,7 +68,7 @@ class SubmitAnswer extends Component {
}).
then
(
res
=>
{
const
{
code
,
msg
}
=
res
.
data
if
(
code
===
200
)
{
this
.
store
.
set
(
'submitted'
,
true
)
this
.
store
.
se
ssion
.
se
t
(
'submitted'
,
true
)
clearInterval
(
this
.
timer
)
this
.
props
.
history
.
push
(
'/ai-test/report'
)
}
else
{
...
...
@@ -150,4 +151,4 @@ class SubmitAnswer extends Component {
}
}
export
default
SubmitAnswer
;
\ No newline at end of file
export
default
SubmitAnswer
;
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