|
|
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/questionLogSummary/"}){ -->
|
|
|
<div class="layui-row" style="float: right">
|
|
|
<layui:accessButton function="teacherOpenCourseStudentSigninSetting.query" class="layui-btn-primary"
|
|
|
action="addButton_cancel"><span class="iconfont"></span>返回
|
|
|
</layui:accessButton>
|
|
|
</div>
|
|
|
|
|
|
<div class="layui-row">
|
|
|
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
|
|
<ul class="layui-tab-title">
|
|
|
<li class="layui-this">题库作业</li>
|
|
|
<li>附件作业</li>
|
|
|
</ul>
|
|
|
<div class="layui-tab-content">
|
|
|
<div class="layui-tab-item layui-show">
|
|
|
<div class="layui-row" id="view">
|
|
|
<h2 style="float: left">作业汇总:【
|
|
|
合计平均得分:<span id="avgStudentScore"></span>
|
|
|
合计及格率:<span id="avgQuestionLogSummaryIsPass"></span>;
|
|
|
】
|
|
|
</h2>
|
|
|
<div class="layui-inline" style="float: right">
|
|
|
<layui:accessButton function="teacherOpenCourseStudentSigninSetting.query"
|
|
|
action="exportDocument"><span
|
|
|
class="iconfont"></span>导出
|
|
|
</layui:accessButton>
|
|
|
</div>
|
|
|
</div>
|
|
|
<table id="questionLogSummaryTable" lay-filter="questionLogSummaryTable"></table>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<input type="hidden" name="teacherOpenCourseId" autocomplete="off" class="layui-input"
|
|
|
value="${teacherOpenCourseId}"/>
|
|
|
<!--#} -->
|
|
|
|
|
|
<script>
|
|
|
|
|
|
layui.use(['form', 'laydate', 'table', 'laytpl', 'element'], function () {
|
|
|
var form = layui.form;
|
|
|
var laydate = layui.laydate;
|
|
|
var table = layui.table;
|
|
|
var laytpl = layui.laytpl;
|
|
|
var element = layui.element;
|
|
|
///jlw/teacherOpenCourseQuestionSetting/analysis.json
|
|
|
|
|
|
var questionLogSummaryTable = null;
|
|
|
var teacherOpenCourseId = $("input[name='teacherOpenCourseId']").val();
|
|
|
var questionSettingType = 'HOMEWORK_QUESTION';
|
|
|
|
|
|
element.on('tab(docDemoTabBrief)', function(data){
|
|
|
if(data.index == 0){
|
|
|
questionSettingType = 'HOMEWORK_QUESTION';
|
|
|
}else {
|
|
|
questionSettingType = 'HOMEWORK_FILE';
|
|
|
}
|
|
|
|
|
|
var param = {'teacherOpenCourseId': teacherOpenCourseId, 'questionSettingType': questionSettingType};
|
|
|
|
|
|
/*questionLogSummaryTable.reload({
|
|
|
where: param,
|
|
|
page: {
|
|
|
curr: 1
|
|
|
}
|
|
|
});*/
|
|
|
view.initTable();
|
|
|
getCount(questionSettingType);
|
|
|
});
|
|
|
|
|
|
getCount(questionSettingType);
|
|
|
|
|
|
function getCount(questionSettingType) {
|
|
|
var url = '/jlw/teacherOpenCourseQuestionSetting/analysis.json',
|
|
|
param = {
|
|
|
teacherOpenCourseId: teacherOpenCourseId,
|
|
|
questionSettingType: questionSettingType
|
|
|
};
|
|
|
var ret = Common.postAjax(url, param);
|
|
|
if (ret.code == 0) {
|
|
|
var data = ret.data;
|
|
|
if($.isEmpty(data)){
|
|
|
data = {
|
|
|
avgStudentScore:'',
|
|
|
avgQuestionLogSummaryIsPass:''
|
|
|
}
|
|
|
}
|
|
|
$("#avgStudentScore").html(data.avgStudentScore);
|
|
|
$("#avgQuestionLogSummaryIsPass").html(data.avgQuestionLogSummaryIsPass);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var view = {
|
|
|
init: function () {
|
|
|
var that = this;
|
|
|
this.initTable();
|
|
|
this.initSearchForm();
|
|
|
this.initToolBar();
|
|
|
window.dataReload = function () {
|
|
|
Lib.doSearchForm($("#searchForm"), questionLogSummaryTable);
|
|
|
that.initToolBar();
|
|
|
}
|
|
|
},
|
|
|
initTable: function () {
|
|
|
questionLogSummaryTable = table.render({
|
|
|
elem: '#questionLogSummaryTable',
|
|
|
height: Lib.getTableHeight(1),
|
|
|
cellMinWidth: 100,
|
|
|
method: 'post',
|
|
|
url: Common.ctxPath + '/jlw/questionLogSummary/homeworkFileAnalysis.json' // 数据接口
|
|
|
, where: {'teacherOpenCourseId': teacherOpenCourseId, 'questionSettingType': questionSettingType}
|
|
|
, page: Lib.tablePage // 开启分页
|
|
|
, limit: 10,
|
|
|
cols: [[ // 表头
|
|
|
{type: "numbers", title: "序号"},
|
|
|
{
|
|
|
field: 'questionSettingName',
|
|
|
title: questionSettingType == "HOMEWORK_QUESTION" ? '题库作业名称' : '附件作业名称',
|
|
|
align: "center",
|
|
|
hideField: false,
|
|
|
},
|
|
|
{
|
|
|
field: 'avgStudentScore',
|
|
|
title: '平均得分',
|
|
|
align: "center",
|
|
|
hideField: false
|
|
|
},
|
|
|
{
|
|
|
field: 'avgQuestionLogSummaryIsPass',
|
|
|
title: '及格率',
|
|
|
align: "center",
|
|
|
hideField: false
|
|
|
},
|
|
|
{
|
|
|
title: '作业时间',
|
|
|
align: "center",
|
|
|
templet: function (d) {
|
|
|
return d.startTime + '~' + d.endTime
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
field: 'operation_', title: '操作', align: "center", templet: function (d) {
|
|
|
var htm = '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="details">详情</button>';
|
|
|
/*htm += '<button type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</button>';*/
|
|
|
return htm;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
]]
|
|
|
|
|
|
});
|
|
|
|
|
|
table.on('checkbox(questionLogSummaryTable)', function (obj) {
|
|
|
var questionLogSummary = obj.data;
|
|
|
if (obj.checked) {
|
|
|
//按钮逻辑Lib.buttonEnable()
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
initSearchForm: function () {
|
|
|
Lib.initSearchForm($("#searchForm"), questionLogSummaryTable, form);
|
|
|
},
|
|
|
|
|
|
initToolBar: function () {
|
|
|
toolbar = {
|
|
|
add: function () {
|
|
|
var url = "/jlw/questionLogSummary/add.do";
|
|
|
Common.openDlg(url, "通用题目日志汇总管理>新增");
|
|
|
},
|
|
|
edit: function () {
|
|
|
var data = Common.getOneFromTable(table, "questionLogSummaryTable");
|
|
|
if (data == null) {
|
|
|
return;
|
|
|
}
|
|
|
var url = "/jlw/questionLogSummary/add.do?questionLogSummaryId=" + data.questionLogSummaryId;
|
|
|
Common.openDlg(url, "通用题目日志汇总管理>" + data.questionLogSummaryId + ">编辑");
|
|
|
},
|
|
|
del: function () {
|
|
|
layui.use(['del'], function () {
|
|
|
var delView = layui.del
|
|
|
delView.delBatch();
|
|
|
});
|
|
|
},
|
|
|
search: function () {
|
|
|
Lib.doSearchForm($("#searchForm"), questionLogSummaryTable, 1);
|
|
|
view.initToolBar()
|
|
|
},
|
|
|
refresh: function () {
|
|
|
searchForm.reset();
|
|
|
Lib.doSearchForm($("#searchForm"), questionLogSummaryTable, 1);
|
|
|
view.initToolBar()
|
|
|
},
|
|
|
addButton_cancel: function () {
|
|
|
parent.Lib.tableRefresh();
|
|
|
Lib.closeFrame();
|
|
|
},
|
|
|
exportDocument: function () {
|
|
|
layer.confirm('是否确定导出'+(questionSettingType == "HOMEWORK_QUESTION" ? '题库作业表' : '附件作业表')+'吗?', function (index) {
|
|
|
var url = Common.ctxPath + "/jlw/questionLogSummary/exportAnalysis.json?teacherOpenCourseId=" + teacherOpenCourseId + '&questionSettingType=' + questionSettingType;
|
|
|
$.downFile(url);
|
|
|
layer.close(index);
|
|
|
});
|
|
|
},
|
|
|
importDocument: function () {
|
|
|
var uploadUrl = Common.ctxPath + "/jlw/questionLogSummary/importTemplate.json";
|
|
|
//模板,
|
|
|
var templatePath = Common.ctxPath + "/jlw/questionLogSummary/downloadTemplate.json";
|
|
|
//公共的简单上传文件处理
|
|
|
var url = "/core/file/simpleUpload.do?uploadUrl=" + uploadUrl + "&templatePath=" + templatePath;
|
|
|
Common.openDlg(url, "通用题目日志汇总管理>上传");
|
|
|
}
|
|
|
}
|
|
|
//触发事件
|
|
|
$('.ext-toolbar').on('click', function () {
|
|
|
var type = $(this).data('type');
|
|
|
toolbar[type] ? toolbar[type].call(this) : '';
|
|
|
});
|
|
|
|
|
|
}, initTableTool: table.on('tool(questionLogSummaryTable)', function (obj) {
|
|
|
var data = obj.data;
|
|
|
if (obj.event === 'edit') {
|
|
|
var url = "/jlw/questionLogSummary/add.do?questionLogSummaryId=" + data.questionLogSummaryId;
|
|
|
Common.openDlg(url, "通用题目日志汇总管理>" + data.questionLogSummaryId + ">编辑");
|
|
|
} else if (obj.event === "del") {
|
|
|
layer.confirm('是否确定删除该信息?', function (index) {
|
|
|
var ret = Common.postAjax("/jlw/questionLogSummary/delete.json", {ids: data.questionLogSummaryId});
|
|
|
layer.msg(ret.code == 0 ? "删除成功!" : ret.msg, {
|
|
|
offset: ['50%'],
|
|
|
icon: ret.code == 0 ? 1 : 2,
|
|
|
time: 1500 //2秒关闭(如果不配置,默认是3秒)
|
|
|
}, function () {
|
|
|
if (ret.code == 0) {
|
|
|
Lib.tableRefresh();
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
} else if (obj.event === 'details') {
|
|
|
var url = "/jlw/questionLogSummary/indexInfo.do?teacherOpenCourseId=" + teacherOpenCourseId + "&questionSettingType=" + questionSettingType;
|
|
|
Common.openDlg(url, "详情");
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
view.init();
|
|
|
});
|
|
|
|
|
|
</script>
|