Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cake_class_1
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
cake_class_1
Commits
595be320
Commit
595be320
authored
Mar 13, 2022
by
章红平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提示信息
parent
b2c8c214
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
47 deletions
+57
-47
cake_class_1.fire
assets/cake_class_1/scene/cake_class_1.fire
+1
-1
cake_class_1.ts
assets/cake_class_1/scene/cake_class_1.ts
+56
-46
No files found.
assets/cake_class_1/scene/cake_class_1.fire
View file @
595be320
...
@@ -744,7 +744,7 @@
...
@@ -744,7 +744,7 @@
"__id__": 10
"__id__": 10
},
},
"_enabled": true,
"_enabled": true,
"alignMode":
1
,
"alignMode":
2
,
"_target": null,
"_target": null,
"_alignFlags": 9,
"_alignFlags": 9,
"_left": 20,
"_left": 20,
...
...
assets/cake_class_1/scene/cake_class_1.ts
View file @
595be320
...
@@ -96,11 +96,11 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -96,11 +96,11 @@ export default class cake_class_1 extends MyCocosSceneComponent {
.
to
(
0.3
,
{
x
:
-
550
})
.
to
(
0.3
,
{
x
:
-
550
})
.
start
();
.
start
();
}
}
moveOutCandle1
(
cb
=
null
)
{
moveOutCandle1
(
cb
=
null
)
{
cc
.
tween
(
this
.
candle1
)
cc
.
tween
(
this
.
candle1
)
.
to
(
0.3
,
{
x
:
-
850
})
.
to
(
0.3
,
{
x
:
-
850
})
.
call
(()
=>
{
.
call
(()
=>
{
if
(
cb
)
cb
();
if
(
cb
)
cb
();
})
})
.
start
();
.
start
();
}
}
...
@@ -143,7 +143,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -143,7 +143,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
}
}
startTalking
()
{
startTalking
()
{
console
.
log
(
"
startText:
"
,
this
.
data
.
questions
[
this
.
questionIndex
].
text
)
console
.
log
(
"
startText:
"
,
this
.
data
.
questions
[
this
.
questionIndex
].
text
)
if
((
<
any
>
window
).
courseware
&&
(
<
any
>
window
).
courseware
.
stopTest
)
{
if
((
<
any
>
window
).
courseware
&&
(
<
any
>
window
).
courseware
.
stopTest
)
{
(
<
any
>
window
).
courseware
.
startTest
(
this
.
data
.
questions
[
this
.
questionIndex
].
text
);
(
<
any
>
window
).
courseware
.
startTest
(
this
.
data
.
questions
[
this
.
questionIndex
].
text
);
}
}
this
.
talking
=
true
;
this
.
talking
=
true
;
...
@@ -157,28 +157,38 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -157,28 +157,38 @@ export default class cake_class_1 extends MyCocosSceneComponent {
this
.
initRedBtn
();
this
.
initRedBtn
();
this
.
moveOutCandle2
();
this
.
moveOutCandle2
();
this
.
nowPanel
.
showBlock
();
this
.
nowPanel
.
showBlock
();
if
((
<
any
>
window
).
courseware
&&
(
<
any
>
window
).
courseware
.
stopTest
)
{
let
fail
=
()
=>
{
this
.
answerList
[
this
.
questionIndex
]
=
-
1
this
.
stickers
.
changOneSticker
(
this
.
questionIndex
,
false
)
this
.
nowPanel
.
showResult
(
false
)
}
// let stopTestOut=setTimeout(()=>{
// },3000)
let
timeOut
=
false
;
if
((
<
any
>
window
).
courseware
&&
(
<
any
>
window
).
courseware
.
stopTest
)
{
let
stopTestOut
=
setTimeout
(()
=>
{
timeOut
=
true
;
fail
();
},
3000
);
(
<
any
>
window
).
courseware
.
stopTest
((
res
)
=>
{
(
<
any
>
window
).
courseware
.
stopTest
((
res
)
=>
{
res
=
JSON
.
parse
(
res
)
if
(
!
timeOut
){
console
.
log
(
"
res=========
"
,
res
.
scores
,
res
.
result
)
clearTimeout
(
stopTestOut
);
if
(
res
.
result
.
overall
>=
80
){
res
=
JSON
.
parse
(
res
)
console
.
log
(
"
res=========
"
,
res
.
scores
,
res
.
result
)
if
(
res
.
result
.
overall
>=
80
)
{
console
.
log
(
"
语音测评成功
"
)
console
.
log
(
"
语音测评成功
"
)
this
.
answerList
[
this
.
questionIndex
]
=
1
this
.
answerList
[
this
.
questionIndex
]
=
1
this
.
stickers
.
changOneSticker
(
this
.
questionIndex
,
true
)
this
.
stickers
.
changOneSticker
(
this
.
questionIndex
,
true
)
this
.
nowPanel
.
showResult
(
true
)
this
.
nowPanel
.
showResult
(
true
)
}
else
{
}
else
{
console
.
log
(
"
语音测评失败
"
)
fail
();
this
.
answerList
[
this
.
questionIndex
]
=-
1
}
this
.
stickers
.
changOneSticker
(
this
.
questionIndex
,
false
)
this
.
nowPanel
.
showResult
(
false
)
}
}
})
})
}
else
{
}
else
{
this
.
answerList
[
this
.
questionIndex
]
=-
1
fail
();
this
.
nowPanel
.
showResult
(
false
)
this
.
stickers
.
changOneSticker
(
this
.
questionIndex
,
false
)
}
}
this
.
clearTimeouts
()
this
.
clearTimeouts
()
}
}
...
@@ -187,7 +197,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -187,7 +197,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
this
.
initData
();;
this
.
initData
();;
this
.
initListener
();
this
.
initListener
();
}
}
dataCallBack
(){
dataCallBack
()
{
super
.
dataCallBack
();
super
.
dataCallBack
();
this
.
stickers
.
node
.
active
=
false
;
this
.
stickers
.
node
.
active
=
false
;
this
.
nowPanel
=
this
.
addPanel
()
this
.
nowPanel
=
this
.
addPanel
()
...
@@ -244,8 +254,8 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -244,8 +254,8 @@ export default class cake_class_1 extends MyCocosSceneComponent {
changeFalse
(
timeOut
=
false
)
{
changeFalse
(
timeOut
=
false
)
{
this
.
clearTimeouts
();
this
.
clearTimeouts
();
this
.
answering
=
false
;
this
.
answering
=
false
;
this
.
answerList
[
this
.
questionIndex
]
=
-
1
this
.
answerList
[
this
.
questionIndex
]
=
-
1
this
.
stickers
.
changOneSticker
(
this
.
questionIndex
,
false
);
this
.
stickers
.
changOneSticker
(
this
.
questionIndex
,
false
);
this
.
nowPanel
.
failPicesAction
(
timeOut
);
this
.
nowPanel
.
failPicesAction
(
timeOut
);
console
.
log
(
"
选择错误
"
)
console
.
log
(
"
选择错误
"
)
...
@@ -315,29 +325,29 @@ export default class cake_class_1 extends MyCocosSceneComponent {
...
@@ -315,29 +325,29 @@ export default class cake_class_1 extends MyCocosSceneComponent {
}
}
}
}
nextQuestion
(){
nextQuestion
()
{
if
(
this
.
questionIndex
<
(
this
.
data
.
questions
.
length
-
1
))
{
if
(
this
.
questionIndex
<
(
this
.
data
.
questions
.
length
-
1
))
{
this
.
questionIndex
++
;
this
.
questionIndex
++
;
this
.
nextPanel
=
this
.
addPanel
();
this
.
nextPanel
=
this
.
addPanel
();
this
.
nextPanel
.
node
.
x
=
this
.
nextPanel
.
node
.
width
;
this
.
nextPanel
.
node
.
x
=
this
.
nextPanel
.
node
.
width
;
cc
.
tween
(
this
.
nowPanel
.
node
)
cc
.
tween
(
this
.
nowPanel
.
node
)
.
to
(
1
,{
x
:
-
this
.
nowPanel
.
node
.
width
})
.
to
(
1
,
{
x
:
-
this
.
nowPanel
.
node
.
width
})
.
call
((
e
)
=>
{
.
call
((
e
)
=>
{
console
.
log
(
"
e=====
"
,
e
)
console
.
log
(
"
e=====
"
,
e
)
e
.
destroy
();
e
.
destroy
();
})
})
.
start
();
.
start
();
this
.
nowPanel
=
this
.
nextPanel
;
this
.
nowPanel
=
this
.
nextPanel
;
this
.
answerList
[
this
.
questionIndex
]
=
0
;
this
.
answerList
[
this
.
questionIndex
]
=
0
;
this
.
updateUi
()
this
.
updateUi
()
this
.
showPanel
();
this
.
showPanel
();
cc
.
tween
(
this
.
nowPanel
.
node
)
cc
.
tween
(
this
.
nowPanel
.
node
)
.
to
(
1
,{
x
:
0
})
.
to
(
1
,
{
x
:
0
})
.
call
(()
=>
{
.
call
(()
=>
{
})
})
.
start
();
.
start
();
}
else
{
}
else
{
this
.
nowPanel
.
over
(
this
.
answerList
)
this
.
nowPanel
.
over
(
this
.
answerList
)
}
}
...
...
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