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 {
top: 0px;
left: 0px;
z-index: 100;
background: #fff;
background: #f1e4c2;
text-align: center;
}
......
......@@ -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>&nbsp;${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>&nbsp;${reason}`;
}
num += errorPosInfos.length;
}
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