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
15844363
Commit
15844363
authored
Jul 11, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加文字输入题型历史记录显示
parent
81e5273d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
20 deletions
+63
-20
DG_FAF.ts
assets/DG_FAF/scene/DG_FAF.ts
+45
-2
historyData_DG_FAF.ts
assets/DG_FAF/script/historyData_DG_FAF.ts
+18
-18
No files found.
assets/DG_FAF/scene/DG_FAF.ts
View file @
15844363
...
@@ -756,7 +756,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -756,7 +756,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
validater
=
this
.
setConnectionPro
(
configItem
,
isDebug
);
validater
=
this
.
setConnectionPro
(
configItem
,
isDebug
);
this
.
scoreValidater
.
push
(
validater
);
this
.
scoreValidater
.
push
(
validater
);
break
;
break
;
// 文字输入区
// 文字输入区
[做题 - 显示]
case
TEXTINPUT
:
case
TEXTINPUT
:
validater
=
this
.
setTextInput
(
configItem
,
this
.
data
.
hotZoneItemArr
[
configItem
.
linkHotZoneIndex
],
isDebug
);
validater
=
this
.
setTextInput
(
configItem
,
this
.
data
.
hotZoneItemArr
[
configItem
.
linkHotZoneIndex
],
isDebug
);
this
.
scoreValidater
.
push
(
validater
);
this
.
scoreValidater
.
push
(
validater
);
...
@@ -855,6 +855,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -855,6 +855,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
case
CONNECTION
:
case
CONNECTION
:
this
.
showConnectionGroup
(
configItem
,
resultData
);
this
.
showConnectionGroup
(
configItem
,
resultData
);
break
;
break
;
// 文字输入
case
TEXTINPUT
:
this
.
showTextInput
(
configItem
,
resultData
);
break
;
}
}
})
})
...
@@ -873,7 +877,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -873,7 +877,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
newDecorativeFrame
(
hotZoneItemData
,
layer_1
,
"
#FFFFFF
"
,
"
#6dbef6
"
,
debugMode
);
this
.
newDecorativeFrame
(
hotZoneItemData
,
layer_1
,
"
#FFFFFF
"
,
"
#6dbef6
"
,
debugMode
);
const
rect
=
this
.
newRectNode
(
hotZoneItemData
,
layer_4
,
debugMode
);
const
rect
=
this
.
newRectNode
(
hotZoneItemData
,
layer_4
,
debugMode
);
const
historyItem
=
resultData
.
find
(
item
=>
item
.
contentIndex
==
index
)
const
historyItem
=
resultData
.
find
(
item
=>
item
.
contentIndex
==
index
)
const
textShow
=
historyItem
.
currentSelectIndex
?
configItem
.
selectOptionList
[
historyItem
.
currentSelectIndex
].
text
:
""
const
textShow
=
historyItem
.
currentSelectIndex
!=
undefined
&&
historyItem
.
currentSelectIndex
>=
0
?
configItem
.
selectOptionList
[
historyItem
.
currentSelectIndex
].
text
:
""
const
inputLabel
=
this
.
newInputTextNode
(
textShow
+
""
,
0
);
const
inputLabel
=
this
.
newInputTextNode
(
textShow
+
""
,
0
);
inputLabel
.
x
=
rect
.
width
/
2
;
inputLabel
.
x
=
rect
.
width
/
2
;
inputLabel
.
y
=
rect
.
height
/
2
;
inputLabel
.
y
=
rect
.
height
/
2
;
...
@@ -1240,6 +1244,45 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -1240,6 +1244,45 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
})
}
}
// 文字输入 - 结果展示
showTextInput
(
configItem
,
resultData
)
{
const
debugMode
=
false
;
const
hotZoneItemData
=
this
.
data
.
hotZoneItemArr
[
configItem
.
linkHotZoneIndex
];
const
resultRect
=
this
.
newRectNode
(
hotZoneItemData
,
layer_2
,
debugMode
);
this
.
newDecorativeFrame
(
hotZoneItemData
,
layer_1
,
"
#FFFFFF
"
,
"
#6dbef6
"
,
debugMode
);
const
rect
=
this
.
newRectNode
(
hotZoneItemData
,
layer_4
,
debugMode
);
const
inputLabel
=
this
.
newInputTextNode
(
resultData
[
0
].
currentInputText
?
resultData
[
0
].
currentInputText
:
""
,
0
);
const
labelCom
=
inputLabel
.
getComponent
(
cc
.
Label
);
inputLabel
.
x
=
rect
.
width
/
2
;
inputLabel
.
y
=
rect
.
height
/
2
;
inputLabel
.
width
=
rect
.
width
;
inputLabel
.
height
=
rect
.
height
;
// 文字根据设置是否居左对齐
if
(
configItem
.
textAlignLeft
)
{
labelCom
.
horizontalAlign
=
0
;
}
else
{
labelCom
.
horizontalAlign
=
1
;
}
// 超出宽度换行
labelCom
.
overflow
=
3
;
rect
.
addChild
(
inputLabel
);
// 对错号
const
errIcon
=
getSprNode
(
"
icon_answer_wrong
"
);
const
rightIcon
=
getSprNode
(
"
icon_answer_right
"
);
// 图标太大 缩小一半
errIcon
.
scale
=
rightIcon
.
scale
=
0.5
;
// 显示在热区的中间
errIcon
.
x
=
rightIcon
.
x
=
resultRect
.
width
/
2
;
errIcon
.
y
=
rightIcon
.
y
=
resultRect
.
height
/
2
;
if
(
resultData
[
0
].
right
)
{
resultRect
.
addChild
(
rightIcon
);
}
else
{
resultRect
.
addChild
(
errIcon
);
}
}
// 初始化分数牌
// 初始化分数牌
subScorePanels
=
[];
subScorePanels
=
[];
totalScorePanel
=
null
;
totalScorePanel
=
null
;
...
...
assets/DG_FAF/script/historyData_DG_FAF.ts
View file @
15844363
...
@@ -975,15 +975,15 @@ export const historyData = {
...
@@ -975,15 +975,15 @@ export const historyData = {
"
contentType
"
:
"
5
"
,
"
contentType
"
:
"
5
"
,
"
configIndex
"
:
0
,
"
configIndex
"
:
0
,
"
contentIndex
"
:
-
1
,
"
contentIndex
"
:
-
1
,
"
currentInputText
"
:
""
,
"
currentInputText
"
:
"
lay
"
,
"
correctText
"
:
"
lay
"
,
"
correctText
"
:
"
lay
"
,
"
right
"
:
fals
e
"
right
"
:
tru
e
},
},
{
{
"
contentType
"
:
"
5
"
,
"
contentType
"
:
"
5
"
,
"
configIndex
"
:
1
,
"
configIndex
"
:
1
,
"
contentIndex
"
:
-
1
,
"
contentIndex
"
:
-
1
,
"
currentInputText
"
:
""
,
"
currentInputText
"
:
"
ocker
"
,
"
correctText
"
:
"
occer
"
,
"
correctText
"
:
"
occer
"
,
"
right
"
:
false
"
right
"
:
false
},
},
...
@@ -1077,28 +1077,28 @@ export const historyData = {
...
@@ -1077,28 +1077,28 @@ export const historyData = {
"
contentType
"
:
"
0
"
,
"
contentType
"
:
"
0
"
,
"
configIndex
"
:
12
,
"
configIndex
"
:
12
,
"
contentIndex
"
:
0
,
"
contentIndex
"
:
0
,
"
currentSelectIndex
"
:
0
,
"
currentSelectIndex
"
:
null
,
"
currentSelectText
"
:
"
can
"
,
"
currentSelectText
"
:
""
,
"
correctSelectIndex
"
:
0
,
"
correctSelectIndex
"
:
0
,
"
correctSelectText
"
:
""
,
"
correctSelectText
"
:
""
,
"
right
"
:
tru
e
"
right
"
:
fals
e
},
},
{
{
"
contentType
"
:
"
0
"
,
"
contentType
"
:
"
0
"
,
"
configIndex
"
:
12
,
"
configIndex
"
:
12
,
"
contentIndex
"
:
1
,
"
contentIndex
"
:
1
,
"
currentSelectIndex
"
:
1
,
"
currentSelectIndex
"
:
null
,
"
currentSelectText
"
:
"
can't
"
,
"
currentSelectText
"
:
""
,
"
correctSelectIndex
"
:
1
,
"
correctSelectIndex
"
:
1
,
"
correctSelectText
"
:
""
,
"
correctSelectText
"
:
""
,
"
right
"
:
tru
e
"
right
"
:
fals
e
},
},
{
{
"
contentType
"
:
"
0
"
,
"
contentType
"
:
"
0
"
,
"
configIndex
"
:
12
,
"
configIndex
"
:
12
,
"
contentIndex
"
:
2
,
"
contentIndex
"
:
2
,
"
currentSelectIndex
"
:
0
,
"
currentSelectIndex
"
:
null
,
"
currentSelectText
"
:
"
can
"
,
"
currentSelectText
"
:
""
,
"
correctSelectIndex
"
:
2
,
"
correctSelectIndex
"
:
2
,
"
correctSelectText
"
:
""
,
"
correctSelectText
"
:
""
,
"
right
"
:
false
"
right
"
:
false
...
@@ -1107,8 +1107,8 @@ export const historyData = {
...
@@ -1107,8 +1107,8 @@ export const historyData = {
"
contentType
"
:
"
0
"
,
"
contentType
"
:
"
0
"
,
"
configIndex
"
:
12
,
"
configIndex
"
:
12
,
"
contentIndex
"
:
3
,
"
contentIndex
"
:
3
,
"
currentSelectIndex
"
:
1
,
"
currentSelectIndex
"
:
null
,
"
currentSelectText
"
:
"
can't
"
,
"
currentSelectText
"
:
""
,
"
correctSelectIndex
"
:
3
,
"
correctSelectIndex
"
:
3
,
"
correctSelectText
"
:
""
,
"
correctSelectText
"
:
""
,
"
right
"
:
false
"
right
"
:
false
...
@@ -1170,14 +1170,14 @@ export const historyData = {
...
@@ -1170,14 +1170,14 @@ export const historyData = {
15
,
15
,
16
16
],
],
"
score
"
:
2
"
score
"
:
0.5
}
}
],
],
"
basicScore
"
:
0
,
"
basicScore
"
:
0
,
"
totalScore
"
:
2
,
"
totalScore
"
:
0.5
,
"
isAllRight
"
:
false
,
"
isAllRight
"
:
false
,
"
isAllWrong
"
:
false
,
"
isAllWrong
"
:
false
,
"
startTimestamp
"
:
16890
57318710
,
"
startTimestamp
"
:
16890
61179336
,
"
submitTimestamp
"
:
16890
58114291
,
"
submitTimestamp
"
:
16890
61205879
,
"
answeringTime
"
:
795581
"
answeringTime
"
:
26543
}
}
\ 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