Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DF-L211
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
DF-L211
Commits
7748124c
Commit
7748124c
authored
May 28, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加缺省值
parent
cb223069
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
Exercises.ts
src/app/play/Exercises.ts
+24
-0
play.component.ts
src/app/play/play.component.ts
+9
-2
No files found.
src/app/play/Exercises.ts
View file @
7748124c
...
...
@@ -204,4 +204,28 @@ export class Answer {
reset
()
{
this
.
selected
=
false
;
}
}
export
function
getDefaultExercisesItem
()
{
let
exercises
=
{
audio_url
:
""
,
answers
:
[]
}
for
(
let
i
=
0
;
i
<
2
;
++
i
)
{
let
answer
=
getDefaultAnswer
();
exercises
.
answers
.
push
(
answer
);
}
return
exercises
;
}
export
function
getDefaultAnswer
()
{
let
answer
=
{
contentType
:
"
T
"
,
text
:
"
Hello
"
,
pic_url
:
""
,
right
:
true
};
return
answer
;
}
\ No newline at end of file
src/app/play/play.component.ts
View file @
7748124c
...
...
@@ -26,7 +26,8 @@ import {
import
{
Exercise
,
Answer
Answer
,
getDefaultExercisesItem
}
from
'
./Exercises
'
;
import
{
Handclap
}
from
'
./Handclap
'
;
...
...
@@ -487,6 +488,12 @@ export class PlayComponent implements OnInit, OnDestroy {
initDefaultData
()
{
if
(
!
this
.
data
.
exercisesArr
)
{
this
.
data
.
exercisesArr
=
[];
for
(
let
i
=
0
;
i
<
6
;
++
i
)
{
let
exer
=
getDefaultExercisesItem
();
this
.
data
.
exercisesArr
.
push
(
exer
);
}
}
}
...
...
@@ -721,7 +728,7 @@ export class PlayComponent implements OnInit, OnDestroy {
rightBox
.
boxBg
.
x
=
midBox
.
boxBg
.
x
+
99
*
this
.
mapScale
+
midBox
.
boxBg
.
width
;
this
.
rightBox
=
rightBox
;
const
leftBox
=
initBox
(
'
left
'
);
leftBox
.
boxBg
.
x
=
midBox
.
boxBg
.
x
-
99
*
this
.
mapScale
-
rightBox
.
boxBg
.
width
;
...
...
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