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
2d413a31
Commit
2d413a31
authored
Apr 05, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: log
parent
3c86091c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
utils.ts
src/pages/game/play/model/utils.ts
+13
-1
No files found.
src/pages/game/play/model/utils.ts
View file @
2d413a31
import
{
type
CompleteStageParam
,
type
StageDetail
,
StageLevel
,
type
CompleteQuestion
}
from
'@/api'
import
{
type
CompleteStageParam
,
type
StageDetail
,
StageLevel
,
type
CompleteQuestion
}
from
'@/api'
import
{
getLogManager
}
from
'@tarojs/taro'
import
{
getStorage
,
StorageKeys
}
from
'@/utils/storage'
import
{
type
QuestionType
,
isBlankQuestion
,
isVerticalDivisionQuestion
,
isSelectionQuestion
}
from
'../types'
import
{
type
QuestionType
,
isBlankQuestion
,
isVerticalDivisionQuestion
,
isSelectionQuestion
}
from
'../types'
const
logger
=
getLogManager
({
level
:
1
})
export
function
convertQuestion
(
question
:
QuestionType
):
QuestionType
{
export
function
convertQuestion
(
question
:
QuestionType
):
QuestionType
{
if
(
isVerticalDivisionQuestion
(
question
))
{
if
(
isVerticalDivisionQuestion
(
question
))
{
const
{
questionItems
}
=
question
const
{
questionItems
}
=
question
...
@@ -36,7 +40,13 @@ export function convertQuestion (question: QuestionType): QuestionType {
...
@@ -36,7 +40,13 @@ export function convertQuestion (question: QuestionType): QuestionType {
}
}
export
function
buildCompleteStageParam
(
questionList
:
QuestionType
[],
stageDetail
:
StageDetail
,
resultTime
:
number
):
CompleteStageParam
{
export
function
buildCompleteStageParam
(
questionList
:
QuestionType
[],
stageDetail
:
StageDetail
,
resultTime
:
number
):
CompleteStageParam
{
const
correctNum
=
questionList
.
map
(
c
=>
determinQuestion
(
c
)).
filter
(
Boolean
).
length
const
wrongList
=
questionList
.
map
(
c
=>
!
determinQuestion
(
c
)).
filter
(
Boolean
)
const
wrongLength
=
wrongList
.
length
if
(
wrongLength
>
0
)
{
logger
.
debug
(
getStorage
(
StorageKeys
.
userInfo
)?.
userId
,
'错误列表'
,
wrongList
)
console
.
log
(
'错误列表'
,
wrongList
)
}
const
{
sTime
,
aTime
,
bTime
}
=
stageDetail
const
{
sTime
,
aTime
,
bTime
}
=
stageDetail
...
@@ -45,6 +55,8 @@ export function buildCompleteStageParam (questionList: QuestionType[], stageDeta
...
@@ -45,6 +55,8 @@ export function buildCompleteStageParam (questionList: QuestionType[], stageDeta
const
num
=
questionList
.
length
const
num
=
questionList
.
length
let
levelTime
:
number
=
0
let
levelTime
:
number
=
0
const
correctNum
=
num
-
wrongLength
if
(
correctNum
===
num
)
{
if
(
correctNum
===
num
)
{
if
(
resultTime
<=
sTime
)
{
if
(
resultTime
<=
sTime
)
{
level
=
StageLevel
.
S
level
=
StageLevel
.
S
...
...
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