Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzksxt
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
常超
xzksxt
Commits
a7842ea0
Commit
a7842ea0
authored
Feb 23, 2024
by
宋珺琪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决多选验证问题
parent
f8fc024d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
src/components/student/answer.vue
+10
-3
No files found.
src/components/student/answer.vue
View file @
a7842ea0
...
...
@@ -517,10 +517,17 @@ export default {
})
}
else
if
(
this
.
optionValue
==
"多选题"
)
{
//正确答案
const
truwAnswer
=
this
.
reduceAnswer
.
rightAnswer
.
replace
(
/
\s
/g
,
""
)
const
arr
=
this
.
reduceAnswer
.
rightAnswer
.
split
(
", "
);
//选中的
const
result
=
this
.
checkList
.
map
(
number
=>
String
.
fromCharCode
(
64
+
parseInt
(
number
,
10
))).
join
(
","
);
if
(
result
==
truwAnswer
)
{
const
letterArray
=
this
.
checkList
.
map
(
number
=>
String
.
fromCharCode
(
64
+
parseInt
(
number
,
10
)).
toUpperCase
());
console
.
log
(
arr
)
console
.
log
(
letterArray
)
// 对两个数组进行排序,并将其转换为字符串
const
str1
=
arr
.
sort
().
join
(
""
);
const
str2
=
letterArray
.
sort
().
join
(
""
);
console
.
log
(
str1
)
console
.
log
(
str2
)
if
(
str1
===
str2
)
{
console
.
log
(
"回答正确"
)
finalScore
=
this
.
reduceAnswer
.
score
}
...
...
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