|
@@ -44,7 +44,7 @@ JsonView.prototype.render = function () {
|
|
|
this.task.markStepList.forEach(step => {
|
|
|
let question = this.findQuestion(step.mainNumber, step.subNumber, this.task.paperData)
|
|
|
let jsons = this.findJson(step.mainNumber, step.subNumber, this.task.jsonData)
|
|
|
- if (question != undefined && jsons.length > 0) {
|
|
|
+ if (question != undefined ) {
|
|
|
let numberTitle = {
|
|
|
"blocks": [{
|
|
|
"type": "text",
|
|
@@ -59,6 +59,7 @@ JsonView.prototype.render = function () {
|
|
|
"value": "题干:"
|
|
|
}]
|
|
|
};
|
|
|
+ var textcount = jsons.length > 0? this.textCount(jsons) : 0
|
|
|
let answerTitle = {
|
|
|
"blocks": [{
|
|
|
"type": "text",
|
|
@@ -70,7 +71,7 @@ JsonView.prototype.render = function () {
|
|
|
"italic": true,
|
|
|
"danger": true
|
|
|
},
|
|
|
- "value": "(字数统计:" + this.textCount(jsons) + ")"
|
|
|
+ "value": "(字数统计:" + textcount + ")"
|
|
|
}]
|
|
|
};
|
|
|
let standardTitle = {
|
|
@@ -87,11 +88,13 @@ JsonView.prototype.render = function () {
|
|
|
}
|
|
|
$(renderRichText(question.body)).appendTo(this.holder);
|
|
|
$(renderSection(answerTitle)).appendTo(this.holder);
|
|
|
- jsons.forEach(node => {
|
|
|
- node.answer.forEach(node => {
|
|
|
- $(renderRichText(node)).appendTo(this.holder);
|
|
|
- });
|
|
|
- })
|
|
|
+ if(jsons.length > 0){
|
|
|
+ jsons.forEach(node => {
|
|
|
+ node.answer.forEach(node => {
|
|
|
+ $(renderRichText(node)).appendTo(this.holder);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
$(renderSection(standardTitle)).appendTo(this.holder);
|
|
|
let nodes =renderRichText(question.answer);
|
|
|
nodes.forEach(node => {
|