|
@@ -1,5 +1,5 @@
|
|
//回评模块
|
|
//回评模块
|
|
-var mark_history = function(option, success) {
|
|
|
|
|
|
+var mark_history = function (option, success) {
|
|
var object = new MarkHistory(option);
|
|
var object = new MarkHistory(option);
|
|
success();
|
|
success();
|
|
return object;
|
|
return object;
|
|
@@ -18,11 +18,11 @@ function MarkHistory(option) {
|
|
|
|
|
|
this.markControl.initMarkFunction();
|
|
this.markControl.initMarkFunction();
|
|
this.container.toggleButton = getDom(this.toggle_button_dom, this.markControl).appendTo(this.markControl.container.assistant.functionList);
|
|
this.container.toggleButton = getDom(this.toggle_button_dom, this.markControl).appendTo(this.markControl.container.assistant.functionList);
|
|
- this.container.toggleButton.click(this, function(event) {
|
|
|
|
|
|
+ this.container.toggleButton.click(this, function (event) {
|
|
event.data.toggle(true);
|
|
event.data.toggle(true);
|
|
});
|
|
});
|
|
|
|
|
|
- this.markControl.on('history.get.success', this, function(event, context, data) {
|
|
|
|
|
|
+ this.markControl.on('history.get.success', this, function (event, context, data) {
|
|
var taskList = data.result;
|
|
var taskList = data.result;
|
|
this.taskList = [];
|
|
this.taskList = [];
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -33,7 +33,7 @@ function MarkHistory(option) {
|
|
var task = taskList[i];
|
|
var task = taskList[i];
|
|
task.totalScore = parseNumber(task.totalScore);
|
|
task.totalScore = parseNumber(task.totalScore);
|
|
var row = getDom(this.history_row_dom, this.markControl).appendTo(this.container.list);
|
|
var row = getDom(this.history_row_dom, this.markControl).appendTo(this.container.list);
|
|
- row.find('.history-secret-number').html(task.studentId);
|
|
|
|
|
|
+ row.find('.history-secret-number').html(task.studentNumber);
|
|
if (task.tags != undefined && task.tags != null) {
|
|
if (task.tags != undefined && task.tags != null) {
|
|
row.find('.history-secret-number').addClass('tips');
|
|
row.find('.history-secret-number').addClass('tips');
|
|
}
|
|
}
|
|
@@ -58,7 +58,7 @@ function MarkHistory(option) {
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.container.list.find('td').click(this, function(event) {
|
|
|
|
|
|
+ this.container.list.find('td').click(this, function (event) {
|
|
var markHistory = event.data;
|
|
var markHistory = event.data;
|
|
var index = $(event.target).parent().attr('data-index');
|
|
var index = $(event.target).parent().attr('data-index');
|
|
markHistory.onTaskSelect(index);
|
|
markHistory.onTaskSelect(index);
|
|
@@ -71,31 +71,31 @@ function MarkHistory(option) {
|
|
this.onTaskSelect(0);
|
|
this.onTaskSelect(0);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- this.markControl.on('history.get.error', this, function(event, context, data) {
|
|
|
|
|
|
+ this.markControl.on('history.get.error', this, function (event, context, data) {
|
|
alert(getMessage("mark.history.error"));
|
|
alert(getMessage("mark.history.error"));
|
|
});
|
|
});
|
|
- this.markControl.on('task.submit.success', this, function(event, context, data) {
|
|
|
|
|
|
+ this.markControl.on('task.submit.success', this, function (event, context, data) {
|
|
if (this.enable) {
|
|
if (this.enable) {
|
|
this.toggle(false);
|
|
this.toggle(false);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- this.markControl.on('task.get.success', this, function(event, context, data) {
|
|
|
|
|
|
+ this.markControl.on('task.get.success', this, function (event, context, data) {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
});
|
|
});
|
|
- this.markControl.on('history.submit.success', this, function(event, context, task) {
|
|
|
|
|
|
+ this.markControl.on('history.submit.success', this, function (event, context, task) {
|
|
if (task.previous == true) {
|
|
if (task.previous == true) {
|
|
this.updateTaskScore(task.totalScore);
|
|
this.updateTaskScore(task.totalScore);
|
|
}
|
|
}
|
|
- if(task.problem == true){
|
|
|
|
- var self = this;
|
|
|
|
- self.toggle(false);
|
|
|
|
- self.markControl.context.task = undefined;
|
|
|
|
|
|
+ if (task.problem == true) {
|
|
|
|
+ var self = this;
|
|
|
|
+ self.toggle(false);
|
|
|
|
+ self.markControl.context.task = undefined;
|
|
self.markControl.getTask();
|
|
self.markControl.getTask();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-MarkHistory.prototype.init = function() {
|
|
|
|
|
|
+MarkHistory.prototype.init = function () {
|
|
this.container.empty();
|
|
this.container.empty();
|
|
|
|
|
|
this.container.paginator = getDom(this.paginator_dom, this.markControl).appendTo(this.container);
|
|
this.container.paginator = getDom(this.paginator_dom, this.markControl).appendTo(this.container);
|
|
@@ -104,12 +104,12 @@ MarkHistory.prototype.init = function() {
|
|
this.container.list = getDom(this.history_list_dom, this.markControl).appendTo(this.container).find('#history-list');
|
|
this.container.list = getDom(this.history_list_dom, this.markControl).appendTo(this.container).find('#history-list');
|
|
|
|
|
|
var self = this;
|
|
var self = this;
|
|
- this.container.header.find('#close-history-button').click(this, function(event) {
|
|
|
|
|
|
+ this.container.header.find('#close-history-button').click(this, function (event) {
|
|
event.data.toggle(false);
|
|
event.data.toggle(false);
|
|
self.markControl.context.task = undefined;
|
|
self.markControl.context.task = undefined;
|
|
self.markControl.getTask();
|
|
self.markControl.getTask();
|
|
})
|
|
})
|
|
- this.container.paginator.find('#last-page-button').click(this, function(event) {
|
|
|
|
|
|
+ this.container.paginator.find('#last-page-button').click(this, function (event) {
|
|
var markHistory = event.data;
|
|
var markHistory = event.data;
|
|
if (markHistory.taskList.length < markHistory.pageSize) {
|
|
if (markHistory.taskList.length < markHistory.pageSize) {
|
|
return;
|
|
return;
|
|
@@ -121,7 +121,7 @@ MarkHistory.prototype.init = function() {
|
|
}
|
|
}
|
|
markHistory.onSearch(markHistory.pageNumber + 1, markHistory.order, markHistory.sort, markHistory.isTag);
|
|
markHistory.onSearch(markHistory.pageNumber + 1, markHistory.order, markHistory.sort, markHistory.isTag);
|
|
});
|
|
});
|
|
- this.container.paginator.find('#next-page-button').click(this, function(event) {
|
|
|
|
|
|
+ this.container.paginator.find('#next-page-button').click(this, function (event) {
|
|
var markHistory = event.data;
|
|
var markHistory = event.data;
|
|
if (markHistory.pageNumber == 1) {
|
|
if (markHistory.pageNumber == 1) {
|
|
return;
|
|
return;
|
|
@@ -135,11 +135,11 @@ MarkHistory.prototype.init = function() {
|
|
markHistory.onSearch(markHistory.pageNumber - 1, markHistory.order, markHistory.sort, markHistory.isTag);
|
|
markHistory.onSearch(markHistory.pageNumber - 1, markHistory.order, markHistory.sort, markHistory.isTag);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- this.container.find('#studentId-search').click(this, function(event) {
|
|
|
|
|
|
+ this.container.find('#number-search').click(this, function (event) {
|
|
var markHistory = event.data;
|
|
var markHistory = event.data;
|
|
- var studentId = self.container.find('#studentId-in').val();
|
|
|
|
|
|
+ var number = self.container.find('#number-in').val();
|
|
var re = /^[1-9]+[0-9]*]*$/;
|
|
var re = /^[1-9]+[0-9]*]*$/;
|
|
- if (!re.test(studentId)) {
|
|
|
|
|
|
+ if (!re.test(number)) {
|
|
alert(getMessage("mark.history.number.error"));
|
|
alert(getMessage("mark.history.number.error"));
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -148,26 +148,26 @@ MarkHistory.prototype.init = function() {
|
|
} else {
|
|
} else {
|
|
markHistory.isTag = false;
|
|
markHistory.isTag = false;
|
|
}
|
|
}
|
|
- markHistory.onSearch(0, markHistory.order, markHistory.sort, markHistory.isTag, studentId);
|
|
|
|
|
|
+ markHistory.onSearch(0, markHistory.order, markHistory.sort, markHistory.isTag, number);
|
|
});
|
|
});
|
|
- this.container.find('#time-sort-th').click(this, function(event) {
|
|
|
|
|
|
+ this.container.find('#time-sort-th').click(this, function (event) {
|
|
self.orderSearch("time");
|
|
self.orderSearch("time");
|
|
});
|
|
});
|
|
- this.container.find('#studentId-sort-th').click(this, function(event) {
|
|
|
|
- self.orderSearch("studentId");
|
|
|
|
|
|
+ this.container.find('#number-sort-th').click(this, function (event) {
|
|
|
|
+ self.orderSearch("number");
|
|
});
|
|
});
|
|
- this.container.find('#score-sort-th').click(this, function(event) {
|
|
|
|
|
|
+ this.container.find('#score-sort-th').click(this, function (event) {
|
|
self.orderSearch("score");
|
|
self.orderSearch("score");
|
|
});
|
|
});
|
|
|
|
|
|
self.updateSort(self.order, self.sort);
|
|
self.updateSort(self.order, self.sort);
|
|
self.updateLoading();
|
|
self.updateLoading();
|
|
|
|
|
|
- this.container.find('#studentId-in').click(this, function(event) {
|
|
|
|
|
|
+ this.container.find('#number-in').click(this, function (event) {
|
|
self.markControl.trigger('mark.focus.change');
|
|
self.markControl.trigger('mark.focus.change');
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-MarkHistory.prototype.orderSearch = function(order) {
|
|
|
|
|
|
+MarkHistory.prototype.orderSearch = function (order) {
|
|
this.order = order;
|
|
this.order = order;
|
|
if (this.sort == "asc") {
|
|
if (this.sort == "asc") {
|
|
this.sort = "desc";
|
|
this.sort = "desc";
|
|
@@ -182,7 +182,7 @@ MarkHistory.prototype.orderSearch = function(order) {
|
|
this.onSearch(this.pageNumber, this.order, this.sort, this.isTag);
|
|
this.onSearch(this.pageNumber, this.order, this.sort, this.isTag);
|
|
}
|
|
}
|
|
|
|
|
|
-MarkHistory.prototype.toggle = function(enable) {
|
|
|
|
|
|
+MarkHistory.prototype.toggle = function (enable) {
|
|
this.enable = enable;
|
|
this.enable = enable;
|
|
if (enable) {
|
|
if (enable) {
|
|
this.init();
|
|
this.init();
|
|
@@ -201,7 +201,7 @@ MarkHistory.prototype.toggle = function(enable) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-MarkHistory.prototype.updatePage = function() {
|
|
|
|
|
|
+MarkHistory.prototype.updatePage = function () {
|
|
this.container.paginator.find('#history-start').html(this.pageSize * (this.pageNumber - 1));
|
|
this.container.paginator.find('#history-start').html(this.pageSize * (this.pageNumber - 1));
|
|
this.container.paginator.find('#history-end').html(this.pageSize * this.pageNumber);
|
|
this.container.paginator.find('#history-end').html(this.pageSize * this.pageNumber);
|
|
|
|
|
|
@@ -217,7 +217,7 @@ MarkHistory.prototype.updatePage = function() {
|
|
// }
|
|
// }
|
|
|
|
|
|
}
|
|
}
|
|
-MarkHistory.prototype.updateLoading = function() {
|
|
|
|
|
|
+MarkHistory.prototype.updateLoading = function () {
|
|
if (this.loading) {
|
|
if (this.loading) {
|
|
this.container.find('#history-loading').show();
|
|
this.container.find('#history-loading').show();
|
|
} else {
|
|
} else {
|
|
@@ -225,9 +225,9 @@ MarkHistory.prototype.updateLoading = function() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-MarkHistory.prototype.updateSort = function(order, sort) {
|
|
|
|
|
|
+MarkHistory.prototype.updateSort = function (order, sort) {
|
|
this.container.find('#time-sort').removeClass();
|
|
this.container.find('#time-sort').removeClass();
|
|
- this.container.find('#studentId-sort').removeClass();
|
|
|
|
|
|
+ this.container.find('#number-sort').removeClass();
|
|
this.container.find('#score-sort').removeClass();
|
|
this.container.find('#score-sort').removeClass();
|
|
if (sort == 'desc') {
|
|
if (sort == 'desc') {
|
|
this.container.find('#' + order + '-sort').addClass("down");
|
|
this.container.find('#' + order + '-sort').addClass("down");
|
|
@@ -238,7 +238,7 @@ MarkHistory.prototype.updateSort = function(order, sort) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-MarkHistory.prototype.onSearch = function(pageNumber, order, sort, isTag, studentId) {
|
|
|
|
|
|
+MarkHistory.prototype.onSearch = function (pageNumber, order, sort, isTag, number) {
|
|
if (pageNumber == undefined || pageNumber < 1) {
|
|
if (pageNumber == undefined || pageNumber < 1) {
|
|
pageNumber = 1;
|
|
pageNumber = 1;
|
|
}
|
|
}
|
|
@@ -251,8 +251,8 @@ MarkHistory.prototype.onSearch = function(pageNumber, order, sort, isTag, studen
|
|
if (isTag == undefined) {
|
|
if (isTag == undefined) {
|
|
isTag = false;
|
|
isTag = false;
|
|
}
|
|
}
|
|
- if (studentId == undefined || studentId == "") {
|
|
|
|
- studentId = null;
|
|
|
|
|
|
+ if (number == undefined || number == "") {
|
|
|
|
+ number = null;
|
|
}
|
|
}
|
|
this.markControl.getHistory({
|
|
this.markControl.getHistory({
|
|
pageNumber: pageNumber,
|
|
pageNumber: pageNumber,
|
|
@@ -260,14 +260,14 @@ MarkHistory.prototype.onSearch = function(pageNumber, order, sort, isTag, studen
|
|
order: order,
|
|
order: order,
|
|
sort: sort,
|
|
sort: sort,
|
|
isTag: isTag,
|
|
isTag: isTag,
|
|
- studentId: studentId
|
|
|
|
|
|
+ secretNumber: number
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-MarkHistory.prototype.onTaskSelect = function(index) {
|
|
|
|
|
|
+MarkHistory.prototype.onTaskSelect = function (index) {
|
|
var number = new String(index);
|
|
var number = new String(index);
|
|
if (this.taskList != undefined && index < this.taskList.length && this.loading != true) {
|
|
if (this.taskList != undefined && index < this.taskList.length && this.loading != true) {
|
|
- this.container.list.find('tr').each(function(index, obj) {
|
|
|
|
|
|
+ this.container.list.find('tr').each(function (index, obj) {
|
|
if ($(obj).attr('data-index') == number) {
|
|
if ($(obj).attr('data-index') == number) {
|
|
$(obj).addClass('active');
|
|
$(obj).addClass('active');
|
|
} else {
|
|
} else {
|
|
@@ -281,8 +281,8 @@ MarkHistory.prototype.onTaskSelect = function(index) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-MarkHistory.prototype.updateTaskScore = function(score) {
|
|
|
|
- this.container.list.find('tr').each(function(index, obj) {
|
|
|
|
|
|
+MarkHistory.prototype.updateTaskScore = function (score) {
|
|
|
|
+ this.container.list.find('tr').each(function (index, obj) {
|
|
if ($(obj).hasClass("active")) {
|
|
if ($(obj).hasClass("active")) {
|
|
$(obj).find('td').last().html(score);
|
|
$(obj).find('td').last().html(score);
|
|
}
|
|
}
|
|
@@ -304,12 +304,12 @@ MarkHistory.prototype.paginator_dom = '<div class="c-page">\
|
|
|
|
|
|
MarkHistory.prototype.history_search_dom = '<div class="c-scbar cl">\
|
|
MarkHistory.prototype.history_search_dom = '<div class="c-scbar cl">\
|
|
<table id="history-search" cellpadding="0" cellspacing="0" width="100%">\
|
|
<table id="history-search" cellpadding="0" cellspacing="0" width="100%">\
|
|
-<tr><td class="sc"><span><input type="text" placeholder="查找试卷" id="studentId-in" maxlength="10" data-i18n-placeholder="mark.history.search"/><em id="studentId-search"></em></span></td>\
|
|
|
|
|
|
+<tr><td class="sc"><span><input type="text" placeholder="查找试卷" id="number-in" maxlength="10" data-i18n-placeholder="mark.history.search"/><em id="number-search"></em></span></td>\
|
|
</tr></table></div>';
|
|
</tr></table></div>';
|
|
|
|
|
|
MarkHistory.prototype.history_list_dom = '<div class="sublist"><div class="c-table">\
|
|
MarkHistory.prototype.history_list_dom = '<div class="sublist"><div class="c-table">\
|
|
<table class="table table-hover" cellpadding="0" cellspacing="0" width="100%"><thead><tr>\
|
|
<table class="table table-hover" cellpadding="0" cellspacing="0" width="100%"><thead><tr>\
|
|
-<th id="studentId-sort-th"><span data-i18n-text="mark.history.number">编号</span><em class="up" id="studentId-sort"></th>\
|
|
|
|
|
|
+<th id="number-sort-th"><span data-i18n-text="mark.history.number">编号</span><em class="up" id="number-sort"></th>\
|
|
<th id="time-sort-th"><span data-i18n-text="mark.history.time">时间</span><em class="up" id="time-sort"></em></th>\
|
|
<th id="time-sort-th"><span data-i18n-text="mark.history.time">时间</span><em class="up" id="time-sort"></em></th>\
|
|
<th id="score-sort-th"><span data-i18n-text="mark.history.score">总分</span><em class="up" id="score-sort"></th></tr></thead>\
|
|
<th id="score-sort-th"><span data-i18n-text="mark.history.score">总分</span><em class="up" id="score-sort"></th></tr></thead>\
|
|
<tbody class="loding" id="history-loading"><tr><td colspan="3"><div><img src="{staticServer}/mark-new/images/loding.gif"/></div><p data-i18n-text="mark.history.loading">正在加载请稍候</p></td></tr></tbody>\
|
|
<tbody class="loding" id="history-loading"><tr><td colspan="3"><div><img src="{staticServer}/mark-new/images/loding.gif"/></div><p data-i18n-text="mark.history.loading">正在加载请稍候</p></td></tr></tbody>\
|