文件存档

beetlsql3-dev
姚丹ab 2 years ago
parent c9e9cbf1b4
commit 7cdd7505f9

@ -176,10 +176,11 @@ public class QuestionLogSummaryController extends BaseController {
*/
@GetMapping(MODEL + "/index.do")
@Function("questionLogSummary.query")
public ModelAndView index(Long teacherOpenCourseId) {
public ModelAndView index(Long teacherOpenCourseId, @RequestParam(required = false) ResourcesQuestionSnapshotFromTypeEnum questionSettingType) {
ModelAndView view = new ModelAndView("/jlw/questionLogSummary/index.html") ;
view.addObject("search", QuestionLogSummaryQuery.class.getName());
view.addObject("teacherOpenCourseId", teacherOpenCourseId);
view.addObject("questionSettingType", questionSettingType);
return view;
}
/**
@ -189,19 +190,7 @@ public class QuestionLogSummaryController extends BaseController {
@GetMapping(MODEL + "/homeworkIndex.do")
@Function("questionLogSummary.query")
public ModelAndView homeworkIndex(Long teacherOpenCourseId) {
ModelAndView view = new ModelAndView("/jlw/questionLogSummary/index.html") ;
view.addObject("search", QuestionLogSummaryQuery.class.getName());
view.addObject("teacherOpenCourseId", teacherOpenCourseId);
return view;
}
/**
*@author
*@data 2023/01/10
*/
@GetMapping(MODEL + "/examIndex.do")
@Function("questionLogSummary.query")
public ModelAndView examIndex(Long teacherOpenCourseId) {
ModelAndView view = new ModelAndView("/jlw/questionLogSummary/index.html") ;
ModelAndView view = new ModelAndView("/jlw/questionLogSummary/homeworkIndex.html") ;
view.addObject("search", QuestionLogSummaryQuery.class.getName());
view.addObject("teacherOpenCourseId", teacherOpenCourseId);
return view;
@ -236,10 +225,11 @@ public class QuestionLogSummaryController extends BaseController {
*/
@GetMapping(MODEL + "/indexInfo.do")
@Function("questionLogSummary.query")
public ModelAndView indexInfo(Long teacherOpenCourseId) {
public ModelAndView indexInfo(Long teacherOpenCourseId, @RequestParam(required = false) ResourcesQuestionSnapshotFromTypeEnum questionSettingType) {
ModelAndView view = new ModelAndView("/jlw/questionLogSummary/indexInfo.html") ;
view.addObject("search", QuestionLogSummaryQuery.class.getName());
view.addObject("teacherOpenCourseId", teacherOpenCourseId);
view.addObject("questionSettingType", questionSettingType);
return view;
}

@ -7,27 +7,36 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) {
var data = {};
var teacherOpenCourseId = $("input[name='teacherOpenCourseId']").val();
var questionSettingType = $("input[name='questionSettingType']").val();
var ret = Common.postAjax("/jlw/teacherOpenCourseQuestionSetting/analysis.json",
{'teacherOpenCourseId':teacherOpenCourseId,'questionSettingType':'CHAPTER_EXERCISE'});
{'teacherOpenCourseId': teacherOpenCourseId, 'questionSettingType': questionSettingType});
if(ret.code==0){
data = ret.data;
if($.isEmpty(data)){
data = {
questionTotalCount:'',
avgCorrectCount:'',
avgWrongCount:'',
avgStudentScore:'',
};
}
var getTpl = demo.innerHTML
,view = document.getElementById('view');
laytpl(getTpl).render(data, function(html){
view.innerHTML = html;
});
}else {
Common.info(ret.msg);
}
if ($.isEmpty(data)) {
data = {
questionTotalCount: '',
avgCorrectCount: '',
avgWrongCount: '',
avgStudentScore: '',
avgQuestionLogSummarySuccessRate: ''
};
}
var getTpl, view;
if (questionSettingType == "CHAPTER_EXERCISE") {
getTpl = demo.innerHTML
, view = document.getElementById('view');
} else if (questionSettingType == "EXAM") {
getTpl = EXAM_demo.innerHTML
, view = document.getElementById('view');
}
laytpl(getTpl).render(data, function (html) {
view.innerHTML = html;
});
var view ={
init:function(){
var that = this
@ -48,15 +57,16 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) {
cellMinWidth: 100,
method : 'post',
url : Common.ctxPath + '/jlw/questionLogSummary/analysisPageList.json' // 数据接口
,where:{'teacherOpenCourseId':teacherOpenCourseId,'questionSettingType':'CHAPTER_EXERCISE'}
, where: {'teacherOpenCourseId': teacherOpenCourseId, 'questionSettingType': questionSettingType}
,page : Lib.tablePage // 开启分页
/* ,toolbar: '#toolbar_questionLogSummary' //自定义头部左侧工具栏
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏*/
,limit : 10,
cols : [ [ // 表头
{type: "numbers", title: "序号"},
{
field : 'questionSettingName',
title : '章节名称',
title: questionSettingType == "CHAPTER_EXERCISE" ? '章节名称' : '考试名称',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['questionSettingName'])?false:sx_['questionSettingName'],
@ -67,6 +77,15 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) {
align:"center",
hideField :false,
hide:$.isEmpty(sx_['questionTotalCount'])?false:sx_['questionTotalCount'],
hide: questionSettingType == "CHAPTER_EXERCISE" ? false : true,
},
{
field: 'avgFinishTime',
title: '考试时间',
align: "center",
hideField: false,
hide: $.isEmpty(sx_['avgFinishTime']) ? false : sx_['avgFinishTime'],
hide: questionSettingType == "EXAM" ? false : true,
},
{
field : 'avgCorrectCount',
@ -84,7 +103,7 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) {
},
{
field : 'avgStudentScore',
title : '合计得分',
title: '平均得分',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['avgStudentScore'])?false:sx_['avgStudentScore'],
@ -158,7 +177,7 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) {
})
});*/
layer.confirm('是否确定导出章节练习表吗?', function (index) {
var url =Common.ctxPath + "/jlw/questionLogSummary/exportAnalysis.json?teacherOpenCourseId="+teacherOpenCourseId+'&questionSettingType=CHAPTER_EXERCISE';
var url = Common.ctxPath + "/jlw/questionLogSummary/exportAnalysis.json?teacherOpenCourseId=" + teacherOpenCourseId + '&questionSettingType=' + questionSettingType;
$.downFile(url);
layer.close(index);
});
@ -197,9 +216,8 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) {
});
});
}else if (obj.event === 'details') {
console.log(teacherOpenCourseId)
var url = "/jlw/questionLogSummary/indexInfo.do?teacherOpenCourseId="+teacherOpenCourseId;//,where:{'teacherOpenCourseId':teacherOpenCourseId,'questionSettingType':'CHAPTER_EXERCISE'}
Common.openDlg(url,"/详情");
var url = "/jlw/questionLogSummary/indexInfo.do?teacherOpenCourseId=" + teacherOpenCourseId + "&questionSettingType=" + questionSettingType;
Common.openDlg(url, "详情");
}
})
}

@ -63,8 +63,8 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
var htm = '<a class="layui-table-link" lay-event="qd">签到</a>';
htm += '<a class="layui-table-link" lay-event="chapter">章节</a>';
htm += '<a class="layui-table-link" lay-event="kcsc">课程实操</a>';
htm += '<a class="layui-table-link" lay-event="zy">作业</a>';
htm += '<a class="layui-table-link" lay-event="ks">考试</a>';
htm += '<a class="layui-table-link" lay-event="homework">作业</a>';
htm += '<a class="layui-table-link" lay-event="exam">考试</a>';
htm += '<a class="layui-table-link" lay-event="hd" style="margin-right: 0px;">互动</a>';
return htm;
}
@ -165,22 +165,19 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
var url = "/jlw/teacherOpenCourseStudentSigninSetting/index.do?teacherOpenCourseId="+data.teacherOpenCourseId;
Common.openDlg(url,"《"+title+"》/ 签到数据存档");
}else if(obj.event === "chapter"){
var url = "/jlw/questionLogSummary/index.do?teacherOpenCourseId="+data.teacherOpenCourseId;
var url = "/jlw/questionLogSummary/index.do?teacherOpenCourseId=" + data.teacherOpenCourseId + "&questionSettingType=CHAPTER_EXERCISE";
Common.openDlg(url,"《"+title+"》/ 章节练习存档");
}else if(obj.event === "kcsc"){
var url = "/jlw/questionLogSummary/index.do?teacherOpenCourseId="+data.teacherOpenCourseId;
Common.openDlg(url,"《"+title+"》/ 课程实操存档");
}else if(obj.event === "zy"){
var url = "/jlw/questionLogSummary/homeworkIndex.do?teacherOpenCourseId="+data.teacherOpenCourseId;
} else if (obj.event === "homework") {
var url = "/jlw/questionLogSummary/homeworkIndex.do?teacherOpenCourseId=" + data.teacherOpenCourseId;
Common.openDlg(url,"《"+title+"》/ 作业存档");
}else if(obj.event === "ks"){
var url = "/jlw/questionLogSummary/examIndex.do?teacherOpenCourseId="+data.teacherOpenCourseId;
} else if (obj.event === "exam") {
var url = "/jlw/questionLogSummary/index.do?teacherOpenCourseId=" + data.teacherOpenCourseId + "&questionSettingType=EXAM";
Common.openDlg(url,"《"+title+"》/ 考试存档");
}else if(obj.event === "hd"){
var url = "/jlw/teacherOpenCourseChatLog/index.do?teacherOpenCourseId="+data.teacherOpenCourseId;
Common.openDlg(url,"《"+title+"》/ 互动存档");
}

@ -1,31 +0,0 @@
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/questionLogSummary/"}){ -->
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
</layui:searchForm>
<table id="questionLogSummaryTable" lay-filter="questionLogSummaryTable"></table>
<!--#} -->
<script type="text/html" id="toolbar_questionLogSummary">
<div class="layui-btn-container">
<div class="layui-btn-group" >
<!--# if(core.searchIsShow(search)) {-->
<layui:accessButton function="questionLogSummary.query" id="searchFormSearch" action="search"><i class="layui-icon">&#xe615;</i>搜索</layui:accessButton>
<!--# }-->
<layui:accessButton function="questionLogSummary.add" action="add">添加</layui:accessButton>
<layui:accessButton function="questionLogSummary.edit" action="edit">修改</layui:accessButton>
<layui:accessButton function="questionLogSummary.del" action="del">删除</layui:accessButton>
<!--# if(!isEmpty(search)) {-->
<layui:accessButton function="questionLogSummary.query" action="refresh"><i class="layui-icon">&#xe669;</i>刷新</layui:accessButton>
<!--# }-->
<layui:accessButton function="questionLogSummary.exportDocument" action="exportDocument">导出</layui:accessButton>
<layui:accessButton function="questionLogSummary.importTemplate" action="importDocument">导入</layui:accessButton>
</div>
</div>
</script>
<script>
layui.use(['index'], function(){
var index = layui.index;
index.init();
});
</script>

@ -1,31 +1,248 @@
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/questionLogSummary/"}){ -->
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
</layui:searchForm>
<table id="questionLogSummaryTable" lay-filter="questionLogSummaryTable"></table>
<!--#} -->
<div class="layui-row" style="float: right">
<layui:accessButton function="teacherOpenCourseStudentSigninSetting.query" class="layui-btn-primary"
action="addButton_cancel"><span class="iconfont">&#xe600;</span>返回
</layui:accessButton>
</div>
<script type="text/html" id="toolbar_questionLogSummary">
<div class="layui-btn-container">
<div class="layui-btn-group" >
<!--# if(core.searchIsShow(search)) {-->
<layui:accessButton function="questionLogSummary.query" id="searchFormSearch" action="search"><i class="layui-icon">&#xe615;</i>搜索</layui:accessButton>
<!--# }-->
<layui:accessButton function="questionLogSummary.add" action="add">添加</layui:accessButton>
<layui:accessButton function="questionLogSummary.edit" action="edit">修改</layui:accessButton>
<layui:accessButton function="questionLogSummary.del" action="del">删除</layui:accessButton>
<!--# if(!isEmpty(search)) {-->
<layui:accessButton function="questionLogSummary.query" action="refresh"><i class="layui-icon">&#xe669;</i>刷新</layui:accessButton>
<!--# }-->
<layui:accessButton function="questionLogSummary.exportDocument" action="exportDocument">导出</layui:accessButton>
<layui:accessButton function="questionLogSummary.importTemplate" action="importDocument">导入</layui:accessButton>
<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">&#xe8c7;</span>导出
</layui:accessButton>
</div>
</div>
<table id="questionLogSummaryTable" lay-filter="questionLogSummaryTable"></table>
</div>
</div>
</div>
</script>
</div>
<input type="hidden" name="teacherOpenCourseId" autocomplete="off" class="layui-input"
value="${teacherOpenCourseId}"/>
<!--#} -->
<script>
layui.use(['index'], function(){
var index = layui.index;
index.init();
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/analysisPageList.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
},
{
field: 'avgFinishTime',
title: '作业时间',
align: "center"
},
{
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>

@ -21,8 +21,20 @@
</h2>
</script>
<script type="text/html" id="EXAM_demo">
<h2 style="float: left">考试汇总:【
合计考试题目数量:{{!$.isEmpty(d)?d.questionTotalCount:" "}};
合计平均答对数量:{{!$.isEmpty(d)?d.avgCorrectCount:""}};
合计平均答错数量:{{!$.isEmpty(d)?d.avgWrongCount:""}};
合计平均准确率:{{!$.isEmpty(d)?d.avgQuestionLogSummarySuccessRate:""}};
合计平均得分:{{!$.isEmpty(d)?d.avgStudentScore:""}}
</h2>
</script>
<table id="questionLogSummaryTable" lay-filter="questionLogSummaryTable"></table>
<input type="hidden" name="teacherOpenCourseId" value="${teacherOpenCourseId}" />
<input type="hidden" name="questionSettingType" value="${questionSettingType}" />
<!--#} -->
<!--<script type="text/html" id="toolbar_questionLogSummary">

@ -32,44 +32,79 @@
</layui:searchForm>
</div>
<div class="layui-inline layui-form-item" style="margin-top:-5px;">
<layui:accessButton function="teacherOpenCourseStudentSigninLog.query" action="exportDocument"><span
<layui:accessButton function="teacherOpenCourseQuestionLog.query" action="exportDocument"><span
class="iconfont">&#xe8c7;</span>导出</layui:accessButton>
</div>
<div class="layui-inline" style="float: right">
<layui:accessButton function="teacherOpenCourseStudentSigninLog.query" class="layui-btn-primary"
<layui:accessButton function="teacherOpenCourseQuestionLog.query" class="layui-btn-primary"
action="addButton_cancel"><span class="iconfont">&#xe600;</span>返回</layui:accessButton>
</div>
<table class="teacherOpenCourseStudentSigninLogTable"
lay-filter="teacherOpenCourseStudentSigninLogTable"></table>
<table id="teacherOpenCourseQuestionLogTable"
lay-filter="teacherOpenCourseQuestionLogTable"></table>
</div>
</div>
<input type="hidden" name="teacherOpenCourseId" autocomplete="off" class="layui-input" value="${teacherOpenCourseId}"/>
<input type="hidden" name="questionSettingType" autocomplete="off" class="layui-input" value="${questionSettingType}"/>
<!--#} -->
<script id="opTime_demo" type="text/html">
<label class="layui-form-label">日期筛选</label>
<div class="layui-input-inline">
<select name="teacherOpenCourseStudentSigninSettingSessionTime" lay-verify="" > </select>
<!--<input type="text" name="" placeholder="teacherOpenCourseStudentSigninSettingSessionTime"
autocomplete="off" class="layui-input" id="test5">-->
<option value="">请选择</option>
{{# layui.each(d, function(index, item){ }}
<option value="{{item}}">{{item}}</option>
{{# }); }}
<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>
<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;
var teacherOpenCourseStudentSigninLogTable = null;
var teacherOpenCourseQuestionLogTable = null;
var studentTable = null;
var teacherOpenCourseStudentSigninSettingId=$("input[name='teacherOpenCourseStudentSigninSettingId']").val();
var teacherOpenCourseId=$("input[name='teacherOpenCourseId']").val();
var questionSettingType = $("input[name='questionSettingType']").val();
laydate.render({
elem: '#test5'
@ -77,41 +112,88 @@ layui.use(['form','laydate','table','laytpl'], function(){
, trigger: 'click'
});
var data = [];
var ret = Common.postAjax("/jlw/teacherOpenCourseStudentSigninSetting/sessionDateList.json", {"teacherOpenCourseId": teacherOpenCourseId});
if(ret.code==0){
data = ret.data;
var getTpl, view;
if (questionSettingType == "CHAPTER_EXERCISE") {
var paras = {
//courseInfoParentId: teacherOpenCourseId,
courseInfoType: 2,
courseInfoStatus: 1
};
var ret = Common.getAjax("/jlw/courseInfo/getValues.json", paras);
if (ret.code == 0) {
data = ret.data;
}
var getTpl = CHAPTER_EXERCISE_demo.innerHTML
, view = document.getElementById('opTime_view');
} else if (questionSettingType == "EXAM") {
var ret = Common.postAjax("/jlw/questionLogSummary/analysisPageList.json", {
"teacherOpenCourseId": teacherOpenCourseId,
'questionSettingType': questionSettingType
});
if (ret.code == 0) {
data = ret.data;
}
var getTpl = EXAM_demo.innerHTML
, view = document.getElementById('opTime_view');
} else if (questionSettingType == "HOMEWORK_FILE") {
var ret = Common.postAjax("/jlw/questionLogSummary/analysisPageList.json", {
"teacherOpenCourseId": teacherOpenCourseId,
'questionSettingType': questionSettingType
});
if (ret.code == 0) {
data = ret.data;
}
var getTpl = HOMEWORK_FILE_demo.innerHTML
, view = document.getElementById('opTime_view');
} else if (questionSettingType == "HOMEWORK_QUESTION") {
var ret = Common.postAjax("/jlw/questionLogSummary/analysisPageList.json", {
"teacherOpenCourseId": teacherOpenCourseId,
'questionSettingType': questionSettingType
});
if (ret.code == 0) {
data = ret.data;
}
var getTpl = HOMEWORK_QUESTION_demo.innerHTML
, view = document.getElementById('opTime_view');
}
var getTpl = opTime_demo.innerHTML
,view = document.getElementById('opTime_view');
laytpl(getTpl).render(data, function(html){
view.innerHTML = html;
});
form.render();
var view ={
init:function(){
var that = this
var that = this;
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"), teacherOpenCourseStudentSigninLogTable);
Lib.doSearchForm($("#searchForm"), studentTable)
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable);
Lib.doSearchForm($("#searchForm"), studentTable);
that.initToolBar();
}
},
initTable:function(){
var sx_ = localStorage.getItem("teacherOpenCourseStudentSigninLogTable_field_"+Common.userInfoId); //筛选值显示、隐藏缓存
var sx_ = localStorage.getItem("teacherOpenCourseQuestionLogTable_field_" + Common.userInfoId); //筛选值显示、隐藏缓存
if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);}
teacherOpenCourseStudentSigninLogTable = table.render({
elem: '.teacherOpenCourseStudentSigninLogTable',
teacherOpenCourseQuestionLogTable = table.render({
elem: '#teacherOpenCourseQuestionLogTable',
height : Lib.getTableHeight(1),
cellMinWidth: 100,
method : 'post',
url : Common.ctxPath + '/jlw/teacherOpenCourseStudentSigninLog/list.json' // 数据接口
,where: {'teacherOpenCourseStudentSigninSettingId':teacherOpenCourseStudentSigninSettingId}
url: Common.ctxPath + '/api/teacherOpenCourseQuestionLog/list.do' // 数据接口
,page : Lib.tablePage // 开启分页
/* ,toolbar: '#toolbar_teacherOpenCourseStudentSigninLog' //自定义头部左侧工具栏
/* ,toolbar: '#toolbar_teacherOpenCourseQuestionLog' //自定义头部左侧工具栏
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏*/
,limit : 10,
cols : [ [ // 表头
@ -120,62 +202,82 @@ layui.use(['form','laydate','table','laytpl'], function(){
title: '学号',
align: "center",
hideField: false,
hide: $.isEmpty(sx_['teacherOpenCourseStudentSigninLogId']) ? false : sx_['teacherOpenCourseStudentSigninLogId'],
},
{
field: 'studentIdText', //数据字典类型为 student.student_name.student_status=1
field: 'studentName', //数据字典类型为 student.student_name.student_status=1
title: '姓名',
align: "center",
hideField: false,
hide: $.isEmpty(sx_['studentIdText']) ? false : sx_['studentIdText'],
},
{
field: 'questionScore', //数据字典类型为 school_class.class_name.class_status=1
title: '题干',
align: "center",
hideField: false,
hide: $.isEmpty(sx_['questionScore']) ? false : sx_['questionScore'],
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
field: 'questionType',
title: '题型',
align: "center",
hideField: false,
hide: $.isEmpty(sx_['questionType']) ? false : sx_['questionType'],
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
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?"分析":""
return htm;
}
},
{
field: 'teacherOpenCourseIdText', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
field: 'teacherOpenCourseQuestionLogAnswer', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
title: '我的选项',
align: "center",
hideField: false,
hide: $.isEmpty(sx_['teacherOpenCourseIdText']) ? false : sx_['teacherOpenCourseIdText'],
templet: function (d) {
return 1;
}
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
field: 'teacherOpenCourseStudentSigninLogRemark', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
field: 'questionAnswer', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
title: '正确答案',
align: "center",
hideField: false,
hide: $.isEmpty(sx_['teacherOpenCourseIdText']) ? false : sx_['teacherOpenCourseIdText'],
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
field: 'teacherOpenCourseStudentSigninSettingSessionTime',
field: 'status',
title: '状态',
align: "center",
hideField: false,
hide: $.isEmpty(sx_['teacherOpenCourseStudentSigninLogAddTime']) ? false : sx_['teacherOpenCourseStudentSigninLogAddTime'],
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,
},{
field: 'teacherOpenCourseStudentSigninSettingSessionTime',
title: '得分',
field: 'status',
title: '报告下载',
align: "center",
hideField: false,
hide: $.isEmpty(sx_['teacherOpenCourseStudentSigninLogAddTime']) ? false : sx_['teacherOpenCourseStudentSigninLogAddTime'],
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;
}
}
] ]
});
@ -183,12 +285,12 @@ layui.use(['form','laydate','table','laytpl'], function(){
studentTable = table.render({
elem: '#studentTable',
height: Lib.getTableHeight(),
cellMinWidth: 100,
cellMinWidth: 80,
method: 'post',
even: true,
// skin:'nob',
where:getParam_s(),
size: "lg",
// where:getParam_s(),
size: "sm",
url: Common.ctxPath + '/api/teacherOpenCourseQuestionLog/studentScoreList.do' // 数据接口
, page: Lib.tablePage // 开启分页
, limit: 10,
@ -196,12 +298,9 @@ layui.use(['form','laydate','table','laytpl'], function(){
{
field: 'studentSn',
title: '学号', align: "center",
templet:function (d) {
return $.isEmpty(d.studentInfo)?"":d.studentInfo.studentSn
}
},
{
field: 'studentIdText',
field: 'studentName',
title: '姓名', align: "center"
}, {
field: 'studentScore',
@ -210,8 +309,8 @@ layui.use(['form','laydate','table','laytpl'], function(){
]]
});
table.on('checkbox(teacherOpenCourseStudentSigninLogTable)', function(obj){
var teacherOpenCourseStudentSigninLog = obj.data;
table.on('checkbox(teacherOpenCourseQuestionLogTable)', function (obj) {
var teacherOpenCourseQuestionLog = obj.data;
if(obj.checked){
//按钮逻辑Lib.buttonEnable()
}else{
@ -222,11 +321,11 @@ layui.use(['form','laydate','table','laytpl'], function(){
table.on('row(studentTable)', function(obj){
var param={
'teacherOpenCourseStudentSigninSettingId': teacherOpenCourseStudentSigninSettingId,
'teacherOpenCourseStudentSigninSettingSessionTime':$("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val(),
'courseInfoId': $("select[name='courseInfoId']").val(),
'studentId':obj.data.studentId
}
teacherOpenCourseStudentSigninLogTable.reload({
teacherOpenCourseQuestionLogTable.reload({
where: param,
page: {
curr: 1
@ -236,25 +335,18 @@ layui.use(['form','laydate','table','laytpl'], function(){
},
initSearchForm:function(){
//Lib.initSearchForm( $("#searchForm"),teacherOpenCourseStudentSigninLogTable,form);
//Lib.initSearchForm( $("#searchForm"),teacherOpenCourseQuestionLogTable,form);
//Lib.initSearchForm( $("#studentForm"),studentTable,form);
var btn_s = $("#searchFormSearch");
btn_s.on('click', function () {
console.log($("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val())
var data = $("#searchForm").serializeJson();
teacherOpenCourseStudentSigninLogTable.reload({
teacherOpenCourseQuestionLogTable.reload({
where: data,
page: {
curr: 1
}
});
studentTable.reload({
where: getParam_s(),
page: {
curr: 1
}
});
});
var btn = $("#studentFormSearch");
@ -270,17 +362,17 @@ layui.use(['form','laydate','table','laytpl'], function(){
initToolBar:function(){
toolbar = {
add: function () {
var url = "/jlw/teacherOpenCourseStudentSigninLog/add.do";
/*add: function () {
var url = "/jlw/teacherOpenCourseQuestionLog/add.do";
Common.openDlg(url,"学生签到记录管理>新增");
},
edit: function () {
var data = Common.getOneFromTable(table,"teacherOpenCourseStudentSigninLogTable");
var data = Common.getOneFromTable(table,"teacherOpenCourseQuestionLogTable");
if(data==null){
return ;
}
var url = "/jlw/teacherOpenCourseStudentSigninLog/add.do?teacherOpenCourseStudentSigninLogId="+data.teacherOpenCourseStudentSigninLogId;
Common.openDlg(url,"学生签到记录管理>"+data.teacherOpenCourseStudentSigninLogId+">编辑");
var url = "/jlw/teacherOpenCourseQuestionLog/add.do?teacherOpenCourseQuestionLogId="+data.teacherOpenCourseQuestionLogId;
Common.openDlg(url,"学生签到记录管理>"+data.teacherOpenCourseQuestionLogId+">编辑");
},
del: function () {
layui.use(['del'], function(){
@ -289,52 +381,47 @@ layui.use(['form','laydate','table','laytpl'], function(){
});
},
search: function () {
Lib.doSearchForm($("#searchForm"), teacherOpenCourseStudentSigninLogTable, 1);
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable, 1);
view.initToolBar()
},
refresh: function () {
searchForm.reset();
Lib.doSearchForm($("#searchForm"), teacherOpenCourseStudentSigninLogTable, 1);
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable, 1);
view.initToolBar()
},
exportDocument: function () {
layui.use([ 'teacherOpenCourseStudentSigninLogApi' ], function() {
var teacherOpenCourseStudentSigninLogApi = layui.teacherOpenCourseStudentSigninLogApi
Common.openConfirm("确认要导出签到详情?", function() {
// teacherOpenCourseStudentSigninLogApi.exportExcel($("#searchForm"), function(fileId) {
// // Lib.download(fileId);
// })
$.downFile(Common.ctxPath + "/api/teacherOpenCourseStudentSigninLog/export.do?teacherOpenCourseId="+teacherOpenCourseId);
})
});
},
importDocument: function () {
var uploadUrl = Common.ctxPath+"/jlw/teacherOpenCourseStudentSigninLog/importTemplate.json";
importDocument: function () {
var uploadUrl = Common.ctxPath+"/jlw/teacherOpenCourseQuestionLog/importTemplate.json";
//模板,
var templatePath= Common.ctxPath+"/jlw/teacherOpenCourseStudentSigninLog/downloadTemplate.json";
var templatePath= Common.ctxPath+"/jlw/teacherOpenCourseQuestionLog/downloadTemplate.json";
//公共的简单上传文件处理
var url = "/core/file/simpleUpload.do?uploadUrl="+uploadUrl+"&templatePath="+templatePath;
Common.openDlg(url, "TeacherOpenCourseStudentSigninLog管理>上传");
Common.openDlg(url, "teacherOpenCourseQuestionLog管理>上传");
},*/
exportDocument: function () {
Common.openConfirm("确认要导出该详情?", function () {
//$.downFile(Common.ctxPath + "/api/teacherOpenCourseQuestionLog/export.do?teacherOpenCourseId="+teacherOpenCourseId);
})
},
addButton_cancel:function () {
parent.Lib.tableRefresh();
Lib.closeFrame();
},
}
};
//触发事件
$('.ext-toolbar').on('click', function() {
var type = $(this).data('type');
toolbar[type] ? toolbar[type].call(this) : '';
});
}, initTableTool: table.on('tool(teacherOpenCourseStudentSigninLogTable)', function (obj) {
}, initTableTool: table.on('tool(teacherOpenCourseQuestionLogTable)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
var url = "/jlw/teacherOpenCourseStudentSigninLog/add.do?teacherOpenCourseStudentSigninLogId="+data.teacherOpenCourseStudentSigninLogId;
Common.openDlg(url,"学生签到记录管理>"+data.teacherOpenCourseStudentSigninLogId+">编辑");
//var url = "/jlw/teacherOpenCourseQuestionLog/add.do?teacherOpenCourseQuestionLogId="+data.teacherOpenCourseQuestionLogId;
Common.openDlg(url, "学生签到记录管理>" + data.teacherOpenCourseQuestionLogId + ">编辑");
}else if(obj.event === "del"){
layer.confirm('是否确定删除该信息?', function (index) {
var ret = Common.postAjax("/jlw/teacherOpenCourseStudentSigninLog/delete.json",{ids:data.teacherOpenCourseStudentSigninLogId});
// 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,
@ -350,14 +437,17 @@ layui.use(['form','laydate','table','laytpl'], function(){
};
function getParam_s(){
var param = {
"teacherOpenCourseStudentSigninSettingSessionTime":$("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val(),
//"teacherOpenCourseStudentSigninSettingSessionTime":$("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val(),
"schoolClassIdPlural":$("#studentForm select[name='classId']").val(),
"studentSnOrName":$("#studentForm input[name='studentOrName']").val(),
'teacherOpenCourseId':teacherOpenCourseId
//'teacherOpenCourseId':teacherOpenCourseId
};
return param
}
form.render();
view.init();
});
</script>

Loading…
Cancel
Save