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
e6aebe0f
Commit
e6aebe0f
authored
Jul 12, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加连线选择题的历史记录显示
parent
81ce15f6
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1159 additions
and
815 deletions
+1159
-815
DG_FAF.ts
assets/DG_FAF/scene/DG_FAF.ts
+99
-4
defaultData_DG_FAF.ts
assets/DG_FAF/script/defaultData_DG_FAF.ts
+1
-1
historyData_DG_FAF.ts
assets/DG_FAF/script/historyData_DG_FAF.ts
+1059
-810
No files found.
assets/DG_FAF/scene/DG_FAF.ts
View file @
e6aebe0f
...
...
@@ -766,7 +766,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
validater
=
this
.
setCrosswordPuzzleInput
(
configItem
,
isDebug
);
this
.
scoreValidater
.
push
(
validater
);
break
;
// 文字排序
// 文字排序
[做题 - 显示]
case
SORT_WORDS
:
validater
=
this
.
setSortWords
(
configItem
,
this
.
data
.
hotZoneItemArr
[
configItem
.
linkHotZoneIndex
],
isDebug
);
this
.
scoreValidater
.
push
(
validater
);
...
...
@@ -776,7 +776,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
validater
=
this
.
setPronunciationAssessment
(
configItem
,
this
.
data
.
hotZoneItemArr
[
configItem
.
linkHotZoneIndex
]);
this
.
scoreValidater
.
push
(
validater
);
break
;
// 连线选择
// 连线选择
[做题 - 显示]
case
CONNECTION_CHOICE
:
validater
=
this
.
setConnectionChoice
(
configItem
,
isDebug
);
this
.
scoreValidater
.
push
(
validater
);
...
...
@@ -867,6 +867,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
case
SORT_WORDS
:
this
.
showSortWords
(
configItem
,
resultData
);
break
;
// 语音评测
case
PRONUNCIATION_ASSESSMENT
:
this
.
showPronunciationAssessment
(
configItem
,
resultData
);
break
;
// 连线选择
case
CONNECTION_CHOICE
:
this
.
showConnectionChoice
(
configItem
,
resultData
);
break
;
}
})
...
...
@@ -1418,6 +1426,93 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
// 语音评测题型 - 历史记录
showPronunciationAssessment
(
configItem
,
resultData
)
{
console
.
log
(
configItem
,
resultData
)
}
// 连线选择 - 历史记录
showConnectionChoice
(
configItem
,
resultData
)
{
console
.
log
(
configItem
,
resultData
)
const
debugMode
=
false
;
const
resultIconShowData
=
this
.
data
.
hotZoneItemArr
[
configItem
.
linkResultShowHotZoneIndex
];
const
resultIconRect
=
this
.
newRectNode
(
resultIconShowData
,
layer_2
,
debugMode
);
const
errIcon
=
getSprNode
(
"
icon_answer_wrong
"
);
const
rightIcon
=
getSprNode
(
"
icon_answer_right
"
);
// 图标太大 缩小一半
errIcon
.
scale
=
rightIcon
.
scale
=
0.5
;
// 显示在热区的中间
errIcon
.
x
=
rightIcon
.
x
=
resultIconRect
.
width
/
2
;
errIcon
.
y
=
rightIcon
.
y
=
resultIconRect
.
height
/
2
;
if
(
resultData
[
0
].
result
.
right
)
{
resultIconRect
.
addChild
(
rightIcon
);
}
else
{
resultIconRect
.
addChild
(
errIcon
);
}
const
iconStart
=
this
.
getSprNode
(
"
icon_connect_start
"
);
const
startHotZoneData
=
this
.
data
.
hotZoneItemArr
[
configItem
.
linkHotZoneIndex
];
const
startRect
=
this
.
newRectNode
(
startHotZoneData
,
layer_4
,
debugMode
);
iconStart
.
zIndex
=
layer_2
;
iconStart
.
x
=
startRect
.
width
/
2
;
iconStart
.
y
=
startRect
.
height
/
2
;
startRect
.
addChild
(
iconStart
);
// 连线点都显示出来
const
endRects
=
[];
configItem
.
contentList
.
forEach
(
item
=>
{
if
(
item
.
selectHotZoneIndex
>=
0
&&
this
.
data
.
hotZoneItemArr
[
item
.
selectHotZoneIndex
])
{
const
endHotZoneData
=
this
.
data
.
hotZoneItemArr
[
item
.
selectHotZoneIndex
];
const
endRect
=
this
.
newRectNode
(
endHotZoneData
,
layer_5
,
debugMode
);
const
iconEnd
=
this
.
getSprNode
(
"
icon_connect_end
"
);
iconEnd
.
zIndex
=
layer_2
;
iconEnd
.
x
=
endRect
.
width
/
2
;
iconEnd
.
y
=
endRect
.
height
/
2
;
endRect
.
addChild
(
iconEnd
);
endRects
.
push
(
endRect
)
}
else
{
endRects
.
push
(
null
)
}
});
const
endRect
=
endRects
[
resultData
[
0
].
result
.
currentEndIndex
];
if
(
!
startRect
||
!
endRect
)
{
return
}
const
lineNode
=
new
cc
.
Node
();
lineNode
.
name
=
'
connect1_0
'
;
startRect
.
addChild
(
lineNode
)
const
ctx
=
lineNode
.
addComponent
(
cc
.
Graphics
);
ctx
.
lineWidth
=
4
;
const
localPos
=
lineNode
.
parent
.
convertToNodeSpaceAR
(
endRect
.
parent
.
convertToWorldSpaceAR
(
cc
.
v2
(
endRect
.
x
+
endRect
.
width
/
2
,
endRect
.
y
+
endRect
.
height
/
2
)));
// 清除上一次的痕迹
ctx
.
clear
()
// 移动到当前开始节点的中心开始画线
ctx
.
moveTo
(
startRect
.
width
/
2
,
startRect
.
height
/
2
);
// 终点坐标在上面已经计算好了 这里使用
ctx
.
lineTo
(
localPos
.
x
,
localPos
.
y
);
// 画线
ctx
.
stroke
();
// 结果显示节点
if
(
configItem
.
linkHotZoneShowIndex
&&
configItem
.
linkHotZoneShowIndex
>=
0
&&
this
.
data
.
hotZoneItemArr
[
configItem
.
linkHotZoneShowIndex
]
&&
resultData
[
0
].
result
.
currentEndText
)
{
const
linkedTextData
=
this
.
data
.
hotZoneItemArr
[
configItem
.
linkHotZoneShowIndex
];
const
textNodePartent
=
this
.
newRectNode
(
linkedTextData
,
layer_4
,
debugMode
);
const
textNode
=
this
.
newTextNode
(
resultData
[
0
].
result
.
currentEndText
?
resultData
[
0
].
result
.
currentEndText
:
""
);
textNode
.
x
=
textNodePartent
.
width
/
2
;
textNode
.
y
=
textNodePartent
.
height
/
2
;
textNodePartent
.
addChild
(
textNode
)
}
}
// 初始化分数牌
subScorePanels
=
[];
totalScorePanel
=
null
;
...
...
@@ -2988,14 +3083,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
validater
=
()
=>
{
const
result
=
{
detail
:
{
contentType
:
CONNECTION
,
contentType
:
CONNECTION
_CHOICE
,
configIndex
:
contentData
.
index
,
contentIndex
:
-
1
,
result
:
{
correctEndIndex
:
correctConnectIndex
,
correctEndText
:
correctConnectTextShow
,
currentEndIndex
:
currentConnectIndex
,
currentEndText
:
currentConnect
TextShow
,
currentEndText
:
currentConnect
Index
>=
0
&&
contentData
.
contentList
[
currentConnectIndex
]
?
contentData
.
contentList
[
currentConnectIndex
].
linkedShowText
:
""
,
right
:
true
}
},
...
...
assets/DG_FAF/script/defaultData_DG_FAF.ts
View file @
e6aebe0f
This diff is collapsed.
Click to expand it.
assets/DG_FAF/script/historyData_DG_FAF.ts
View file @
e6aebe0f
This diff is collapsed.
Click to expand it.
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