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
a6f01a66
Commit
a6f01a66
authored
Aug 10, 2021
by
Chen Jiping
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://vcs.ireadabc.com/template/JM-07
parents
ec57b03c
44307609
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
index.css
play/index.css
+1
-1
index.js
play/index.js
+21
-11
No files found.
play/index.css
View file @
a6f01a66
...
...
@@ -93,7 +93,7 @@ body {
top
:
0px
;
left
:
0px
;
z-index
:
100
;
background
:
#f
ff
;
background
:
#f
1e4c2
;
text-align
:
center
;
}
...
...
play/index.js
View file @
a6f01a66
...
...
@@ -874,19 +874,29 @@ function insertString(string, insert, index){
}
function
annotation
(
text
,
detail
){
let
annotationHtml
=
text
.
trim
()
;
let
annotationHtml
=
""
;
const
allFeatureAdvice
=
detail
.
AllFeatureAdvice
;
let
evaluateHtml
=
`
${
allFeatureAdvice
.
WordDiversity
}
;
${
allFeatureAdvice
.
Structure
}
;
${
allFeatureAdvice
.
Spelling
}
;
${
allFeatureAdvice
.
Grammar
}
<br>`
;
const
errorPosInfos
=
detail
.
essayFeedback
.
sentsFeedback
[
0
].
errorPosInfos
;
for
(
let
i
=
errorPosInfos
.
length
-
1
;
i
>=
0
;
i
--
){
const
errPos
=
errorPosInfos
[
i
];
const
startPos
=
errPos
.
startPos
;
annotationHtml
=
insertString
(
annotationHtml
,
`<span class="err-grammar-number">
${
i
+
1
}
</span>`
,
startPos
);
}
for
(
let
i
=
0
;
i
<
errorPosInfos
.
length
;
i
++
){
const
errPos
=
errorPosInfos
[
i
];
const
reason
=
errPos
.
reason
;
evaluateHtml
+=
`<br><span class="err-grammar-index">
${
i
+
1
}
</span>
${
reason
}
`
;
const
sentsFeedbacks
=
detail
.
essayFeedback
.
sentsFeedback
;
let
num
=
0
;
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
[
j
];
const
startPos
=
errPos
.
startPos
;
rawSent
=
insertString
(
rawSent
,
`<span class="err-grammar-number">
${
num
+
j
+
1
}
</span>`
,
startPos
);
}
annotationHtml
+=
rawSent
;
for
(
let
j
=
0
;
j
<
errorPosInfos
.
length
;
j
++
){
const
errPos
=
errorPosInfos
[
j
];
const
reason
=
errPos
.
reason
;
evaluateHtml
+=
`<br><span class="err-grammar-index">
${
num
+
j
+
1
}
</span>
${
reason
}
`
;
}
num
+=
errorPosInfos
.
length
;
}
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