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
145fcce6
Commit
145fcce6
authored
Jul 12, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加连线PRO历史记录展示
parent
e6aebe0f
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
154 additions
and
22 deletions
+154
-22
DG_FAF.ts
assets/DG_FAF/scene/DG_FAF.ts
+96
-0
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
+57
-21
No files found.
assets/DG_FAF/scene/DG_FAF.ts
View file @
145fcce6
...
...
@@ -855,6 +855,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
case
CONNECTION
:
this
.
showConnectionGroup
(
configItem
,
resultData
);
break
;
// 连线PRO
case
CONNECTION_PRO
:
this
.
showConnectionPro
(
configItem
,
resultData
);
break
;
// 文字输入
case
TEXTINPUT
:
this
.
showTextInput
(
configItem
,
resultData
);
...
...
@@ -1041,6 +1045,98 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
}
// 连线PRO - 历史记录
showConnectionPro
(
configItem
,
resultData
)
{
const
debugMode
=
false
;
const
resultIconShowData
=
this
.
data
.
hotZoneItemArr
[
configItem
.
linkResultShowHotZoneIndex
];
const
resultIconRect
=
this
.
newRectNode
(
resultIconShowData
,
layer_2
,
debugMode
);
let
allRight
=
true
;
resultData
[
0
].
results
.
forEach
(
item
=>
{
if
(
item
.
right
==
false
)
{
allRight
=
false
}
});
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
(
allRight
)
{
resultIconRect
.
addChild
(
rightIcon
);
}
else
{
resultIconRect
.
addChild
(
errIcon
);
}
// 连线点都显示出来
const
startRects
=
[];
const
endRects
=
[];
configItem
.
connectionPRO_startArr
.
forEach
(
startIndex
=>
{
if
(
startIndex
>=
0
&&
this
.
data
.
hotZoneItemArr
[
startIndex
])
{
const
iconStart
=
this
.
getSprNode
(
"
icon_connect_start
"
);
const
startHotZoneData
=
this
.
data
.
hotZoneItemArr
[
startIndex
];
const
startRect
=
this
.
newRectNode
(
startHotZoneData
,
layer_4
,
debugMode
);
startRect
.
hotZoneIndex
=
startIndex
;
iconStart
.
zIndex
=
layer_2
;
iconStart
.
x
=
startRect
.
width
/
2
;
iconStart
.
y
=
startRect
.
height
/
2
;
startRect
.
addChild
(
iconStart
);
startRects
.
push
(
startRect
)
}
else
{
startRects
.
push
(
null
)
}
});
configItem
.
connectionPRO_endArr
.
forEach
(
endIndex
=>
{
if
(
endIndex
>=
0
&&
this
.
data
.
hotZoneItemArr
[
endIndex
])
{
const
endHotZoneData
=
this
.
data
.
hotZoneItemArr
[
endIndex
];
const
endRect
=
this
.
newRectNode
(
endHotZoneData
,
layer_5
,
debugMode
);
endRect
.
hotZoneIndex
=
endIndex
;
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
)
}
});
// 根据用户结果还原显示
resultData
[
0
].
results
.
forEach
((
resData
,
index
)
=>
{
if
(
resData
.
correctStartIndex
<
0
||
resData
.
correctEndIndex
<
0
)
{
return
}
const
startRect
=
startRects
.
find
(
item
=>
item
.
hotZoneIndex
==
resData
.
correctStartIndex
)
const
endRect
=
endRects
.
find
(
item
=>
item
.
hotZoneIndex
==
resData
.
correctEndIndex
)
if
(
!
startRect
||
!
endRect
)
{
return
}
const
lineNode
=
new
cc
.
Node
();
lineNode
.
name
=
'
connect1_
'
+
index
;
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
();
})
}
// 判断对错 - 历史记录
showRightOrWrongGroup
(
configItem
,
resultData
)
{
const
debugMode
=
false
;
...
...
assets/DG_FAF/script/defaultData_DG_FAF.ts
View file @
145fcce6
This diff is collapsed.
Click to expand it.
assets/DG_FAF/script/historyData_DG_FAF.ts
View file @
145fcce6
...
...
@@ -1046,9 +1046,12 @@ export const historyData = {
"
index
"
:
13
},
{
"
hotZoneType
"
:
"
1
1
"
,
"
hotZoneType
"
:
"
1
8
"
,
"
linkHotZoneIndex
"
:
33
,
"
connectionPRO_startArr
"
:
[],
"
connectionPRO_startArr
"
:
[
32
,
33
],
"
connectionPRO_endtArr
"
:
[],
"
audio_url
"
:
""
,
"
video_url
"
:
""
,
...
...
@@ -1079,8 +1082,8 @@ export const historyData = {
"
isCorrect
"
:
false
,
"
isCheck
"
:
false
,
"
linkedShowText
"
:
"
A
"
,
"
selectStartHotZoneIndex
"
:
null
,
"
selectEndHotZoneIndex
"
:
null
,
"
selectStartHotZoneIndex
"
:
32
,
"
selectEndHotZoneIndex
"
:
34
,
"
selectEndHotZoneShowIndex
"
:
null
,
"
selectStartHotZoneIndex_1
"
:
null
,
"
selectEndHotZoneIndex_1
"
:
null
,
...
...
@@ -1112,8 +1115,8 @@ export const historyData = {
"
isCorrect
"
:
true
,
"
isCheck
"
:
false
,
"
linkedShowText
"
:
"
B
"
,
"
selectStartHotZoneIndex
"
:
null
,
"
selectEndHotZoneIndex
"
:
null
,
"
selectStartHotZoneIndex
"
:
33
,
"
selectEndHotZoneIndex
"
:
35
,
"
selectEndHotZoneShowIndex
"
:
null
,
"
selectStartHotZoneIndex_1
"
:
null
,
"
selectEndHotZoneIndex_1
"
:
null
,
...
...
@@ -1145,8 +1148,8 @@ export const historyData = {
"
isCorrect
"
:
false
,
"
isCheck
"
:
false
,
"
linkedShowText
"
:
"
C
"
,
"
selectStartHotZoneIndex
"
:
null
,
"
selectEndHotZoneIndex
"
:
null
,
"
selectStartHotZoneIndex
"
:
32
,
"
selectEndHotZoneIndex
"
:
36
,
"
selectEndHotZoneShowIndex
"
:
null
,
"
selectStartHotZoneIndex_1
"
:
null
,
"
selectEndHotZoneIndex_1
"
:
null
,
...
...
@@ -1167,8 +1170,13 @@ export const historyData = {
"
selectHotZoneIndex
"
:
36
}
],
"
linkResultShowHotZoneIndex
"
:
3
2
,
"
linkResultShowHotZoneIndex
"
:
3
7
,
"
linkHotZoneShowIndex
"
:
37
,
"
connectionPRO_endArr
"
:
[
34
,
35
,
36
],
"
index
"
:
14
}
],
...
...
@@ -1198,7 +1206,7 @@ export const historyData = {
],
"
ratingSystem
"
:
"
0
"
,
"
basicScore
"
:
""
,
"
lastModify
"
:
"
2023-07-12T0
8:26:37.427
Z
"
"
lastModify
"
:
"
2023-07-12T0
9:19:34.322
Z
"
},
"
details
"
:
[
{
...
...
@@ -1378,16 +1386,44 @@ export const historyData = {
]
},
{
"
contentType
"
:
"
1
1
"
,
"
contentType
"
:
"
1
8
"
,
"
configIndex
"
:
14
,
"
contentIndex
"
:
-
1
,
"
result
"
:
{
"
correctEndIndex
"
:
-
1
,
"
correctEndText
"
:
""
,
"
currentEndIndex
"
:
1
,
"
currentEndText
"
:
"
B
"
,
"
right
"
:
true
}
"
results
"
:
[
{
"
startIndex
"
:
0
,
"
startText
"
:
""
,
"
correctStartIndex
"
:
32
,
"
correctEndIndex
"
:
34
,
"
correctEndText
"
:
""
,
"
currentStartIndex
"
:
null
,
"
currentEndIndex
"
:
null
,
"
currentEndText
"
:
""
,
"
right
"
:
true
},
{
"
startIndex
"
:
1
,
"
startText
"
:
""
,
"
correctStartIndex
"
:
33
,
"
correctEndIndex
"
:
35
,
"
correctEndText
"
:
""
,
"
currentStartIndex
"
:
null
,
"
currentEndIndex
"
:
null
,
"
currentEndText
"
:
""
,
"
right
"
:
true
},
{
"
startIndex
"
:
2
,
"
startText
"
:
""
,
"
correctStartIndex
"
:
32
,
"
correctEndIndex
"
:
36
,
"
correctEndText
"
:
""
,
"
currentStartIndex
"
:
null
,
"
currentEndIndex
"
:
null
,
"
currentEndText
"
:
""
,
"
right
"
:
true
}
]
}
],
"
scoreCconfigArr
"
:
[
...
...
@@ -1419,7 +1455,7 @@ export const historyData = {
"
totalScore
"
:
0
,
"
isAllRight
"
:
false
,
"
isAllWrong
"
:
false
,
"
startTimestamp
"
:
168915
1973011
,
"
submitTimestamp
"
:
168915
1981570
,
"
answeringTime
"
:
8559
"
startTimestamp
"
:
168915
3616958
,
"
submitTimestamp
"
:
168915
3631321
,
"
answeringTime
"
:
14363
}
\ No newline at end of file
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