Commit 8c61146b authored by liujiangnan's avatar liujiangnan

fix: 评测问题

parent 768dca62
...@@ -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>&nbsp;${reason}`; evaluateHtml += `<br><span class="err-grammar-index">${i+j+1}</span>&nbsp;${reason}`;
}
} }
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