Commit a6f01a66 authored by Chen Jiping's avatar Chen Jiping

Merge branch 'master' of http://vcs.ireadabc.com/template/JM-07

parents ec57b03c 44307609
...@@ -93,7 +93,7 @@ body { ...@@ -93,7 +93,7 @@ body {
top: 0px; top: 0px;
left: 0px; left: 0px;
z-index: 100; z-index: 100;
background: #fff; background: #f1e4c2;
text-align: center; text-align: center;
} }
......
...@@ -874,19 +874,29 @@ function insertString(string, insert, index){ ...@@ -874,19 +874,29 @@ 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--){
const errPos = errorPosInfos[i]; let num = 0;
const startPos = errPos.startPos; for (let i = 0; i < sentsFeedbacks.length; i++) {
annotationHtml = insertString(annotationHtml, `<span class="err-grammar-number">${i+1}</span>`, startPos); const feedBack = sentsFeedbacks[i];
} let rawSent = feedBack.rawSent;
for(let i=0; i<errorPosInfos.length; i++){
const errPos = errorPosInfos[i]; const errorPosInfos = feedBack.errorPosInfos;
const reason = errPos.reason; for(let j=errorPosInfos.length-1; j>=0; j--){
evaluateHtml += `<br><span class="err-grammar-index">${i+1}</span>&nbsp;${reason}`; 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>&nbsp;${reason}`;
}
num += errorPosInfos.length;
} }
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