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
bd29897e
Commit
bd29897e
authored
Jun 09, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ai测试
parent
a3d1d96a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
31 deletions
+9
-31
src/components/ai-test/analysis/index.js
+2
-1
src/components/ai-test/assist/index.js
+6
-4
src/components/ai-test/common/recommends/index.js
+1
-26
No files found.
src/components/ai-test/analysis/index.js
View file @
bd29897e
...
...
@@ -86,7 +86,8 @@ class Analysis extends Component {
<
/div
>
<
/div
>
{
!!
questions
.
length
&&
questions
[
activeIndex
].
type_id
&&
<
Recommends
typeId
=
{
questions
[
activeIndex
].
type_id
}
/
>
!!
questions
.
length
&&
questions
[
activeIndex
]
&&
questions
[
activeIndex
].
commend_course
&&
!!
questions
[
activeIndex
].
commend_course
.
length
&&
<
Recommends
recommends
=
{
questions
[
activeIndex
].
commend_course
}
/
>
}
<
Navigation
questions
=
{
questions
}
isAnalysis
=
{
true
}
handleClick
=
{(
index
)
=>
{
this
.
setState
({
...
...
src/components/ai-test/assist/index.js
View file @
bd29897e
...
...
@@ -115,7 +115,8 @@ class Assist extends Component {
<
div
style
=
{{
height
:
'8px'
,
backgroundColor
:
'#f5f5f5'
}}
><
/div
>
{
result
&&
<
div
className
=
"content"
>
<
div
class
=
{
'info'
}
>
您的选择是
{
userAnswer
}
,正确答案是
{
rightAnswer
}
回答
{
userAnswer
===
rightAnswer
?
'正确'
:
'错误'
}
<
/div
>
<
div
className
=
{
'info'
}
>
您的选择是
{
userAnswer
}
,正确答案是
{
rightAnswer
}
回答
{
userAnswer
===
rightAnswer
?
'正确'
:
'错误'
}
<
/div
>
<
div
className
=
"head"
>
<
i
className
=
"icon"
><
/i
>
<
span
>
解析
<
/span
>
...
...
@@ -124,8 +125,8 @@ class Assist extends Component {
<
/div
>
}
{
result
&&
<>
<
Recommends
typeId
=
{
question
.
type_id
}
/
>
result
&&
question
.
commend_course
&&
question
.
commend_course
.
length
&&
<>
<
Recommends
recommends
=
{
question
.
commend_course
}
/
>
<
div
className
=
{
classnames
([
'status'
,
{
end
:
result
.
status
===
6
,
success
:
result
.
status
===
1
,
...
...
@@ -152,6 +153,6 @@ class Assist extends Component {
}
export
default
connect
(
state
=>
state
.
user
,
({
user
})
=>
({
user
})
,
null
,
)(
Assist
)
\ No newline at end of file
src/components/ai-test/common/recommends/index.js
View file @
bd29897e
import
React
,
{
Component
}
from
'react'
;
import
'./index.scss'
import
{
http
}
from
"@/utils"
import
{
Toast
}
from
"antd-mobile"
;
import
{
Link
}
from
"react-router-dom"
;
class
Recommends
extends
Component
{
state
=
{
recommends
:
[],
}
componentDidMount
()
{
this
.
props
.
typeId
&&
this
.
getRecommends
(
this
.
props
.
typeId
)
}
getRecommends
=
(
typeId
)
=>
{
http
.
post
(
`
${
API
.
home
}
/sys/get_commend_course`
,
{
type_id
:
typeId
,
}).
then
(
res
=>
{
const
{
code
,
msg
,
data
}
=
res
.
data
if
(
code
===
200
)
{
this
.
setState
({
recommends
:
data
,
})
}
else
{
Toast
.
fail
(
msg
,
2
,
null
,
msg
)
}
})
}
render
()
{
const
{
recommends
}
=
this
.
state
const
{
recommends
}
=
this
.
props
return
(
<
div
className
=
"recommends"
>
<
div
>
相关课程
<
/div
>
...
...
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