Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
T_FT_01
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
T_FT_01
Commits
4dbcfc45
Commit
4dbcfc45
authored
Nov 24, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复选项只能有一个正确答案;fix:修复重玩气泡偏移的问题
parent
dc9d8f9a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
11 deletions
+33
-11
form.component.html
form/src/app/form/form.component.html
+1
-1
form.component.ts
form/src/app/form/form.component.ts
+20
-0
Scene.js
play/assets/tmpGame/script/Scene.js
+12
-10
No files found.
form/src/app/form/form.component.html
View file @
4dbcfc45
...
@@ -104,7 +104,7 @@
...
@@ -104,7 +104,7 @@
</app-upload-image-with-preview>
</app-upload-image-with-preview>
</td>
</td>
<td>
<td>
<nz-radio-group
[(
ngModel
)]="
answer
.
isRight
"
(
ngModelChange
)="
save
(
)"
>
<nz-radio-group
[(
ngModel
)]="
answer
.
isRight
"
(
ngModelChange
)="
radioChange
($
event
,
data
,
answer
)"
>
<label
nz-radio
nzValue=
"1"
>
是
</label>
<label
nz-radio
nzValue=
"1"
>
是
</label>
<label
nz-radio
nzValue=
"0"
>
否
</label>
<label
nz-radio
nzValue=
"0"
>
否
</label>
</nz-radio-group>
</nz-radio-group>
...
...
form/src/app/form/form.component.ts
View file @
4dbcfc45
...
@@ -152,6 +152,26 @@ onAudioUploadSuccess(e, item, key) {
...
@@ -152,6 +152,26 @@ onAudioUploadSuccess(e, item, key) {
}
}
}
}
radioChange
(
e
,
exercises
,
answer
){
//如果正确答案,则将其它答案置成否
if
(
e
==
'
1
'
){
let
answers
=
exercises
.
answers
;
for
(
let
m
=
0
;
m
<
answers
.
length
;
++
m
){
if
(
answers
[
m
]
==
answer
){
continue
;
}
answers
[
m
].
isRight
=
'
0
'
;
}
exercises
[
'
answers
'
]
=
[...
exercises
[
'
answers
'
]];
}
this
.
save
();
}
saveData
(
e
,
i
)
{
saveData
(
e
,
i
)
{
console
.
log
(
'
savedata e:
'
,
e
);
console
.
log
(
'
savedata e:
'
,
e
);
...
...
play/assets/tmpGame/script/Scene.js
View file @
4dbcfc45
...
@@ -140,7 +140,7 @@ cc.Class({
...
@@ -140,7 +140,7 @@ cc.Class({
let
answers
=
exercises
.
answers
;
let
answers
=
exercises
.
answers
;
for
(
let
j
=
0
;
j
<
answers
.
length
;
++
j
)
{
for
(
let
j
=
0
;
j
<
answers
.
length
;
++
j
)
{
let
answer
=
answers
[
j
];
let
answer
=
answers
[
j
];
console
.
log
(
answer
);
if
(
answer
.
audioUrl
)
{
if
(
answer
.
audioUrl
)
{
this
.
_audioResList
.
push
({
url
:
answer
.
audioUrl
});
this
.
_audioResList
.
push
({
url
:
answer
.
audioUrl
});
}
}
...
@@ -501,15 +501,16 @@ cc.Class({
...
@@ -501,15 +501,16 @@ cc.Class({
bubbleSpr
.
node
.
parent
=
bubble_bg
;
bubbleSpr
.
node
.
parent
=
bubble_bg
;
let
rate
=
bubble_bg
.
width
/
this
.
data
.
bg
.
rect
.
width
;
let
rate
=
bubble_bg
.
width
/
this
.
data
.
bg
.
rect
.
width
;
console
.
log
(
rate
);
hotZoneItem
.
rect
.
x
*=
rate
;
hotZoneItem
.
rect
.
y
*=
rate
;
hotZoneItem
.
rect
.
width
*=
rate
;
hotZoneItem
.
rect
.
height
*=
rate
;
let
x
=
hotZoneItem
.
rect
.
x
+
hotZoneItem
.
rect
.
width
/
2
-
bubble_bg
.
width
/
2
;
let
rect
=
{};
console
.
log
(
hotZoneItem
.
rect
,
x
);
rect
.
x
=
hotZoneItem
.
rect
.
x
*
rate
;
let
y
=
bubble_bg
.
height
/
2
-
(
hotZoneItem
.
rect
.
y
+
hotZoneItem
.
rect
.
height
/
2
);
rect
.
y
=
hotZoneItem
.
rect
.
y
*
rate
;
rect
.
width
=
hotZoneItem
.
rect
.
width
*
rate
;
rect
.
height
=
hotZoneItem
.
rect
.
height
*
rate
;
let
x
=
rect
.
x
+
rect
.
width
/
2
-
bubble_bg
.
width
/
2
;
let
y
=
bubble_bg
.
height
/
2
-
(
rect
.
y
+
rect
.
height
/
2
);
bubbleSpr
.
node
.
x
=
x
;
bubbleSpr
.
node
.
x
=
x
;
bubbleSpr
.
node
.
y
=
y
;
bubbleSpr
.
node
.
y
=
y
;
...
@@ -698,7 +699,8 @@ cc.Class({
...
@@ -698,7 +699,8 @@ cc.Class({
sprNode
.
on
(
'
click
'
,
()
=>
{
sprNode
.
on
(
'
click
'
,
()
=>
{
this
.
showSoundAnima
(
sprNode
);
this
.
showSoundAnima
(
sprNode
);
playAudioByUrl
(
item
.
audioUrl
,
()
=>
{
console
.
log
(
item
.
data
);
playAudioByUrl
(
item
.
data
.
audioUrl
,
()
=>
{
this
.
stopSoundAnima
(
sprNode
);
this
.
stopSoundAnima
(
sprNode
);
});
});
});
});
...
...
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