You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

455 lines
21 KiB
HTML

<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/questionLogSummary/"}){ -->
<div class="layui-row layui-col-space15 layui-form">
<div class="layui-col-md3">
<div class="layui-panel">
<div style="padding: 15px;">
<div class="layui-form" id="studentForm">
<div class="layui-inline">
<label class="layui-form-label">选择班级:</label>
<layui:simpleDictSelect style='layui-input-block' type="school_class.class_name.class_status=1"
id="classId" name="classId"/>
</div>
<div class="layui-inline" style="padding-top: 10px">
<input type="text" id="studentOrName" placeholder="请输入学号或姓名" name="studentOrName"
class="layui-input">
</div>
<div class="layui-inline" style="padding-top: 10px">
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="studentFormSearch"><i
class="layui-icon layui-icon-search"></i>搜索
</button>
</div>
</div>
<table id="studentTable" lay-filter="studentTable"></table>
</div>
</div>
</div>
<div class="layui-col-md9">
<div class="layui-inline">
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
2 years ago
<div class="layui-inline">
<!--#if(questionSettingType=='CHAPTER_EXERCISE'){-->
<label class="layui-form-label">章节名称</label>
<!--#}else if(questionSettingType=='EXAM'){-->
<label class="layui-form-label">考试名称</label>
2 years ago
<!--#}else if(questionSettingType=='HOMEWORK_FILE'){-->
2 years ago
<label class="layui-form-label" style="width: 85px">附件作业名称</label>
<!--#}else if(questionSettingType=='HOMEWORK_QUESTION'){-->
<label class="layui-form-label" style="width: 85px">题库作业名称</label>
<!--#}-->
<div class="layui-input-inline" id="view"></div>
</div>
</layui:searchForm>
</div>
<div class="layui-inline layui-form-item" style="margin-top:-5px;">
2 years ago
<layui:accessButton function="teacherOpenCourseQuestionLog.query" action="exportDocument"><span
class="iconfont">&#xe8c7;</span>导出</layui:accessButton>
</div>
<div class="layui-inline" style="float: right">
2 years ago
<layui:accessButton function="teacherOpenCourseQuestionLog.query" class="layui-btn-primary"
action="addButton_cancel"><span class="iconfont">&#xe600;</span>返回</layui:accessButton>
</div>
2 years ago
<table id="teacherOpenCourseQuestionLogTable"
lay-filter="teacherOpenCourseQuestionLogTable"></table>
</div>
</div>
<input type="hidden" name="teacherOpenCourseId" autocomplete="off" class="layui-input" value="${teacherOpenCourseId}"/>
2 years ago
<input type="hidden" name="questionSettingType" autocomplete="off" class="layui-input" value="${questionSettingType}"/>
2 years ago
<input type="hidden" name="questionSettingId" autocomplete="off" class="layui-input" value="${questionSettingId}"/>
<!--#} -->
2 years ago
<script id="demo" type="text/html">
<select name="teacherOpenCourseQuestionSettingId" lay-verify="">
<option value="">请选择</option>
{{# layui.each(d, function(index, item){ }}
<option value="{{item.teacherOpenCourseQuestionSettingId}}">{{item.teacherOpenCourseQuestionSettingName}}
</option>
{{# }); }}
</select>
</script>
2 years ago
<script id="CHAPTER_EXERCISE_demo" type="text/html">
<label class="layui-form-label">章节名称</label>
<div class="layui-input-block">
<!--<select name="courseInfoId" lay-verify="" ></select>-->
<select name="courseInfoId" lay-verify="">
<option value="">请选择</option>
{{# layui.each(d, function(index, item){ }}
<option value="{{item.courseInfoId}}">{{item.courseInfoName}}</option>
{{# }); }}
</select>
</div>
</script>
2 years ago
<script id="EXAM_demo" type="text/html">
<label class="layui-form-label">考试名称</label>
<div class="layui-input-inline">
<select name="questionSettingName" lay-verify="">
<option value="">请选择</option>
{{# layui.each(d, function(index, item){ }}
<option value="{{item.questionSettingName}}">{{item.questionSettingName}}</option>
{{# }); }}
</select>
</div>
</script>
<script id="HOMEWORK_FILE_demo" type="text/html">
<label class="layui-form-label" style="width: 85px">附件作业名称</label>
<div class="layui-input-inline">
<select name="teacherOpenCourseStudentSigninSettingSessionTime" lay-verify="">
<option value="">请选择</option>
{{# layui.each(d, function(index, item){ }}
<option value="{{item.questionSettingName}}">{{item.questionSettingName}}</option>
{{# }); }}
</select>
</div>
</script>
<script id="HOMEWORK_QUESTION_demo" type="text/html">
<label class="layui-form-label" style="width: 85px">题库作业名称</label>
<div class="layui-input-inline">
<select name="teacherOpenCourseStudentSigninSettingSessionTime" lay-verify="">
<option value="">请选择</option>
{{# layui.each(d, function(index, item){ }}
<option value="{{item.questionSettingName}}">{{item.questionSettingName}}</option>
{{# }); }}
</select>
</div>
</script>
<script>
layui.use(['form','laydate','table','laytpl'], function(){
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var laytpl = layui.laytpl;
2 years ago
var teacherOpenCourseQuestionLogTable = null;
var studentTable = null;
2 years ago
var questionSettingId = $("input[name='questionSettingId']").val();
var teacherOpenCourseId=$("input[name='teacherOpenCourseId']").val();
2 years ago
var questionSettingType = $("input[name='questionSettingType']").val();
laydate.render({
elem: '#test5'
,type: 'datetime'
, trigger: 'click'
});
var data = [];
2 years ago
var url = "/api/teacherOpenCourseQuestionSetting/getList.do?teacherOpenCourseId=" + teacherOpenCourseId + "&teacherOpenCourseQuestionSettingType=" + questionSettingType;
var ret = Common.getAjax(url);
if (ret.code == 0) {
data = ret.data;
}
2 years ago
var getTpl = demo.innerHTML
, view = document.getElementById('view');
2 years ago
laytpl(getTpl).render(data, function(html){
view.innerHTML = html;
});
2 years ago
var view ={
init:function(){
2 years ago
var that = this;
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
2 years ago
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable);
Lib.doSearchForm($("#searchForm"), studentTable);
that.initToolBar();
}
},
initTable:function(){
2 years ago
var sx_ = localStorage.getItem("teacherOpenCourseQuestionLogTable_field_" + Common.userInfoId); //筛选值显示、隐藏缓存
if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);}
2 years ago
var url = '/api/teacherOpenCourseQuestionLog/list.do';
if(questionSettingType == 'HOMEWORK_FILE'){
url = '/jlw/teacherOpenCourseQuestionLog/homeworkFileLogPageList.json';
}
2 years ago
teacherOpenCourseQuestionLogTable = table.render({
elem: '#teacherOpenCourseQuestionLogTable',
height : Lib.getTableHeight(1),
cellMinWidth: 100,
method : 'post',
2 years ago
url: Common.ctxPath + url // 数据接口
,page : Lib.tablePage // 开启分页
2 years ago
/* ,toolbar: '#toolbar_teacherOpenCourseQuestionLog' //自定义头部左侧工具栏
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏*/
2 years ago
,where:{'teacherOpenCourseQuestionSettingId':questionSettingId}
,limit : 10,
cols : [ [ // 表头
2 years ago
{
field: 'studentSn',
title: '学号',
align: "center",
hideField: false,
},
{
2 years ago
field: 'studentName', //数据字典类型为 student.student_name.student_status=1
title: '姓名',
align: "center",
hideField: false,
},
{
2 years ago
field: 'questionScore', //数据字典类型为 school_class.class_name.class_status=1
title: '题干',
align: "center",
hideField: false,
2 years ago
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
2 years ago
field: 'questionType',
title: '题型',
align: "center",
2 years ago
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
2 years ago
templet:function (d) {//1单选 2多选 3判断 4填空 5分析
var htm = d.questionType===1?"单选":d.questionType===2?"多选":d.questionType===3?"判断":d.questionType===4?"填空":d.questionType===5?"分析":""
2 years ago
return htm;
2 years ago
}
},
{
2 years ago
field: 'teacherOpenCourseQuestionLogAnswer', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
2 years ago
title: '我的选项',
align: "center",
hideField: false,
2 years ago
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
2 years ago
field: 'questionAnswer', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
2 years ago
title: '正确答案',
align: "center",
hideField: false,
2 years ago
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
2 years ago
field: 'status',
2 years ago
title: '状态',
align: "center",
2 years ago
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
templet: function (d) {
var htm = d.questionAnswer == d.teacherOpenCourseQuestionLogAnswer ? "正确" : "错误";
return htm;
}
},
{
field: 'questionName',
title: '报告名称',
align: "center",
hide: questionSettingType == "HOMEWORK_FILE" ? false : true,
2 years ago
},{
2 years ago
field: 'status',
title: '报告下载',
align: "center",
2 years ago
hide: questionSettingType == "HOMEWORK_FILE" ? false : true,
templet:function (d) {
var htm = '<a class="layui-table-link" lay-event="download">下载</a>'
}
},{
field: 'teacherOpenCourseQuestionLogReply',
title: '教师评语',
align: "center",
hide: questionSettingType == "HOMEWORK_FILE" ? false : true,
},
{
field: 'questionScore',
title: questionSettingType != "HOMEWORK_FILE" ?'得分':'报告得分',
align: "center",
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
templet: function (d) {
var htm = d.questionAnswer == d.teacherOpenCourseQuestionLogAnswer ? d.questionScore : "0";
return htm;
}
}
] ]
});
studentTable = table.render({
elem: '#studentTable',
height: Lib.getTableHeight(),
2 years ago
cellMinWidth: 80,
method: 'post',
even: true,
// skin:'nob',
2 years ago
where:getParam_s(),
2 years ago
size: "sm",
url: Common.ctxPath + '/api/teacherOpenCourseQuestionLog/studentScoreList.do' // 数据接口
, page: Lib.tablePage // 开启分页
, limit: 10,
cols: [[
{
field: 'studentSn',
title: '学号', align: "center",
},
{
2 years ago
field: 'studentName',
title: '姓名', align: "center"
}, {
field: 'studentScore',
title: '得分', align: "center"
}
]]
});
2 years ago
table.on('checkbox(teacherOpenCourseQuestionLogTable)', function (obj) {
var teacherOpenCourseQuestionLog = obj.data;
if(obj.checked){
//按钮逻辑Lib.buttonEnable()
}else{
}
});
//触发行单击事件
table.on('row(studentTable)', function(obj){
2 years ago
var settingId = $("select[name='teacherOpenCourseQuestionSettingId']").val();
var param={
2 years ago
'studentId':obj.data.studentId,
'teacherOpenCourseQuestionSettingId':$.isEmpty(settingId)?questionSettingId:settingId,
};
2 years ago
if(questionSettingType == 'HOMEWORK_FILE'){
url = 'jlw/teacherOpenCourseQuestionLog/homeworkFileLogPageList.json';
param = {"questionSettingIdPlural":questionSettingId};
}
2 years ago
teacherOpenCourseQuestionLogTable.reload({
where: param,
page: {
curr: 1
}
});
});
},
initSearchForm:function(){
2 years ago
//Lib.initSearchForm( $("#searchForm"),teacherOpenCourseQuestionLogTable,form);
//Lib.initSearchForm( $("#studentForm"),studentTable,form);
var btn_s = $("#searchFormSearch");
btn_s.on('click', function () {
var data = $("#searchForm").serializeJson();
2 years ago
data.teacherOpenCourseQuestionSettingId =$.isEmpty(data.teacherOpenCourseQuestionSettingId)?questionSettingId:data.teacherOpenCourseQuestionSettingId
2 years ago
teacherOpenCourseQuestionLogTable.reload({
where: data,
page: {
curr: 1
}
});
});
var btn = $("#studentFormSearch");
btn.on('click', function () {
studentTable.reload({
where: getParam_s(),
page: {
curr: 1
}
});
});
},
initToolBar:function(){
toolbar = {
2 years ago
/*add: function () {
var url = "/jlw/teacherOpenCourseQuestionLog/add.do";
Common.openDlg(url,"学生签到记录管理>新增");
},
edit: function () {
2 years ago
var data = Common.getOneFromTable(table,"teacherOpenCourseQuestionLogTable");
if(data==null){
return ;
}
2 years ago
var url = "/jlw/teacherOpenCourseQuestionLog/add.do?teacherOpenCourseQuestionLogId="+data.teacherOpenCourseQuestionLogId;
Common.openDlg(url,"学生签到记录管理>"+data.teacherOpenCourseQuestionLogId+">编辑");
},
del: function () {
layui.use(['del'], function(){
var delView = layui.del
delView.delBatch();
});
},
search: function () {
2 years ago
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable, 1);
view.initToolBar()
},
refresh: function () {
searchForm.reset();
2 years ago
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable, 1);
view.initToolBar()
},
2 years ago
importDocument: function () {
var uploadUrl = Common.ctxPath+"/jlw/teacherOpenCourseQuestionLog/importTemplate.json";
//模板,
2 years ago
var templatePath= Common.ctxPath+"/jlw/teacherOpenCourseQuestionLog/downloadTemplate.json";
//公共的简单上传文件处理
var url = "/core/file/simpleUpload.do?uploadUrl="+uploadUrl+"&templatePath="+templatePath;
2 years ago
Common.openDlg(url, "teacherOpenCourseQuestionLog管理>上传");
},*/
exportDocument: function () {
2 years ago
var url,title;
var settingId = $("select[name='teacherOpenCourseQuestionSettingId']").val();
2 years ago
settingId = $.isEmpty(settingId)?questionSettingId:settingId;
2 years ago
if(questionSettingType == "CHAPTER_EXERCISE"){///jlw/questionLogSummary/homeworkFileAnalysisExport.json
title = '章节详情表';
url = "/api/teacherOpenCourseQuestionLog/zyDetailExport.do?teacherOpenCourseQuestionSettingId=" + settingId;
}else if(questionSettingType == "EXAM"){
title = '考试详情表';
url = "/api/teacherOpenCourseQuestionLog/zyDetailExport.do?teacherOpenCourseQuestionSettingId=" + settingId;
}else if(questionSettingType == "HOMEWORK_FILE"){
title = '附件作业详情表';
2 years ago
url = '/jlw/questionLogSummary/homeworkFileAnalysisExport.json?teacherOpenCourseId'+ teacherOpenCourseId + '&questionSettingType=' + questionSettingType;
2 years ago
}else if(questionSettingType == "HOMEWORK_QUESTION"){
title ="题库作业详情表";
url = "/api/teacherOpenCourseQuestionLog/zyDetailExport.do?teacherOpenCourseQuestionSettingId=" + settingId;
}
Common.openConfirm("确认要导出"+title+"?", function (index) {
2 years ago
$.downFile(Common.ctxPath + url);
2 years ago
layer.close(index);
2 years ago
})
},
addButton_cancel:function () {
parent.Lib.tableRefresh();
Lib.closeFrame();
},
2 years ago
};
//触发事件
$('.ext-toolbar').on('click', function() {
var type = $(this).data('type');
toolbar[type] ? toolbar[type].call(this) : '';
});
2 years ago
}, initTableTool: table.on('tool(teacherOpenCourseQuestionLogTable)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
2 years ago
//var url = "/jlw/teacherOpenCourseQuestionLog/add.do?teacherOpenCourseQuestionLogId="+data.teacherOpenCourseQuestionLogId;
Common.openDlg(url, "学生签到记录管理>" + data.teacherOpenCourseQuestionLogId + ">编辑");
}else if(obj.event === "del"){
layer.confirm('是否确定删除该信息?', function (index) {
2 years ago
// var ret = Common.postAjax("/jlw/teacherOpenCourseQuestionLog/delete.json",{ids:data.teacherOpenCourseQuestionLogId});
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();
}
});
});
}
})
};
function getParam_s(){
var param = {
"schoolClassIdPlural":$("#studentForm select[name='classId']").val(),
"studentSnOrName":$("#studentForm input[name='studentOrName']").val(),
2 years ago
'teacherOpenCourseId': teacherOpenCourseId
};
return param
}
2 years ago
form.render();
view.init();
});
</script>