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
16e32661
Commit
16e32661
authored
Mar 30, 2023
by
m
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://118.24.71.244/hewenhao/GeekLearnMathWeapp
parents
0022e130
6676d379
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
779 additions
and
112 deletions
+779
-112
answer-blank.module.scss
src/pages/game/play/components/answer-blank.module.scss
+15
-5
answer-blank.tsx
src/pages/game/play/components/answer-blank.tsx
+2
-1
page-footer.tsx
src/pages/game/play/components/page-footer.tsx
+3
-8
question-blank.module.scss
.../game/play/components/question/question-blank.module.scss
+2
-0
question-blank.tsx
src/pages/game/play/components/question/question-blank.tsx
+1
-1
question-selection.module.scss
...e/play/components/question/question-selection.module.scss
+17
-1
question-selection.tsx
...ages/game/play/components/question/question-selection.tsx
+7
-4
question-vertical-division.module.scss
...omponents/question/question-vertical-division.module.scss
+5
-1
question-vertical-division.tsx
...e/play/components/question/question-vertical-division.tsx
+2
-0
index.ts
src/pages/game/play/model/index.ts
+41
-89
test-1.json
src/pages/game/play/model/test-1.json
+112
-0
test-2.json
src/pages/game/play/model/test-2.json
+112
-0
test-3.json
src/pages/game/play/model/test-3.json
+112
-0
test.json
src/pages/game/play/model/test.json
+345
-0
types.ts
src/pages/game/play/types.ts
+3
-2
No files found.
src/pages/game/play/components/answer-blank.module.scss
View file @
16e32661
...
...
@@ -2,18 +2,28 @@
display
:
inline-block
;
margin
:
0
8px
;
vertical-align
:
middle
;
min-width
:
112px
;
height
:
112px
;
background
:
#F7F7F7
;
border-radius
:
32px
;
border
:
6px
solid
#E5E5E5
;
font-size
:
80px
;
font-family
:
HelveticaNeue-Medium
,
HelveticaNeue
;
font-weight
:
500
;
color
:
#465164
;
line-height
:
112px
;
text-align
:
center
;
min-width
:
84px
;
line-height
:
72px
;
height
:
84px
;
font-size
:
50px
;
padding
:
0
8px
;
box-sizing
:
border-box
;
border-radius
:
20px
;
&
.is_simple
{
border-radius
:
32px
;
font-size
:
80px
;
line-height
:
100px
;
min-width
:
112px
;
height
:
112px
;
}
&
.has_answer
{
border-color
:
rgba
(
23
,
134
,
247
,
0
.5
);
...
...
src/pages/game/play/components/answer-blank.tsx
View file @
16e32661
...
...
@@ -12,6 +12,7 @@ type AnswerBlankProps = {
const
AnswerBlank
=
(
props
:
AnswerBlankProps
)
=>
{
const
{
index
,
isCompare
}
=
props
const
currentQuestion
=
useStoreState
(
state
=>
state
.
gameModel
.
currentQuestion
)
const
questionAnswers
=
useStoreState
(
state
=>
state
.
gameModel
.
questionAnswers
)
const
currentInputIndex
=
useStoreState
(
state
=>
state
.
gameModel
.
currentInputIndex
)
const
updateCurrentInputIndex
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
updateCurrentInputIndex
)
...
...
@@ -25,7 +26,7 @@ const AnswerBlank = (props: AnswerBlankProps) => {
return
(
<
CustomWrapper
>
<
View
className=
{
classNames
(
styles
.
blank
,
isCompare
&&
styles
.
is_compare
,
currentInput
&&
styles
.
has_answer
,
isCurrent
&&
styles
.
is_active
)
}
className=
{
classNames
(
styles
.
blank
,
currentQuestion
?.
simpleType
&&
styles
.
is_simple
,
isCompare
&&
styles
.
is_compare
,
currentInput
&&
styles
.
has_answer
,
isCurrent
&&
styles
.
is_active
)
}
onClick=
{
()
=>
updateCurrentInputIndex
(
index
)
}
>
{
currentInput
}
</
View
>
</
CustomWrapper
>
...
...
src/pages/game/play/components/page-footer.tsx
View file @
16e32661
import
{
View
,
Image
,
CustomWrapper
}
from
'@tarojs/components'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
use
Callback
,
use
Memo
}
from
'react'
import
{
useMemo
}
from
'react'
import
classNames
from
'classnames'
import
styles
from
'./page-footer.module.scss'
...
...
@@ -12,13 +12,8 @@ const PageFooter = () => {
const
isLastQuestion
=
useMemo
(()
=>
{
return
questionList
.
length
===
currentQuestionIndex
+
1
},
[
questionList
,
currentQuestionIndex
])
const
updateCurrentIndex
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
updateCurrentIndex
)
const
clearUserAnswer
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
clearUserAnswer
)
const
handleGoNext
=
useCallback
(()
=>
{
if
(
!
canGoNext
)
return
updateCurrentIndex
(
currentQuestionIndex
+
1
)
},
[
canGoNext
,
updateCurrentIndex
,
currentQuestionIndex
])
const
handleGoNext
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
handleGoNext
)
return
(
<
CustomWrapper
>
...
...
@@ -35,7 +30,7 @@ const PageFooter = () => {
<
View
className=
{
classNames
(
styles
.
btn_right
,
!
canGoNext
&&
styles
.
disabled
)
}
hoverClass=
{
canGoNext
?
styles
.
is_active
:
null
}
onClick=
{
handleGoNext
}
onClick=
{
()
=>
handleGoNext
()
}
>
{
isLastQuestion
?
'提交'
:
'下一题'
}
</
View
>
</
View
>
</
View
>
...
...
src/pages/game/play/components/question/question-blank.module.scss
View file @
16e32661
...
...
@@ -6,6 +6,8 @@
font-weight
:
500
;
color
:
#465164
;
line-height
:
56px
;
padding
:
32px
32px
0
32px
;
box-sizing
:
border-box
;
&
.is_sample
{
font-size
:
80px
;
...
...
src/pages/game/play/components/question/question-blank.tsx
View file @
16e32661
...
...
@@ -20,7 +20,7 @@ const QuestionBlank = (props: QuestionBlankProps) => {
},
[
question
.
contentText
])
return
(
<
View
className=
{
classNames
(
styles
.
content
,
styles
.
is_sample
)
}
>
<
View
className=
{
classNames
(
styles
.
content
,
question
.
simpleType
&&
styles
.
is_sample
)
}
>
<
View
>
{
tree
.
map
(
item
=>
renderRichText
(
item
))
}
</
View
>
...
...
src/pages/game/play/components/question/question-selection.module.scss
View file @
16e32661
...
...
@@ -4,22 +4,38 @@
font-weight
:
500
;
color
:
#465164
;
line-height
:
58px
;
flex
:
1
;
&
.is_sample
{
font-size
:
80px
;
font-weight
:
500
;
line-height
:
98px
;
padding-top
:
96px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
}
.wrap
{
min-height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
}
.top
{
flex
:
1
;
display
:
flex
;
align-items
:
center
;
padding
:
0
32px
;
}
.option_wrap
{
padding
:
64px
32px
0
32px
;
}
.gap
{
flex
:
5
;
}
.option_item
{
margin-bottom
:
24px
;
background
:
#F0F2F9
;
...
...
src/pages/game/play/components/question/question-selection.tsx
View file @
16e32661
...
...
@@ -45,9 +45,11 @@ const QuestionSelection = (props: QuestionSelectionProps) => {
},
[
question
.
contentText
])
return
(
<>
<
View
className=
{
classNames
(
styles
.
content
,
styles
.
is_sample
)
}
>
{
tree
.
map
(
item
=>
renderRichText
(
item
))
}
<
View
className=
{
styles
.
wrap
}
>
<
View
className=
{
styles
.
top
}
>
<
View
className=
{
classNames
(
styles
.
content
,
question
.
simpleType
&&
styles
.
is_sample
)
}
>
{
tree
.
map
(
renderRichText
)
}
</
View
>
</
View
>
<
View
className=
{
styles
.
option_wrap
}
>
{
question
.
options
.
map
((
item
,
index
)
=>
{
...
...
@@ -56,7 +58,8 @@ const QuestionSelection = (props: QuestionSelectionProps) => {
)
})
}
</
View
>
</>
<
View
className=
{
styles
.
gap
}
></
View
>
</
View
>
)
}
...
...
src/pages/game/play/components/question/question-vertical-division.module.scss
View file @
16e32661
...
...
@@ -2,8 +2,12 @@
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
padding-top
:
64px
;
padding-right
:
60px
;
min-height
:
100%
;
}
.gap
{
flex
:
1
;
}
.top
{
...
...
src/pages/game/play/components/question/question-vertical-division.tsx
View file @
16e32661
...
...
@@ -24,6 +24,7 @@ const QuestionVerticalDivision = (props: QuestionSelectionProps) => {
return
(
<
View
className=
{
classNames
(
styles
.
content
)
}
>
<
View
className=
{
styles
.
gap
}
></
View
>
<
View
className=
{
styles
.
top
}
>
<
AnswerBlank
index=
{
0
}
></
AnswerBlank
>
</
View
>
...
...
@@ -42,6 +43,7 @@ const QuestionVerticalDivision = (props: QuestionSelectionProps) => {
<
View
className=
{
styles
.
footer
}
>
<
AnswerBlank
index=
{
3
}
></
AnswerBlank
>
</
View
>
<
View
className=
{
styles
.
gap
}
></
View
>
</
View
>
)
}
...
...
src/pages/game/play/model/index.ts
View file @
16e32661
import
{
action
,
Action
,
computed
,
Computed
,
Thunk
,
thunk
}
from
'easy-peasy'
import
{
action
,
Action
,
computed
,
Computed
,
Thunk
,
thunk
}
from
'easy-peasy'
import
{
AppStoreModel
}
from
'@/store/store-model'
import
{
QuestionType
,
QuestionAnswer
,
isSelectionQuestion
,
QuestionOption
}
from
'../types'
import
{
QuestionType
,
QuestionAnswer
,
isSelectionQuestion
,
QuestionOption
,
}
from
'../types'
import
questionListJson
from
'./test.json'
export
interface
GameModel
{
/** 题目列表 */
...
...
@@ -31,89 +36,22 @@ export interface GameModel {
updateList
:
Action
<
GameModel
,
QuestionType
[]
>
;
getQuestionList
:
Thunk
<
GameModel
,
number
,
void
,
AppStoreModel
>
;
}
const
str
=
'<p>随着人们生活质量的提高,净水器已经慢慢走入了普通百姓家庭,某电器公司销售每台进价分别为2000元、1700元的<i>A</i>、<i>B</i>两种型号的净水器,下表是近两周的销售情况:</p>
\
n<table border="1">
\
n <thead>
\
n <tr class="header">
\
n <th style="text-align: left;">销售时段</th>
\
n <th style="text-align: left;"><AnswerBlank index="0" /></th>
\
n <th style="text-align: left;">销售收入</th>
\
n <th style="text-align: left;"></th>
\
n </tr>
\
n </thead>
\
n <tbody>
\
n <tr class="odd">
\
n <td style="text-align: left;"><AnswerBlank index="1" /></td>
\
n <td style="text-align: left;"><i>A</i>种型号</td>
\
n <td style="text-align: left;"><i>B</i>种型号</td>
\
n <td style="text-align: left;"></td>
\
n </tr>
\
n <tr class="even">
\
n <td style="text-align: left;">第一周</td>
\
n <td style="text-align: left;">3台</td>
\
n <td style="text-align: left;">5台</td>
\
n <td style="text-align: left;">18000元</td>
\
n </tr>
\
n <tr class="odd">
\
n <td style="text-align: left;">第二周</td>
\
n <td style="text-align: left;">4台</td>
\
n <td style="text-align: left;">10台</td>
\
n <td style="text-align: left;">31000元</td>
\
n </tr>
\
n </tbody>
\
n</table>
\
n<p>(1)求<i>A</i>,<i>B</i>两种型号的净水器的销售单价;</p>
\
n<p>(2)若电器公司准备用不多于54000元的金额在采购这两种型号的净水器共30台,求<i>A</i>种型号的净水器最多能采购多少台?</p>
\
n<p>(3)在(2)的条件下,公司销售完这30台净水器能否实现利润为12800元的目标?若能,请给出相应的采购方案;若不能,请说明理由.</p>'
handleGoNext
:
Thunk
<
GameModel
,
void
,
void
,
AppStoreModel
>
;
}
const
gameModel
:
GameModel
=
{
questionList
:
[
{
contentText
:
'<p>下面式子最大能填几</p><p>2109>210<AnswerBlank index="0" /></p>'
,
questionType
:
'填空题'
,
answers
:
[
{
sort
:
0
,
contentText
:
'8'
},
]
},
{
questionItems
:
[
{
sort
:
0
,
contentText
:
'57'
},
{
sort
:
1
,
contentText
:
'8'
}
],
questionType
:
'竖式除法'
,
answers
:
[
{
sort
:
0
,
contentText
:
'A'
},
{
sort
:
1
,
contentText
:
'A'
},
{
sort
:
2
,
contentText
:
'A'
},
{
sort
:
3
,
contentText
:
'A'
},
]
},
{
contentText
:
'7998<AnswerBlank index="0" compare="1" />7988'
,
questionType
:
'选择题'
,
answers
:
[
{
sort
:
0
,
contentText
:
'C'
}
],
options
:
[
{
index
:
'A'
,
contentText
:
'<b><</b>'
,
answer
:
false
,
},
{
index
:
'B'
,
contentText
:
'<b>=</b>'
,
answer
:
false
,
},
{
index
:
'C'
,
contentText
:
'<b>></b>'
,
answer
:
true
,
},
]
},
{
contentText
:
'9<MathSymbol value="*" />9<MathSymbol value="=" /><AnswerBlank index="0" />'
,
questionType
:
'填空题'
,
answers
:
[
{
sort
:
0
,
contentText
:
'4'
}
]
},
{
contentText
:
'80<MathSymbol value="/" /><AnswerBlank index="0" /><MathSymbol value="=" /><AnswerBlank index="1" /><MathSymbol value="%" />8'
,
questionType
:
'填空题'
,
answers
:
[
{
sort
:
0
,
contentText
:
'4'
},
{
sort
:
0
,
contentText
:
'6'
},
]
},
{
contentText
:
str
,
questionType
:
'填空题'
,
answers
:
[
{
sort
:
0
,
contentText
:
'1'
},
{
sort
:
1
,
contentText
:
'2'
},
]
},
],
questionList
:
questionListJson
as
QuestionType
[],
currentInputIndex
:
0
,
currentQuestionIndex
:
0
,
updateCurrentInputIndex
:
action
((
state
,
num
)
=>
{
state
.
currentInputIndex
=
num
}),
questionAnswers
:
computed
([
state
=>
state
.
currentQuestion
,
],
(
currentQuestion
)
=>
currentQuestion
?.
answers
),
questionAnswers
:
computed
(
[(
state
)
=>
state
.
currentQuestion
],
(
currentQuestion
)
=>
currentQuestion
?.
answers
),
updateCurrentIndex
:
action
((
state
,
num
)
=>
{
state
.
currentQuestionIndex
=
num
...
...
@@ -124,16 +62,16 @@ const gameModel: GameModel = {
const
{
questionList
,
currentQuestionIndex
,
questionAnswers
}
=
state
const
question
=
questionList
[
currentQuestionIndex
]
if
(
question
&&
isSelectionQuestion
(
question
))
{
return
question
.
options
.
some
(
c
=>
c
.
userAnswer
)
return
question
.
options
.
some
(
(
c
)
=>
c
.
userAnswer
)
}
return
questionAnswers
?.
every
(
c
=>
!!
c
.
userAnswer
)
??
false
return
questionAnswers
?.
every
(
(
c
)
=>
!!
c
.
userAnswer
)
??
false
}),
updateSelectionAnswer
:
action
((
state
,
index
)
=>
{
const
question
=
state
.
questionList
[
state
.
currentQuestionIndex
]
if
(
isSelectionQuestion
(
question
))
{
question
.
options
=
question
.
options
.
map
((
c
,
_index
)
=>
({
...
c
,
userAnswer
:
_index
===
index
userAnswer
:
_index
===
index
,
}))
}
}),
...
...
@@ -155,26 +93,40 @@ const gameModel: GameModel = {
clearUserAnswer
:
action
((
state
)
=>
{
const
currentQuestion
=
state
.
questionList
[
state
.
currentQuestionIndex
]
if
(
currentQuestion
&&
isSelectionQuestion
(
currentQuestion
))
{
currentQuestion
.
options
.
forEach
(
item
=>
{
currentQuestion
.
options
.
forEach
(
(
item
)
=>
{
item
.
userAnswer
=
false
})
}
else
{
state
.
questionList
[
state
.
currentQuestionIndex
]?.
answers
?.
forEach
(
item
=>
{
item
.
userAnswer
=
undefined
})
state
.
questionList
[
state
.
currentQuestionIndex
]?.
answers
?.
forEach
(
(
item
)
=>
{
item
.
userAnswer
=
undefined
}
)
}
state
.
currentInputIndex
=
0
}),
currentQuestion
:
computed
(
[
state
=>
state
.
questionList
,
state
=>
state
.
currentQuestionIndex
,
],
(
list
,
index
)
=>
list
[
index
]
),
currentQuestion
:
computed
(
[(
state
)
=>
state
.
questionList
,
(
state
)
=>
state
.
currentQuestionIndex
]
,
(
list
,
index
)
=>
list
[
index
]
),
updateList
:
action
((
state
,
questionList
)
=>
{
state
.
questionList
=
questionList
}),
handleGoNext
:
thunk
(
async
(
actions
,
_
,
helpers
)
=>
{
const
{
canGoNext
,
currentQuestionIndex
,
questionList
}
=
helpers
.
getState
()
if
(
!
canGoNext
)
return
const
len
=
questionList
.
length
if
(
len
===
currentQuestionIndex
+
1
)
{
console
.
log
(
'submit'
)
return
}
actions
.
updateCurrentIndex
(
currentQuestionIndex
+
1
)
}),
getQuestionList
:
thunk
(
async
(
actions
,
round
,
helpers
)
=>
{
try
{
actions
.
updateList
([])
...
...
src/pages/game/play/model/test-1.json
0 → 100644
View file @
16e32661
[
{
"answers"
:
[{
"contentText"
:
"11"
,
"sort"
:
0
}],
"contentText"
:
"1<MathSymbol value=
\"
+
\"
/>10<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"1"
,
"sort"
:
0
},
{
"contentText"
:
"10"
,
"sort"
:
1
},
{
"contentText"
:
"11"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"11"
,
"sort"
:
0
}],
"contentText"
:
"1<MathSymbol value=
\"
+
\"
/>10<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"1"
,
"sort"
:
0
},
{
"contentText"
:
"10"
,
"sort"
:
1
},
{
"contentText"
:
"11"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"30"
,
"sort"
:
0
}],
"contentText"
:
"18<MathSymbol value=
\"
+
\"
/>12<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"18"
,
"sort"
:
0
},
{
"contentText"
:
"12"
,
"sort"
:
1
},
{
"contentText"
:
"30"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"39"
,
"sort"
:
0
}],
"contentText"
:
"34<MathSymbol value=
\"
+
\"
/>5<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"34"
,
"sort"
:
0
},
{
"contentText"
:
"5"
,
"sort"
:
1
},
{
"contentText"
:
"39"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"95"
,
"sort"
:
0
}],
"contentText"
:
"48<MathSymbol value=
\"
+
\"
/>47<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"48"
,
"sort"
:
0
},
{
"contentText"
:
"47"
,
"sort"
:
1
},
{
"contentText"
:
"95"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"65"
,
"sort"
:
0
}],
"contentText"
:
"22<MathSymbol value=
\"
+
\"
/>43<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"22"
,
"sort"
:
0
},
{
"contentText"
:
"43"
,
"sort"
:
1
},
{
"contentText"
:
"65"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"28"
,
"sort"
:
0
}],
"contentText"
:
"16<MathSymbol value=
\"
+
\"
/>12<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"16"
,
"sort"
:
0
},
{
"contentText"
:
"12"
,
"sort"
:
1
},
{
"contentText"
:
"28"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"50"
,
"sort"
:
0
}],
"contentText"
:
"2<MathSymbol value=
\"
+
\"
/>48<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"2"
,
"sort"
:
0
},
{
"contentText"
:
"48"
,
"sort"
:
1
},
{
"contentText"
:
"50"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"65"
,
"sort"
:
0
}],
"contentText"
:
"46<MathSymbol value=
\"
+
\"
/>19<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"46"
,
"sort"
:
0
},
{
"contentText"
:
"19"
,
"sort"
:
1
},
{
"contentText"
:
"65"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"84"
,
"sort"
:
0
}],
"contentText"
:
"48<MathSymbol value=
\"
+
\"
/>36<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"48"
,
"sort"
:
0
},
{
"contentText"
:
"36"
,
"sort"
:
1
},
{
"contentText"
:
"84"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
}
]
src/pages/game/play/model/test-2.json
0 → 100644
View file @
16e32661
[
{
"answers"
:
[{
"contentText"
:
"32"
,
"sort"
:
0
}],
"contentText"
:
"48<MathSymbol value=
\"
+
\"
/><AnswerBlank index=
\"
0
\"
/><MathSymbol value=
\"
=
\"
/>80"
,
"questionItems"
:
[
{
"contentText"
:
"48"
,
"sort"
:
0
},
{
"contentText"
:
"32"
,
"sort"
:
1
},
{
"contentText"
:
"80"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"53"
,
"sort"
:
0
}],
"contentText"
:
"14<MathSymbol value=
\"
+
\"
/>39<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"14"
,
"sort"
:
0
},
{
"contentText"
:
"39"
,
"sort"
:
1
},
{
"contentText"
:
"53"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"62"
,
"sort"
:
0
}],
"contentText"
:
"39<MathSymbol value=
\"
+
\"
/>23<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"39"
,
"sort"
:
0
},
{
"contentText"
:
"23"
,
"sort"
:
1
},
{
"contentText"
:
"62"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"83"
,
"sort"
:
0
}],
"contentText"
:
"49<MathSymbol value=
\"
+
\"
/>34<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"49"
,
"sort"
:
0
},
{
"contentText"
:
"34"
,
"sort"
:
1
},
{
"contentText"
:
"83"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"35"
,
"sort"
:
0
}],
"contentText"
:
"10<MathSymbol value=
\"
+
\"
/><AnswerBlank index=
\"
0
\"
/><MathSymbol value=
\"
=
\"
/>45"
,
"questionItems"
:
[
{
"contentText"
:
"10"
,
"sort"
:
0
},
{
"contentText"
:
"35"
,
"sort"
:
1
},
{
"contentText"
:
"45"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"58"
,
"sort"
:
0
}],
"contentText"
:
"48<MathSymbol value=
\"
+
\"
/>10<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"48"
,
"sort"
:
0
},
{
"contentText"
:
"10"
,
"sort"
:
1
},
{
"contentText"
:
"58"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"18"
,
"sort"
:
0
}],
"contentText"
:
"4<MathSymbol value=
\"
+
\"
/>14<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"4"
,
"sort"
:
0
},
{
"contentText"
:
"14"
,
"sort"
:
1
},
{
"contentText"
:
"18"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"1"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/><MathSymbol value=
\"
+
\"
/>44<MathSymbol value=
\"
=
\"
/>45"
,
"questionItems"
:
[
{
"contentText"
:
"1"
,
"sort"
:
0
},
{
"contentText"
:
"44"
,
"sort"
:
1
},
{
"contentText"
:
"45"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"0"
,
"sort"
:
0
}],
"contentText"
:
"9<MathSymbol value=
\"
+
\"
/><AnswerBlank index=
\"
0
\"
/><MathSymbol value=
\"
=
\"
/>9"
,
"questionItems"
:
[
{
"contentText"
:
"9"
,
"sort"
:
0
},
{
"contentText"
:
"0"
,
"sort"
:
1
},
{
"contentText"
:
"9"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"6"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/><MathSymbol value=
\"
+
\"
/>44<MathSymbol value=
\"
=
\"
/>50"
,
"questionItems"
:
[
{
"contentText"
:
"6"
,
"sort"
:
0
},
{
"contentText"
:
"44"
,
"sort"
:
1
},
{
"contentText"
:
"50"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
}
]
src/pages/game/play/model/test-3.json
0 → 100644
View file @
16e32661
[
{
"answers"
:
[{
"contentText"
:
"20"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买1元笔记本21本"
,
"questionItems"
:
[
{
"contentText"
:
"20"
,
"sort"
:
0
},
{
"contentText"
:
"1"
,
"sort"
:
1
},
{
"contentText"
:
"21"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"74"
,
"sort"
:
0
}],
"contentText"
:
"48元钱可以买26元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"48"
,
"sort"
:
0
},
{
"contentText"
:
"26"
,
"sort"
:
1
},
{
"contentText"
:
"74"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"32"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买24元笔记本56本"
,
"questionItems"
:
[
{
"contentText"
:
"32"
,
"sort"
:
0
},
{
"contentText"
:
"24"
,
"sort"
:
1
},
{
"contentText"
:
"56"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"19"
,
"sort"
:
0
}],
"contentText"
:
"9元钱可以买10元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"9"
,
"sort"
:
0
},
{
"contentText"
:
"10"
,
"sort"
:
1
},
{
"contentText"
:
"19"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"12"
,
"sort"
:
0
}],
"contentText"
:
"11元钱可以买1元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"11"
,
"sort"
:
0
},
{
"contentText"
:
"1"
,
"sort"
:
1
},
{
"contentText"
:
"12"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"66"
,
"sort"
:
0
}],
"contentText"
:
"30元钱可以买36元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"30"
,
"sort"
:
0
},
{
"contentText"
:
"36"
,
"sort"
:
1
},
{
"contentText"
:
"66"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"2"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买7元笔记本9本"
,
"questionItems"
:
[
{
"contentText"
:
"2"
,
"sort"
:
0
},
{
"contentText"
:
"7"
,
"sort"
:
1
},
{
"contentText"
:
"9"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"3"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买14元笔记本17本"
,
"questionItems"
:
[
{
"contentText"
:
"3"
,
"sort"
:
0
},
{
"contentText"
:
"14"
,
"sort"
:
1
},
{
"contentText"
:
"17"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"16"
,
"sort"
:
0
}],
"contentText"
:
"27元钱可以买<AnswerBlank index=
\"
0
\"
/>元笔记本43本"
,
"questionItems"
:
[
{
"contentText"
:
"27"
,
"sort"
:
0
},
{
"contentText"
:
"16"
,
"sort"
:
1
},
{
"contentText"
:
"43"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"13"
,
"sort"
:
0
}],
"contentText"
:
"6元钱可以买<AnswerBlank index=
\"
0
\"
/>元笔记本19本"
,
"questionItems"
:
[
{
"contentText"
:
"6"
,
"sort"
:
0
},
{
"contentText"
:
"13"
,
"sort"
:
1
},
{
"contentText"
:
"19"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
}
]
src/pages/game/play/model/test.json
0 → 100644
View file @
16e32661
[
{
"answers"
:
[
{
"contentText"
:
"C"
,
"sort"
:
1
}
],
"contentText"
:
"爸爸把一盘糖果的一半给了弟弟,把剩下的糖果给了一半给姐姐,这时盘里还剩8块,请问盘里原来有几块糖?"
,
"options"
:
[
{
"answer"
:
false
,
"contentText"
:
"16块"
,
"index"
:
"A"
},
{
"answer"
:
false
,
"contentText"
:
"24块"
,
"index"
:
"B"
},
{
"answer"
:
true
,
"contentText"
:
"32块"
,
"index"
:
"C"
},
{
"answer"
:
false
,
"contentText"
:
"64块"
,
"index"
:
"D"
}
],
"questionType"
:
"选择题"
,
"simpleType"
:
false
},
{
"answers"
:
[
{
"contentText"
:
"20"
,
"sort"
:
0
}
],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买1元笔记本21本"
,
"questionItems"
:
[
{
"contentText"
:
"20"
,
"sort"
:
0
},
{
"contentText"
:
"1"
,
"sort"
:
1
},
{
"contentText"
:
"21"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"contentText"
:
"7998<AnswerBlank index=
\"
0
\"
compare=
\"
1
\"
/>7988"
,
"questionType"
:
"选择题"
,
"answers"
:
[
{
"sort"
:
0
,
"contentText"
:
"C"
}
],
"simpleType"
:
true
,
"options"
:
[
{
"index"
:
"A"
,
"contentText"
:
"<b><</b>"
,
"answer"
:
false
},
{
"index"
:
"B"
,
"contentText"
:
"<b>=</b>"
,
"answer"
:
false
},
{
"index"
:
"C"
,
"contentText"
:
"<b>></b>"
,
"answer"
:
true
}
]
},
{
"questionItems"
:
[
{
"sort"
:
0
,
"contentText"
:
"57"
},
{
"sort"
:
1
,
"contentText"
:
"8"
}
],
"simpleType"
:
true
,
"questionType"
:
"竖式除法"
,
"answers"
:
[
{
"sort"
:
0
,
"contentText"
:
"A"
},
{
"sort"
:
1
,
"contentText"
:
"A"
},
{
"sort"
:
2
,
"contentText"
:
"A"
},
{
"sort"
:
3
,
"contentText"
:
"A"
}
]
},
{
"answers"
:
[
{
"contentText"
:
"28"
,
"sort"
:
0
}
],
"contentText"
:
"16<MathSymbol value=
\"
+
\"
/>12<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"16"
,
"sort"
:
0
},
{
"contentText"
:
"12"
,
"sort"
:
1
},
{
"contentText"
:
"28"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
},
{
"answers"
:
[
{
"contentText"
:
"50"
,
"sort"
:
0
}
],
"contentText"
:
"2<MathSymbol value=
\"
+
\"
/>48<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"2"
,
"sort"
:
0
},
{
"contentText"
:
"48"
,
"sort"
:
1
},
{
"contentText"
:
"50"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
},
{
"answers"
:
[
{
"contentText"
:
"32"
,
"sort"
:
0
}
],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买24元笔记本56本"
,
"questionItems"
:
[
{
"contentText"
:
"32"
,
"sort"
:
0
},
{
"contentText"
:
"24"
,
"sort"
:
1
},
{
"contentText"
:
"56"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[
{
"contentText"
:
"53"
,
"sort"
:
0
}
],
"contentText"
:
"14<MathSymbol value=
\"
+
\"
/>39<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"14"
,
"sort"
:
0
},
{
"contentText"
:
"39"
,
"sort"
:
1
},
{
"contentText"
:
"53"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
},
{
"answers"
:
[
{
"contentText"
:
"62"
,
"sort"
:
0
}
],
"contentText"
:
"39<MathSymbol value=
\"
+
\"
/>23<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"39"
,
"sort"
:
0
},
{
"contentText"
:
"23"
,
"sort"
:
1
},
{
"contentText"
:
"62"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
},
{
"answers"
:
[
{
"contentText"
:
"83"
,
"sort"
:
0
}
],
"contentText"
:
"49<MathSymbol value=
\"
+
\"
/>34<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"49"
,
"sort"
:
0
},
{
"contentText"
:
"34"
,
"sort"
:
1
},
{
"contentText"
:
"83"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
},
{
"answers"
:
[
{
"contentText"
:
"19"
,
"sort"
:
0
}
],
"contentText"
:
"9元钱可以买10元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"9"
,
"sort"
:
0
},
{
"contentText"
:
"10"
,
"sort"
:
1
},
{
"contentText"
:
"19"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[
{
"contentText"
:
"12"
,
"sort"
:
0
}
],
"contentText"
:
"11元钱可以买1元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"11"
,
"sort"
:
0
},
{
"contentText"
:
"1"
,
"sort"
:
1
},
{
"contentText"
:
"12"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[
{
"contentText"
:
"66"
,
"sort"
:
0
}
],
"contentText"
:
"30元钱可以买36元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"30"
,
"sort"
:
0
},
{
"contentText"
:
"36"
,
"sort"
:
1
},
{
"contentText"
:
"66"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
}
]
src/pages/game/play/types.ts
View file @
16e32661
...
...
@@ -7,11 +7,12 @@ export type QuestionAnswer = {
export
interface
QuestionItem
{
questionType
:
string
;
answers
:
QuestionAnswer
[];
simpleType
?:
boolean
;
}
export
interface
BlankQuestion
extends
QuestionItem
{
contentText
:
string
;
questionType
:
'填空题'
;
questionType
:
'填空题'
|
'随机填空'
;
}
export
interface
SelectionQuestion
extends
QuestionItem
{
...
...
@@ -44,7 +45,7 @@ export interface MultiplicationQuestion extends QuestionItem {
export
type
QuestionType
=
BlankQuestion
|
SelectionQuestion
|
RandomQuestion
export
function
isBlankQuestion
(
q
:
QuestionType
):
q
is
BlankQuestion
{
return
q
?.
questionType
===
'填空题'
return
q
?.
questionType
===
'填空题'
||
q
?.
questionType
===
'随机填空'
}
export
function
isSelectionQuestion
(
q
:
QuestionType
):
q
is
SelectionQuestion
{
...
...
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