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
5728826d
Commit
5728826d
authored
Jul 11, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
可以显示连线组历史记录
parent
3ec21225
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
32 deletions
+60
-32
DG_FAF.ts
assets/DG_FAF/scene/DG_FAF.ts
+52
-24
historyData_DG_FAF.ts
assets/DG_FAF/script/historyData_DG_FAF.ts
+8
-8
No files found.
assets/DG_FAF/scene/DG_FAF.ts
View file @
5728826d
...
@@ -925,8 +925,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -925,8 +925,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 连线组 - 历史记录
// 连线组 - 历史记录
showConnectionGroup
(
configItem
,
resultData
)
{
showConnectionGroup
(
configItem
,
resultData
)
{
console
.
log
(
configItem
,
resultData
)
const
debugMode
=
false
;
const
debugMode
=
false
;
const
resultIconShowData
=
this
.
data
.
hotZoneItemArr
[
configItem
.
linkResultShowHotZoneIndex
];
const
resultIconShowData
=
this
.
data
.
hotZoneItemArr
[
configItem
.
linkResultShowHotZoneIndex
];
const
resultIconRect
=
this
.
newRectNode
(
resultIconShowData
,
layer_2
,
debugMode
);
const
resultIconRect
=
this
.
newRectNode
(
resultIconShowData
,
layer_2
,
debugMode
);
...
@@ -951,24 +949,48 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -951,24 +949,48 @@ export default class SceneComponent extends MyCocosSceneComponent {
resultIconRect
.
addChild
(
errIcon
);
resultIconRect
.
addChild
(
errIcon
);
}
}
resultData
[
0
].
results
.
forEach
((
resData
,
index
)
=>
{
// 连线点都显示出来
const
startHotZoneData
=
this
.
data
.
hotZoneItemArr
[
configItem
.
contentList
[
index
].
selectStartHotZoneIndex
];
const
startRects
=
[];
const
startRect
=
this
.
newRectNode
(
startHotZoneData
,
layer_4
,
debugMode
);
const
endRects
=
[];
configItem
.
contentList
.
forEach
(
item
=>
{
if
(
item
.
selectStartHotZoneIndex
>=
0
&&
this
.
data
.
hotZoneItemArr
[
item
.
selectStartHotZoneIndex
])
{
const
iconStart
=
this
.
getSprNode
(
"
icon_connect_start
"
);
const
startHotZoneData
=
this
.
data
.
hotZoneItemArr
[
item
.
selectStartHotZoneIndex
];
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
);
startRects
.
push
(
startRect
)
}
else
{
startRects
.
push
(
null
)
}
const
endHotZoneData
=
this
.
data
.
hotZoneItemArr
[
configItem
.
contentList
[
resData
.
currentEndIndex
].
selectEndHotZoneIndex
];
if
(
item
.
selectEndHotZoneIndex
>=
0
&&
this
.
data
.
hotZoneItemArr
[
item
.
selectEndHotZoneIndex
])
{
const
endRect
=
this
.
newRectNode
(
endHotZoneData
,
layer_5
,
debugMode
);
const
endHotZoneData
=
this
.
data
.
hotZoneItemArr
[
item
.
selectEndHotZoneIndex
];
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
iconStart
=
this
.
getSprNode
(
"
icon_connect_start
"
);
// 根据用户结果还原显示
const
iconEnd
=
this
.
getSprNode
(
"
icon_connect_end
"
);
resultData
[
0
].
results
.
forEach
((
resData
,
index
)
=>
{
iconStart
.
zIndex
=
layer_2
;
if
(
resData
.
startIndex
<
0
||
resData
.
currentEndIndex
<
0
)
{
iconEnd
.
zIndex
=
layer_2
;
return
iconStart
.
x
=
startRect
.
width
/
2
;
}
iconStart
.
y
=
startRect
.
height
/
2
;
const
startRect
=
startRects
[
resData
.
startIndex
];
iconEnd
.
x
=
endRect
.
width
/
2
;
const
endRect
=
endRects
[
resData
.
currentEndIndex
];
iconEnd
.
y
=
endRect
.
height
/
2
;
endRect
.
addChild
(
iconEnd
);
if
(
!
startRect
||
!
endRect
)
{
startRect
.
addChild
(
iconStart
);
return
}
const
lineNode
=
new
cc
.
Node
();
const
lineNode
=
new
cc
.
Node
();
lineNode
.
name
=
'
connect1_
'
+
index
;
lineNode
.
name
=
'
connect1_
'
+
index
;
...
@@ -987,11 +1009,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -987,11 +1009,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 画线
// 画线
ctx
.
stroke
();
ctx
.
stroke
();
// 结果显示节点
if
(
configItem
.
contentList
[
index
].
selectEndHotZoneShowIndex
&&
configItem
.
contentList
[
index
].
selectEndHotZoneShowIndex
>=
0
&&
this
.
data
.
hotZoneItemArr
[
configItem
.
contentList
[
index
].
selectEndHotZoneShowIndex
]
&&
resData
.
currentEndText
)
{
const
linkedTextData
=
this
.
data
.
hotZoneItemArr
[
configItem
.
contentList
[
index
].
selectEndHotZoneShowIndex
];
const
textNodePartent
=
this
.
newRectNode
(
linkedTextData
,
layer_4
,
debugMode
);
const
textNode
=
this
.
newTextNode
(
resData
.
currentEndText
?
resData
.
currentEndText
:
""
);
textNode
.
x
=
textNodePartent
.
width
/
2
;
textNode
.
y
=
textNodePartent
.
height
/
2
;
textNodePartent
.
addChild
(
textNode
)
}
});
});
}
}
// 判断对错 - 历史记录
// 判断对错 - 历史记录
...
@@ -1806,13 +1833,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -1806,13 +1833,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
};
};
contentData
.
contentList
.
forEach
((
option
,
index
)
=>
{
contentData
.
contentList
.
forEach
((
option
,
index
)
=>
{
const
resultConnectIndex
=
currentConnectionList
.
findIndex
(
item
=>
item
.
linkedIndex
==
index
)
const
detailItem
=
{
const
detailItem
=
{
startIndex
:
index
,
startIndex
:
index
,
startText
:
option
.
startTextShow
?
option
.
startTextShow
:
""
,
startText
:
option
.
startTextShow
?
option
.
startTextShow
:
""
,
correctEndIndex
:
index
,
correctEndIndex
:
index
,
correctEndText
:
option
.
endTextShow
?
option
.
endTextShow
:
""
,
correctEndText
:
option
.
endTextShow
?
option
.
endTextShow
:
""
,
currentEndIndex
:
currentConnectionList
[
index
].
linked
Index
,
currentEndIndex
:
resultConnect
Index
,
currentEndText
:
currentConnectionList
[
index
].
textShow
,
currentEndText
:
resultConnectIndex
>=
0
?
currentConnectionList
[
resultConnectIndex
].
textShow
:
""
,
right
:
true
right
:
true
}
}
if
(
currentConnectionList
[
index
].
linkedIndex
==
index
)
{
if
(
currentConnectionList
[
index
].
linkedIndex
==
index
)
{
...
@@ -2037,7 +2065,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -2037,7 +2065,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
currentConnectionList
.
push
({
currentConnectionList
.
push
({
rect
:
startRect
,
rect
:
startRect
,
linkedIndex
:
-
1
,
linkedIndex
:
-
1
,
textShow
:
option
.
textShow
?
option
.
textShow
:
""
,
textShow
:
option
.
linkedShowText
?
option
.
linkedShowText
:
""
,
})
})
});
});
...
...
assets/DG_FAF/script/historyData_DG_FAF.ts
View file @
5728826d
...
@@ -1123,8 +1123,8 @@ export const historyData = {
...
@@ -1123,8 +1123,8 @@ export const historyData = {
"
startText
"
:
""
,
"
startText
"
:
""
,
"
correctEndIndex
"
:
0
,
"
correctEndIndex
"
:
0
,
"
correctEndText
"
:
""
,
"
correctEndText
"
:
""
,
"
currentEndIndex
"
:
1
,
"
currentEndIndex
"
:
2
,
"
currentEndText
"
:
""
,
"
currentEndText
"
:
"
a
"
,
"
right
"
:
false
"
right
"
:
false
},
},
{
{
...
@@ -1132,8 +1132,8 @@ export const historyData = {
...
@@ -1132,8 +1132,8 @@ export const historyData = {
"
startText
"
:
""
,
"
startText
"
:
""
,
"
correctEndIndex
"
:
1
,
"
correctEndIndex
"
:
1
,
"
correctEndText
"
:
""
,
"
correctEndText
"
:
""
,
"
currentEndIndex
"
:
2
,
"
currentEndIndex
"
:
0
,
"
currentEndText
"
:
""
,
"
currentEndText
"
:
"
b
"
,
"
right
"
:
false
"
right
"
:
false
},
},
{
{
...
@@ -1141,7 +1141,7 @@ export const historyData = {
...
@@ -1141,7 +1141,7 @@ export const historyData = {
"
startText
"
:
""
,
"
startText
"
:
""
,
"
correctEndIndex
"
:
2
,
"
correctEndIndex
"
:
2
,
"
correctEndText
"
:
""
,
"
correctEndText
"
:
""
,
"
currentEndIndex
"
:
0
,
"
currentEndIndex
"
:
-
1
,
"
currentEndText
"
:
""
,
"
currentEndText
"
:
""
,
"
right
"
:
false
"
right
"
:
false
}
}
...
@@ -1177,7 +1177,7 @@ export const historyData = {
...
@@ -1177,7 +1177,7 @@ export const historyData = {
"
totalScore
"
:
0
,
"
totalScore
"
:
0
,
"
isAllRight
"
:
false
,
"
isAllRight
"
:
false
,
"
isAllWrong
"
:
true
,
"
isAllWrong
"
:
true
,
"
startTimestamp
"
:
16890
00426243
,
"
startTimestamp
"
:
16890
57128454
,
"
submitTimestamp
"
:
16890
00433908
,
"
submitTimestamp
"
:
16890
57136559
,
"
answeringTime
"
:
766
5
"
answeringTime
"
:
810
5
}
}
\ 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