Commit e4a650b7 authored by liujiangnan's avatar liujiangnan

fix: 角标问题

parent bc8ce1f9
...@@ -879,6 +879,7 @@ function annotation(text, detail){ ...@@ -879,6 +879,7 @@ function annotation(text, detail){
let evaluateHtml = `${allFeatureAdvice.WordDiversity};${allFeatureAdvice.Structure};${allFeatureAdvice.Spelling};${allFeatureAdvice.Grammar}<br>`; let evaluateHtml = `${allFeatureAdvice.WordDiversity};${allFeatureAdvice.Structure};${allFeatureAdvice.Spelling};${allFeatureAdvice.Grammar}<br>`;
const sentsFeedbacks = detail.essayFeedback.sentsFeedback; const sentsFeedbacks = detail.essayFeedback.sentsFeedback;
let num = 0;
for (let i = 0; i < sentsFeedbacks.length; i++) { for (let i = 0; i < sentsFeedbacks.length; i++) {
const feedBack = sentsFeedbacks[i]; const feedBack = sentsFeedbacks[i];
let rawSent = feedBack.rawSent; let rawSent = feedBack.rawSent;
...@@ -887,13 +888,16 @@ function annotation(text, detail){ ...@@ -887,13 +888,16 @@ function annotation(text, detail){
for(let j=errorPosInfos.length-1; j>=0; j--){ for(let j=errorPosInfos.length-1; j>=0; j--){
const errPos = errorPosInfos[j]; const errPos = errorPosInfos[j];
const startPos = errPos.startPos; const startPos = errPos.startPos;
rawSent = insertString(rawSent, `<span class="err-grammar-number">${i+j+1}</span>`, startPos); rawSent = insertString(rawSent, `<span class="err-grammar-number">${num+j+1}</span>`, startPos);
} }
annotationHtml += rawSent; annotationHtml += rawSent;
for(let j=0; j<errorPosInfos.length; j++){ for(let j=0; j<errorPosInfos.length; j++){
const errPos = errorPosInfos[j]; const errPos = errorPosInfos[j];
const reason = errPos.reason; const reason = errPos.reason;
evaluateHtml += `<br><span class="err-grammar-index">${i+j+1}</span>&nbsp;${reason}`; evaluateHtml += `<br><span class="err-grammar-index">${num+j+1}</span>&nbsp;${reason}`;
}
if(errorPosInfos.length>0){
num ++;
} }
} }
return {annotationHtml, evaluateHtml}; return {annotationHtml, evaluateHtml};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment