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
fa0a16f7
Commit
fa0a16f7
authored
Mar 25, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加区分大小写选项
parent
2874ed85
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
505 additions
and
453 deletions
+505
-453
DG_FAF.ts
assets/DG_FAF/scene/DG_FAF.ts
+24
-6
defaultData_DG_FAF.ts
assets/DG_FAF/script/defaultData_DG_FAF.ts
+1
-1
main-es2015.js
form/main-es2015.js
+176
-169
main-es2015.js.map
form/main-es2015.js.map
+1
-1
main-es5.js
form/main-es5.js
+300
-275
main-es5.js.map
form/main-es5.js.map
+1
-1
form.component.html
form_angular/src/app/form/form.component.html
+1
-0
form.component.ts
form_angular/src/app/form/form.component.ts
+1
-0
No files found.
assets/DG_FAF/scene/DG_FAF.ts
View file @
fa0a16f7
...
@@ -1713,12 +1713,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -1713,12 +1713,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
right
=
false
;
let
right
=
false
;
if
(
contentData
.
keyWordMatch
)
{
if
(
contentData
.
keyWordMatch
)
{
// 关键词匹配,只有回答文字中包含全部关键词,就算对
// 关键词匹配,只有回答文字中包含全部关键词,就算对
right
=
this
.
fuzzyMatchingString
(
currentInputText
,
contentData
.
inputText
)
right
=
this
.
fuzzyMatchingString
(
currentInputText
,
contentData
.
inputText
,
contentData
.
isCaseInsensitive
)
}
else
if
(
contentData
.
openAnswer
)
{
}
else
if
(
contentData
.
openAnswer
)
{
// 开放型回答 只要有内容就算对
// 开放型回答 只要有内容就算对
right
=
currentInputText
!=
""
right
=
currentInputText
!=
""
}
else
{
}
else
{
right
=
currentInputText
==
contentData
.
inputText
;
if
(
contentData
.
isCaseInsensitive
)
{
// 不区分大小写
right
=
currentInputText
.
toLocaleLowerCase
()
==
contentData
.
inputText
.
toLocaleLowerCase
();
}
else
{
// 区分大小写 完全相等
right
=
currentInputText
==
contentData
.
inputText
;
}
}
}
if
(
right
)
{
if
(
right
)
{
...
@@ -2188,12 +2194,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -2188,12 +2194,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
right
=
false
;
let
right
=
false
;
// 判断是否启用关键词匹配
// 判断是否启用关键词匹配
if
(
contentData
.
keyWordMatch
)
{
if
(
contentData
.
keyWordMatch
)
{
right
=
this
.
fuzzyMatchingString
(
recordText
,
evaText
)
right
=
this
.
fuzzyMatchingString
(
recordText
,
evaText
,
contentData
.
isCaseInsensitive
)
}
else
if
(
contentData
.
openAnswer
)
{
}
else
if
(
contentData
.
openAnswer
)
{
// 开放型回答 只要有内容就算对
// 开放型回答 只要有内容就算对
right
=
recordText
!=
""
right
=
recordText
!=
""
}
else
{
}
else
{
right
=
recordText
==
evaText
;
if
(
contentData
.
isCaseInsensitive
)
{
// 不区分大小写
right
=
recordText
.
toLocaleLowerCase
()
==
evaText
.
toLocaleLowerCase
();
}
else
{
// 区分大小写 完全相等
right
=
recordText
==
evaText
;
}
}
}
if
(
right
)
{
if
(
right
)
{
...
@@ -2650,7 +2662,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -2650,7 +2662,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
// 模糊匹配字符串 1,2,3
// 模糊匹配字符串 1,2,3
fuzzyMatchingString
(
testString
,
matchString
){
fuzzyMatchingString
(
testString
,
matchString
,
isCaseInsensitive
){
matchString
.
replace
(
/,/g
,
"
,
"
);
matchString
.
replace
(
/,/g
,
"
,
"
);
const
_keyWordGroup
=
matchString
.
split
(
"
|
"
);
// 大的分组 任何一个组匹配了 都算对
const
_keyWordGroup
=
matchString
.
split
(
"
|
"
);
// 大的分组 任何一个组匹配了 都算对
...
@@ -2669,7 +2681,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -2669,7 +2681,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
// console.log(key)
// console.log(key)
// console.log(testString.toLocaleLowerCase())
// console.log(testString.toLocaleLowerCase())
// console.log(testString.toLocaleLowerCase().indexOf(key.toLocaleLowerCase()))
// console.log(testString.toLocaleLowerCase().indexOf(key.toLocaleLowerCase()))
return
testString
.
toLocaleLowerCase
().
indexOf
(
key
.
toLocaleLowerCase
())
==
-
1
if
(
isCaseInsensitive
)
{
// 不区分大小写
return
testString
.
toLocaleLowerCase
().
indexOf
(
key
.
toLocaleLowerCase
())
==
-
1
}
else
{
// 区分大小写
return
testString
.
indexOf
(
key
)
==
-
1
}
})
})
if
(
result
==
undefined
)
{
if
(
result
==
undefined
)
{
rightInGroup
=
true
;
rightInGroup
=
true
;
...
...
assets/DG_FAF/script/defaultData_DG_FAF.ts
View file @
fa0a16f7
This diff is collapsed.
Click to expand it.
form/main-es2015.js
View file @
fa0a16f7
This diff is collapsed.
Click to expand it.
form/main-es2015.js.map
View file @
fa0a16f7
This diff is collapsed.
Click to expand it.
form/main-es5.js
View file @
fa0a16f7
This diff is collapsed.
Click to expand it.
form/main-es5.js.map
View file @
fa0a16f7
This diff is collapsed.
Click to expand it.
form_angular/src/app/form/form.component.html
View file @
fa0a16f7
...
@@ -461,6 +461,7 @@
...
@@ -461,6 +461,7 @@
<span
style=
"display: inline-block; text-align: right; width: 150px;"
>
正确文字:
</span>
<span
style=
"display: inline-block; text-align: right; width: 150px;"
>
正确文字:
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
it
.
inputText
"
(
blur
)="
save
()"
style=
"display: inline-block; width: 300px;"
>
<input
type=
"text"
nz-input
[(
ngModel
)]="
it
.
inputText
"
(
blur
)="
save
()"
style=
"display: inline-block; width: 300px;"
>
<label
nz-checkbox
[(
ngModel
)]="
it
.
keyWordMatch
"
(
ngModelChange
)="
save
()"
style=
"margin-left: 10px;"
>
关键词匹配
</label>
<label
nz-checkbox
[(
ngModel
)]="
it
.
keyWordMatch
"
(
ngModelChange
)="
save
()"
style=
"margin-left: 10px;"
>
关键词匹配
</label>
<label
nz-checkbox
[(
ngModel
)]="
it
.
isCaseInsensitive
"
(
ngModelChange
)="
save
()"
style=
"margin-left: 10px;"
>
不区分大小写
</label>
<label
nz-checkbox
[(
ngModel
)]="
it
.
openAnswer
"
(
ngModelChange
)="
save
()"
style=
"margin-left: 10px;"
>
开放性答案
</label>
<label
nz-checkbox
[(
ngModel
)]="
it
.
openAnswer
"
(
ngModelChange
)="
save
()"
style=
"margin-left: 10px;"
>
开放性答案
</label>
</div>
</div>
...
...
form_angular/src/app/form/form.component.ts
View file @
fa0a16f7
...
@@ -108,6 +108,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
...
@@ -108,6 +108,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
rightOrWrongStyleType
:
"
symbol
"
,
rightOrWrongStyleType
:
"
symbol
"
,
inputText
:
""
,
inputText
:
""
,
keyWordMatch
:
false
,
keyWordMatch
:
false
,
isCaseInsensitive
:
true
,
openAnswer
:
false
,
openAnswer
:
false
,
useSelectOptionList
:
false
,
useSelectOptionList
:
false
,
selectOptionList
:
[
selectOptionList
:
[
...
...
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