Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
op_09
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
op_09
Commits
e9cfb545
Commit
e9cfb545
authored
Sep 22, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 错题最多四次
parent
ea501781
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
10 deletions
+21
-10
form.component.html
form/src/app/form/form.component.html
+6
-0
form.component.ts
form/src/app/form/form.component.ts
+8
-5
op_09.js
play/assets/op_09/scene/op_09.js
+6
-5
defaultData.js
play/assets/op_09/script/defaultData.js
+1
-0
No files found.
form/src/app/form/form.component.html
View file @
e9cfb545
<div
class=
"model-content"
>
<div
style=
"padding: 10px;"
>
<div
style=
"width: 500px; margin-top: 20px; border: 1px solid #ccc; border-radius: 5px; padding: 15px;"
>
答对所有题或答题满
<input
style=
"width: 50px;"
type=
"number"
nz-input
[(
ngModel
)]="
item
.
maxWrongNumber
"
(
blur
)="
save
()"
>
次自动结束游戏
</div>
</div>
<div
style=
"padding: 10px;"
>
<div
*
ngFor=
"let q of questionArr; let i = index;"
style=
"width: 500px; margin-top: 20px; border: 1px solid #ccc; border-radius: 5px; padding: 15px;"
>
...
...
form/src/app/form/form.component.ts
View file @
e9cfb545
...
...
@@ -10,7 +10,7 @@ import { JsonPipe } from '@angular/common';
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
// 储存数据用
saveKey
=
"
test_001
"
;
saveKey
=
"
op_09
"
;
// 储存对象
item
;
...
...
@@ -22,7 +22,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
ngOnInit
()
{
this
.
item
=
{};
this
.
item
=
{
maxWrongNumber
:
4
,
question_arr
:
[]
};
// 获取存储的数据
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
...
...
@@ -79,7 +82,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
deleteOptionBtnClick
(
option
,
index
)
{
option
.
splice
(
index
,
1
)
option
.
splice
(
index
,
1
)
this
.
save
();
}
...
...
play/assets/op_09/scene/op_09.js
View file @
e9cfb545
...
...
@@ -145,7 +145,8 @@ cc.Class({
initData
()
{
this
.
status
=
{
currentQuestionIdx
:
0
currentQuestionIdx
:
0
,
wrongTime
:
0
}
},
...
...
@@ -279,7 +280,8 @@ cc.Class({
this
.
onAnswerRight
();
}
else
{
this
.
coolCatSpeakWrong
(()
=>
{
if
(
!
this
.
status
.
wrongOnce
)
{
this
.
status
.
wrongTime
++
;
if
(
this
.
status
.
wrongTime
<
this
.
data
.
maxWrongNumber
)
{
this
.
onAnswerWrong
();
}
else
{
this
.
onAnswerWrongTwice
();
...
...
@@ -301,7 +303,6 @@ cc.Class({
},
onAnswerWrong
()
{
this
.
status
.
wrongOnce
=
true
;
const
box
=
cc
.
find
(
'
Canvas/bg/box
'
);
box
.
children
.
filter
(
child
=>
child
.
optionData
.
selected
)
...
...
@@ -316,6 +317,7 @@ cc.Class({
},
onAnswerWrongTwice
()
{
this
.
status
.
currentQuestionIdx
=
this
.
data
.
question_arr
.
length
;
this
.
nextQuestion
();
this
.
playEffect
(
'
jumpAll
'
);
},
...
...
@@ -329,7 +331,6 @@ cc.Class({
.
start
();
});
this
.
status
.
currentQuestionIdx
++
;
this
.
status
.
wrongOnce
=
false
;
if
(
this
.
status
.
currentQuestionIdx
<
this
.
data
.
question_arr
.
length
)
{
setTimeout
(()
=>
{
...
...
play/assets/op_09/script/defaultData.js
View file @
e9cfb545
export
const
defaultData
=
{
maxWrongNumber
:
4
,
"
question_arr
"
:
[{
"
question_audio_url
"
:
""
,
"
option_arr
"
:
[{
...
...
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