Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DG_FAF
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
DG_FAF
Commits
897f2241
Commit
897f2241
authored
Jun 19, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加虎阅对应的分数体系配置
parent
4e7aad42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
4 deletions
+50
-4
DG_FAF.ts
assets/DG_FAF/scene/DG_FAF.ts
+48
-4
form.component.ts
form_angular/src/app/form/form.component.ts
+2
-0
No files found.
assets/DG_FAF/scene/DG_FAF.ts
View file @
897f2241
...
...
@@ -41,6 +41,7 @@ const RS_30_5L_FAF = "2";
const
RS_40_5L_FAF
=
"
5
"
;
const
RS_100_3L_FAF
=
"
3
"
;
const
RS_120_3L_FAF
=
"
6
"
;
const
RS_NONE_3L_HY
=
"
7
"
;
const
layer_1
=
5
// 布局层1 [热区背景图]
const
layer_2
=
10
// 布局层2 [装饰框 色块 结果展示]
...
...
@@ -455,12 +456,35 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
// 根据评分体系显示对应的提示语
showEndAnimationByRatingSystem
(
score
,
ratingSystem
)
{
const
aniName
=
this
.
getAniNameByRatingSystem
(
score
,
ratingSystem
);
showEndAnimationByRatingSystem
(
resultData
,
ratingSystem
)
{
const
{
totalScore
,
isAllRight
,
isAllWrong
}
=
resultData
;
let
aniName
=
"
Default
"
const
scoreNode
=
cc
.
find
(
"
score
"
,
this
.
scoreShowContainer
);
if
(
ratingSystem
==
RS_NONE_3L_HY
)
{
if
(
isAllRight
)
{
aniName
=
"
Default
"
;
console
.
log
(
"
虎阅全对
"
)
}
else
if
(
isAllWrong
)
{
aniName
=
"
Default
"
console
.
log
(
"
虎阅全错误
"
)
}
else
{
aniName
=
"
Default
"
console
.
log
(
"
虎阅一般
"
)
}
scoreNode
.
active
=
false
;
}
else
{
scoreNode
.
active
=
true
;
aniName
=
this
.
getAniNameByRatingSystem
(
totalScore
,
ratingSystem
);
}
const
animationNode
=
cc
.
find
(
`EndAnimation/
${
aniName
}
`
,
this
.
scoreShowContainer
);
const
scoreLabel
=
cc
.
find
(
"
score/number
"
,
this
.
scoreShowContainer
).
getComponent
(
cc
.
RichText
);
scoreLabel
.
string
=
`<outline color=#663333 width=5><color=#FFCC00>
${
s
core
}
</color></outline>`
;
scoreLabel
.
string
=
`<outline color=#663333 width=5><color=#FFCC00>
${
totalS
core
}
</color></outline>`
;
this
.
scoreShowContainer
.
opacity
=
0
;
this
.
scoreShowContainer
.
active
=
true
;
...
...
@@ -3726,11 +3750,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
scoreCconfigArr
:
[],
basicScore
:
0
,
totalScore
:
0
,
isAllRight
:
false
,
isAllWrong
:
false
,
startTimestamp
:
this
.
startTimestamp
,
submitTimestamp
:
new
Date
().
getTime
(),
answeringTime
:
null
,
}
let
rightCount
=
0
;
let
wrongCount
=
0
;
// 计算答题时长
resultData
.
answeringTime
=
resultData
.
submitTimestamp
-
resultData
.
startTimestamp
;
...
...
@@ -3763,6 +3792,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
result
.
allRight
)
{
// 回答正确
rightCount
++
;
if
(
result
.
rect
!=
null
)
{
// 显示在热区的中间
errIcon
.
x
=
rightIcon
.
x
=
result
.
rect
.
width
/
2
;
...
...
@@ -3780,6 +3810,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
else
{
// 回答错误
wrongCount
++
;
if
(
result
.
rect
!=
null
)
{
// 显示在热区的中间
errIcon
.
x
=
rightIcon
.
x
=
result
.
rect
.
width
/
2
;
...
...
@@ -3800,6 +3831,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
})
if
(
rightCount
==
0
)
{
resultData
.
isAllRight
=
false
;
resultData
.
isAllWrong
=
true
;
}
else
if
(
wrongCount
==
0
)
{
resultData
.
isAllRight
=
true
;
resultData
.
isAllWrong
=
false
;
}
let
totalScore
=
0
;
resultData
.
scoreCconfigArr
.
forEach
((
score
,
index
)
=>
{
// 累加各个分数区域
...
...
@@ -3823,7 +3862,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
resultData
.
totalScore
=
totalScore
;
this
.
resultData
=
resultData
;
console
.
log
(
"
答案校验完毕
"
,
resultData
)
this
.
showEndAnimationByRatingSystem
(
resultData
.
totalScore
,
this
.
data
.
ratingSystem
)
this
.
showEndAnimationByRatingSystem
({
totalScore
:
resultData
.
totalScore
,
isAllRight
:
resultData
.
isAllRight
,
isAllWrong
:
resultData
.
isAllWrong
,
},
this
.
data
.
ratingSystem
)
// 如果配置了分数显示区域 - 显示分数
if
(
this
.
totalScorePanel
)
{
...
...
form_angular/src/app/form/form.component.ts
View file @
897f2241
...
...
@@ -69,6 +69,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
RS_40_5L_FAF
=
"
5
"
;
RS_100_3L_FAF
=
"
3
"
;
RS_120_3L_FAF
=
"
6
"
;
RS_NONE_3L_HY
=
"
7
"
;
// 评分体系 清单
ratingSystemList
=
[
...
...
@@ -79,6 +80,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
{
label
:
"
40分 5段 - FAF
"
,
value
:
this
.
RS_40_5L_FAF
},
{
label
:
"
100分 3段 - FAF
"
,
value
:
this
.
RS_100_3L_FAF
},
{
label
:
"
120分 3段 - FAF
"
,
value
:
this
.
RS_120_3L_FAF
},
{
label
:
"
无分数 3段 - 虎阅
"
,
value
:
this
.
RS_NONE_3L_HY
},
]
// 保存锁
...
...
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