Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM-07
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
JM-07
Commits
8c61146b
Commit
8c61146b
authored
Aug 10, 2021
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 评测问题
parent
768dca62
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
index.js
play/index.js
+19
-11
No files found.
play/index.js
View file @
8c61146b
...
@@ -874,19 +874,27 @@ function insertString(string, insert, index){
...
@@ -874,19 +874,27 @@ function insertString(string, insert, index){
}
}
function
annotation
(
text
,
detail
){
function
annotation
(
text
,
detail
){
let
annotationHtml
=
text
.
trim
()
;
let
annotationHtml
=
""
;
const
allFeatureAdvice
=
detail
.
AllFeatureAdvice
;
const
allFeatureAdvice
=
detail
.
AllFeatureAdvice
;
let
evaluateHtml
=
`
${
allFeatureAdvice
.
WordDiversity
}
;
${
allFeatureAdvice
.
Structure
}
;
${
allFeatureAdvice
.
Spelling
}
;
${
allFeatureAdvice
.
Grammar
}
<br>`
;
let
evaluateHtml
=
`
${
allFeatureAdvice
.
WordDiversity
}
;
${
allFeatureAdvice
.
Structure
}
;
${
allFeatureAdvice
.
Spelling
}
;
${
allFeatureAdvice
.
Grammar
}
<br>`
;
const
errorPosInfos
=
detail
.
essayFeedback
.
sentsFeedback
[
0
].
errorPosInfos
;
const
sentsFeedbacks
=
detail
.
essayFeedback
.
sentsFeedback
;
for
(
let
i
=
errorPosInfos
.
length
-
1
;
i
>=
0
;
i
--
){
for
(
let
i
=
0
;
i
<
sentsFeedbacks
.
length
;
i
++
)
{
const
feedBack
=
sentsFeedbacks
[
i
];
let
rawSent
=
feedBack
.
rawSent
;
const
errorPosInfos
=
feedBack
.
errorPosInfos
;
for
(
let
j
=
errorPosInfos
.
length
-
1
;
j
>=
0
;
j
--
){
const
errPos
=
errorPosInfos
[
i
];
const
errPos
=
errorPosInfos
[
i
];
const
startPos
=
errPos
.
startPos
;
const
startPos
=
errPos
.
startPos
;
annotationHtml
=
insertString
(
annotationHtml
,
`<span class="err-grammar-number">
${
i
+
1
}
</span>`
,
startPos
);
rawSent
=
insertString
(
rawSent
,
`<span class="err-grammar-number">
${
i
+
j
+
1
}
</span>`
,
startPos
);
}
}
for
(
let
i
=
0
;
i
<
errorPosInfos
.
length
;
i
++
){
annotationHtml
+=
rawSent
;
for
(
let
j
=
0
;
j
<
errorPosInfos
.
length
;
j
++
){
const
errPos
=
errorPosInfos
[
i
];
const
errPos
=
errorPosInfos
[
i
];
const
reason
=
errPos
.
reason
;
const
reason
=
errPos
.
reason
;
evaluateHtml
+=
`<br><span class="err-grammar-index">
${
i
+
1
}
</span>
${
reason
}
`
;
evaluateHtml
+=
`<br><span class="err-grammar-index">
${
i
+
j
+
1
}
</span>
${
reason
}
`
;
}
}
}
return
{
annotationHtml
,
evaluateHtml
};
return
{
annotationHtml
,
evaluateHtml
};
...
...
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