Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeekLearnMathWeapp
Project
Project
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
frontend
GeekLearnMathWeapp
Commits
5955f8dd
Commit
5955f8dd
authored
Jul 14, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: fix skynet error
parent
94fd1b39
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
index.tsx
src/components/UserGuideView/index.tsx
+1
-0
utils.ts
src/pages/game/play/model/utils.ts
+6
-6
answer-blank.tsx
src/pages/game/wrong/components/answer-blank.tsx
+1
-1
No files found.
src/components/UserGuideView/index.tsx
View file @
5955f8dd
...
...
@@ -46,6 +46,7 @@ function UserGuideView<T extends ComponentType<any> = typeof View> (props: UserG
createSelectorQuery
()
.
select
(
`#
${
domRef
.
current
.
uid
}
`
)
.
boundingClientRect
().
exec
(([
_rect
])
=>
{
if
(
!
_rect
)
return
setRect
({
...
_rect
,
top
:
_rect
.
top
+
scrollRef
.
current
})
setIsActive
(
true
)
})
...
...
src/pages/game/play/model/utils.ts
View file @
5955f8dd
...
...
@@ -102,7 +102,7 @@ function convert (inQuestion: QuestionType): CompleteQuestion {
if
(
isSelectionQuestion
(
inQuestion
))
{
return
{
...
inQuestion
,
userAnswers
:
inQuestion
.
options
.
filter
(
c
=>
c
.
userAnswer
).
map
(
c
=>
c
.
index
)
userAnswers
:
inQuestion
.
options
.
filter
(
c
=>
c
?.
userAnswer
).
map
(
c
=>
c
?
.
index
)
}
}
...
...
@@ -114,7 +114,7 @@ function convert (inQuestion: QuestionType): CompleteQuestion {
)
{
return
{
...
inQuestion
,
userAnswers
:
inQuestion
.
answers
.
map
(
c
=>
c
.
userAnswer
!
),
userAnswers
:
inQuestion
.
answers
.
map
(
c
=>
c
?
.
userAnswer
!
),
}
}
...
...
@@ -124,7 +124,7 @@ function convert (inQuestion: QuestionType): CompleteQuestion {
/** 已答题目 */
export
function
answeredQuestion
(
question
:
QuestionType
)
{
if
(
isSelectionQuestion
(
question
))
{
return
question
.
options
.
some
(
c
=>
c
.
userAnswer
)
return
question
.
options
.
some
(
c
=>
c
?
.
userAnswer
)
}
if
(
...
...
@@ -133,7 +133,7 @@ export function answeredQuestion (question: QuestionType) {
isFractionAddMinusQuestion
(
question
)
||
isVerticalAddMinusQuestion
(
question
)
)
{
return
question
.
answers
.
every
(
c
=>
c
.
userAnswer
)
return
question
.
answers
.
every
(
c
=>
c
?
.
userAnswer
)
}
throw
new
Error
(
'question type not supported'
)
...
...
@@ -142,7 +142,7 @@ export function answeredQuestion (question: QuestionType) {
/** 判题 */
export
function
determinQuestion
(
question
:
QuestionType
)
{
if
(
isSelectionQuestion
(
question
))
{
return
question
.
options
.
every
(
c
=>
c
.
answer
===
c
.
userAnswer
)
return
question
.
options
.
every
(
c
=>
c
.
answer
===
c
?
.
userAnswer
)
}
if
(
...
...
@@ -151,7 +151,7 @@ export function determinQuestion (question: QuestionType) {
isFractionAddMinusQuestion
(
question
)
||
isVerticalAddMinusQuestion
(
question
)
)
{
return
question
.
answers
.
every
(
c
=>
c
.
userAnswer
===
c
.
contentText
)
return
question
.
answers
.
every
(
c
=>
c
?
.
userAnswer
===
c
.
contentText
)
}
throw
new
Error
(
'question type not supported'
)
...
...
src/pages/game/wrong/components/answer-blank.tsx
View file @
5955f8dd
...
...
@@ -30,7 +30,7 @@ const AnswerBlank = (props: AnswerBlankProps) => {
},
[
question
])
const
isWrong
=
useMemo
(()
=>
{
return
currentInputOption
?.
contentText
!==
currentInputOption
.
userAnswer
||
!
currentInput
return
currentInputOption
?.
contentText
!==
currentInputOption
?
.
userAnswer
||
!
currentInput
},
[
currentInputOption
,
currentInput
])
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