|
@@ -7,6 +7,7 @@ var json_view = function (option, success) {
|
|
|
|
|
|
function JsonView(option) {
|
|
|
this.markControl = option.markControl;
|
|
|
+ this.loading = false;
|
|
|
this.init();
|
|
|
this.markControl.on('step.board.show', this, function (event, context, eventObject) {
|
|
|
this.container.removeClass('span12');
|
|
@@ -39,13 +40,14 @@ function JsonView(option) {
|
|
|
JsonView.prototype.init = function () {
|
|
|
var self = this;
|
|
|
this.container = this.markControl.container.imageContent;
|
|
|
+ this.container.empty();
|
|
|
this.container.height(this.markControl.container.centerContent.height());
|
|
|
this.container.css('overflow', 'scroll');
|
|
|
this.container.addClass('rich-text');
|
|
|
+ this.container.loading = getDom(this.loading_dom, this.markControl).appendTo(this.container);
|
|
|
}
|
|
|
|
|
|
JsonView.prototype.render = function () {
|
|
|
- this.container.empty();
|
|
|
if (this.task != undefined && this.task.jsonData != undefined) {
|
|
|
var questionNumberArr = new Array();
|
|
|
for (var i in this.task.markStepList) {
|
|
@@ -62,7 +64,7 @@ JsonView.prototype.render = function () {
|
|
|
var questionTitle = '<span>题号:'+ question.mainNumber+'-'+question.subNumber +'<span><br/>';
|
|
|
$(questionTitle).appendTo($(this.container));
|
|
|
$("<span>题干:<span>"+renderRichText(question.body)).appendTo($(this.container));
|
|
|
- $("<span>考生答案:<span>"+renderRichText(question.studentAnswer)).appendTo(this.container);
|
|
|
+ $("<span>考生答案:<span>"+renderRichText(question.studentAnswer,true)).appendTo(this.container);
|
|
|
$("<span>标准答案:<span>"+renderRichText(question.answer)).appendTo(this.container);
|
|
|
});
|
|
|
var viewer = new Viewer($('.image-content')[0], {
|
|
@@ -70,6 +72,17 @@ JsonView.prototype.render = function () {
|
|
|
viewer.destroy();
|
|
|
viewer = new Viewer($('.image-content')[0], {
|
|
|
});
|
|
|
+ this.loading = false;
|
|
|
+ this.updateLoading();
|
|
|
this.markControl.trigger('task.load.finish');
|
|
|
}
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+JsonView.prototype.updateLoading = function() {
|
|
|
+ if (this.loading) {
|
|
|
+ this.container.find('#json-loading').show();
|
|
|
+ } else {
|
|
|
+ this.container.find('#json-loading').hide();
|
|
|
+ }
|
|
|
+}
|
|
|
+JsonView.prototype.loading_dom = '<div id="json-loading"><img src="{staticServer}/mark-new/images/loding.gif"/><p>正在加载请稍候</p></div>';
|