Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LST-05
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
LST-05
Commits
c67f9a34
Commit
c67f9a34
authored
Nov 20, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:去除备选答案的音频,增加卡片的个数
parent
99d631ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
18 deletions
+43
-18
form.component.html
src/app/form/form.component.html
+0
-8
play.component.ts
src/app/play/play.component.ts
+43
-10
No files found.
src/app/form/form.component.html
View file @
c67f9a34
...
...
@@ -68,14 +68,6 @@
<span>
删除
</span>
</button>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"data.audioUrl"
>
音频:
</nz-form-label>
<nz-form-control
[
nzSpan
]="
12
"
>
<app-audio-recorder
[
audioUrl
]="
data
.
audioUrl
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
data
,
'
audioUrl
')"
>
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
内容形式
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
...
...
src/app/play/play.component.ts
View file @
c67f9a34
...
...
@@ -545,7 +545,17 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
gameEndFlag
=
false
;
this
.
answerArr
.
push
(
this
.
data
.
rightAnswer
);
let
num
=
2
+
Math
.
ceil
(
Math
.
random
()
*
2
);
for
(
let
i
=
0
;
i
<
num
;
++
i
){
let
answer
=
getDefaultAnswer
();
answer
.
audioUrl
=
this
.
data
.
rightAnswer
.
audioUrl
;
answer
.
contentType
=
this
.
data
.
rightAnswer
.
contentType
;
answer
.
isRight
=
"
1
"
;
answer
.
picUrl
=
this
.
data
.
rightAnswer
.
picUrl
;
answer
.
val
=
this
.
data
.
rightAnswer
.
val
;
this
.
answerArr
.
push
(
answer
);
}
this
.
answerArr
.
push
(...
this
.
data
.
answerArr
);
...
...
@@ -792,7 +802,27 @@ export class PlayComponent implements OnInit, OnDestroy {
card
=
new
Card
();
card
.
init
(
this
.
images
,
this
.
mapScale
);
card
.
bg
.
x
=
260
*
this
.
mapScale
;
card
.
bg
.
x
=
160
*
this
.
mapScale
;
card
.
bg
.
y
=
this
.
canvasHeight
+
110
*
this
.
mapScale
;
card
.
bg
[
'
renderZ
'
]
=
19
;
card
[
'
id
'
]
=
1
;
this
.
renderArr
.
push
(
card
.
bg
);
this
.
holePosArr
.
push
({
x
:
card
.
bg
.
x
,
y
:
card
.
bg
.
y
,
z
:
19
});
this
.
cardArr
.
push
(
card
);
card
=
new
Card
();
card
.
init
(
this
.
images
,
this
.
mapScale
);
card
.
bg
.
x
=
540
*
this
.
mapScale
;
card
.
bg
.
y
=
this
.
canvasHeight
+
110
*
this
.
mapScale
;
card
.
bg
[
'
renderZ
'
]
=
19
;
card
[
'
id
'
]
=
1
;
this
.
renderArr
.
push
(
card
.
bg
);
this
.
holePosArr
.
push
({
x
:
card
.
bg
.
x
,
y
:
card
.
bg
.
y
,
z
:
19
});
this
.
cardArr
.
push
(
card
);
card
=
new
Card
();
card
.
init
(
this
.
images
,
this
.
mapScale
);
card
.
bg
.
x
=
760
*
this
.
mapScale
;
card
.
bg
.
y
=
this
.
canvasHeight
+
110
*
this
.
mapScale
;
card
.
bg
[
'
renderZ
'
]
=
19
;
card
[
'
id
'
]
=
1
;
...
...
@@ -808,7 +838,7 @@ export class PlayComponent implements OnInit, OnDestroy {
for
(
let
i
=
0
;
i
<
this
.
cardArr
.
length
;
i
++
)
{
clearTimeout
(
this
.
cardArr
[
i
].
timeId
);
if
(
this
.
cardArr
[
i
].
tween
)
{
this
.
cardArr
[
i
].
tween
.
stop
();
//
this.cardArr[i].tween.stop();
}
}
...
...
@@ -880,7 +910,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
this
.
getAnswer
((
answer
)
=>
{
const
holeArr
=
[
0
,
1
,
2
];
const
holeArr
=
[
0
,
1
,
2
,
3
,
4
];
for
(
let
i
=
0
;
i
<
this
.
holeExistArr
.
length
;
i
++
)
{
removeItemFromArr
(
holeArr
,
this
.
holeExistArr
[
i
]);
}
...
...
@@ -889,7 +919,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const
pos
=
this
.
holePosArr
[
holeIndex
];
const
cardIndexArr
=
[
0
,
1
,
2
];
const
cardIndexArr
=
[
0
,
1
,
2
,
3
,
4
];
for
(
let
i
=
0
;
i
<
this
.
cardExistArr
.
length
;
i
++
)
{
removeItemFromArr
(
cardIndexArr
,
this
.
cardExistArr
[
i
]);
}
...
...
@@ -973,7 +1003,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
!
card
.
curAnswer
.
endFlag
)
{
removeItemFromArr
(
this
.
cardExistArr
,
card
.
id
);
}
else
{
this
.
checkGameEnd
(
card
.
curAnswer
);
this
.
checkGameEnd
();
}
removeItemFromArr
(
this
.
holeExistArr
,
card
.
holeId
);
...
...
@@ -1020,11 +1050,14 @@ export class PlayComponent implements OnInit, OnDestroy {
}
checkGameEnd
(
answer
)
{
if
(
answer
.
endFlag
)
{
this
.
showEnd
();
checkGameEnd
()
{
for
(
let
i
=
0
;
i
<
this
.
answerArr2
.
length
;
i
++
)
{
if
(
this
.
answerArr2
[
i
].
isRight
==
'
1
'
&&
!
this
.
answerArr2
[
i
].
endFlag
)
{
return
;
}
}
console
.
log
(
'
play end...
'
)
this
.
showEnd
();
}
...
...
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