Merge remote-tracking branch 'origin/beetlsql3-dev' into beetlsql3-dev

beetlsql3-dev
Mlxa0324 2 years ago
commit b948028150

@ -14,8 +14,10 @@ import com.ibeetl.jlw.entity.TaskTypeParam;
import com.ibeetl.jlw.entity.TeacherOpenCourseHandsOn;
import com.ibeetl.jlw.entity.TeacherOpenCourseHandsOnList;
import com.ibeetl.jlw.entity.vo.StudentHandsOnVO;
import com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum;
import com.ibeetl.jlw.service.TeacherOpenCourseHandsOnService;
import com.ibeetl.jlw.web.query.GetHandsOnListParam;
import com.ibeetl.jlw.web.query.QuestionLogSummaryQuery;
import com.ibeetl.jlw.web.query.TeacherOpenCourseHandsOnQuery;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@ -27,10 +29,7 @@ import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
@ -108,6 +107,20 @@ public class TeacherOpenCourseHandsOnController{
return view;
}
/**
*@author
*@data 2023/01/14
*/
@GetMapping(MODEL + "/indexInfoV.do")
@Function("teacherOpenCourseHandsOn.query")
public ModelAndView indexInfoV(Long teacherOpenCourseId,Long handsOnId) {
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseHandsOn/indexInfoV.html") ;
view.addObject("search", TeacherOpenCourseHandsOnQuery.class.getName());
view.addObject("teacherOpenCourseId", teacherOpenCourseId);
view.addObject("handsOnId", handsOnId);
return view;
}
@GetMapping(MODEL + "/edit.do")
@Function("teacherOpenCourseHandsOn.edit")
public ModelAndView edit(Long handsOnId) {

@ -203,6 +203,8 @@ layui.define([ 'form', 'laydate', 'table','laytpl' ], function(exports) {
});
});
}else if(obj.event === "videoAvgScore"){
var url = "/jlw/teacherOpenCourseHandsOn/indexInfoV.do?handsOnId=" + data.teacherOpenCourseStudentSigninSettingId + "&teacherOpenCourseId=" + teacherOpenCourseId;
Common.openDlg(url,"/详情");
//teacherOpenCourseId handsOnId
//搜索条件studentOrName
}else if(obj.event === "pptAvgScore"){

@ -233,35 +233,38 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
var index_child = 1;
var index_child_child = 1;
var courseInfoParentIdOld;
var courseInfoIdOld;
courseInfoAllData.forEach((item,index) => {
/*根据课程类型值判断章节*/
if(item.courseInfoType == 2){
item.numberName = index_parent;
item.courseInfoNo = index_parent;
index_parent++;
courseInfoParentIdOld = item.courseInfoId;
index_child =1
courseInfoParentIdOld = item.courseInfoParentId;
courseInfoIdOld = item.courseInfoId;
index_child =1;
}
if(item.courseInfoType == 3){
if(item.courseInfoParentId === courseInfoParentIdOld){
item.numberName = index_parent-1 + "." + index_child;
index_child++;
index_child_child =1
}else {
item.numberName = index_parent-1 + "." + (index_child-1)+"."+index_child_child;
index_child_child=1
courseInfoAllData.forEach((em,i) => {
if(item.courseInfoType == 2 && (item.courseInfoId == em.courseInfoParentId)){
em.courseInfoNo = index_parent-1 + "." + index_child;
index_child ++;
}
if(item.courseInfoType == 3 && (item.courseInfoId == em.courseInfoParentId)){
em.courseInfoNo = item.courseInfoNo+"."+index_child_child;
index_child_child++
}
}
});
item.resourcesInfo.forEach(function (e, i) {
e.courseInfoParentId = e.courseInfoId;
e.courseInfoId = 0;
e.courseInfoName = e.resourcesInfoName;
e.numberName='';
e.courseInfoNo='';
courseInfoAllData.push(e);
});
});
layer.closeAll();
}else{
layer.msg(ret.msg||"加载失败!!", {
@ -296,7 +299,7 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
,totalRow: true*/
, cols: [[ // 表头
{
field: 'numberName',
field: 'courseInfoNo',
title: '序号',
width:280,
align: "center",

@ -0,0 +1,454 @@
<!--#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}">
<div class="layui-inline">
<!--#if(questionSettingType=='CHAPTER_EXERCISE'){-->
<label class="layui-form-label">章节名称</label>
<!--#}else if(questionSettingType=='EXAM'){-->
<label class="layui-form-label">考试名称</label>
<!--#}else if(questionSettingType=='HOMEWORK_FILE'){-->
<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;">
<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="teacherOpenCourseQuestionLog.query" class="layui-btn-primary"
action="addButton_cancel"><span class="iconfont">&#xe600;</span>返回</layui:accessButton>
</div>
<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}"/>
<input type="hidden" name="questionSettingId" autocomplete="off" class="layui-input" value="${questionSettingId}"/>
<!--#} -->
<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>
<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 teacherOpenCourseQuestionLogTable = null;
var studentTable = null;
var questionSettingId = $("input[name='questionSettingId']").val();
var teacherOpenCourseId=$("input[name='teacherOpenCourseId']").val();
var questionSettingType = $("input[name='questionSettingType']").val();
laydate.render({
elem: '#test5'
,type: 'datetime'
, trigger: 'click'
});
var data = [];
var url = "/api/teacherOpenCourseQuestionSetting/getList.do?teacherOpenCourseId=" + teacherOpenCourseId + "&teacherOpenCourseQuestionSettingType=" + questionSettingType;
var ret = Common.getAjax(url);
if (ret.code == 0) {
data = ret.data;
}
var getTpl = demo.innerHTML
, view = document.getElementById('view');
laytpl(getTpl).render(data, function(html){
view.innerHTML = html;
});
var view ={
init:function(){
var that = this;
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable);
Lib.doSearchForm($("#searchForm"), studentTable);
that.initToolBar();
}
},
initTable:function(){
var sx_ = localStorage.getItem("teacherOpenCourseQuestionLogTable_field_" + Common.userInfoId); //筛选值显示、隐藏缓存
if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);}
var url = '/api/teacherOpenCourseQuestionLog/list.do?questionLogAddType=FINALLY_SUBMIT';
if(questionSettingType == 'HOMEWORK_FILE'){
url = '/jlw/teacherOpenCourseQuestionLog/homeworkFileLogPageList.json';
}
teacherOpenCourseQuestionLogTable = table.render({
elem: '#teacherOpenCourseQuestionLogTable',
height : Lib.getTableHeight(1),
cellMinWidth: 100,
method : 'post',
url: Common.ctxPath + url // 数据接口
,page : Lib.tablePage // 开启分页
/* ,toolbar: '#toolbar_teacherOpenCourseQuestionLog' //自定义头部左侧工具栏
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏*/
,where:{'teacherOpenCourseQuestionSettingId':questionSettingId}
,limit : 10,
cols : [ [ // 表头
{
field: 'studentSn',
title: '学号',
align: "center",
hideField: false,
},
{
field: 'studentName', //数据字典类型为 student.student_name.student_status=1
title: '姓名',
align: "center",
hideField: false,
},
{
field: 'questionScore', //数据字典类型为 school_class.class_name.class_status=1
title: '题干',
align: "center",
hideField: false,
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
field: 'questionType',
title: '题型',
align: "center",
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: 'teacherOpenCourseQuestionLogAnswer', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
title: '我的选项',
align: "center",
hideField: false,
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
field: 'questionAnswer', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
title: '正确答案',
align: "center",
hideField: false,
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
field: 'status',
title: '状态',
align: "center",
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: 'status',
title: '报告下载',
align: "center",
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(),
cellMinWidth: 80,
method: 'post',
even: true,
// skin:'nob',
where:getParam_s(),
size: "sm",
url: Common.ctxPath + '/api/teacherOpenCourseQuestionLog/studentScoreList.do' // 数据接口
, page: Lib.tablePage // 开启分页
, limit: 10,
cols: [[
{
field: 'studentSn',
title: '学号', align: "center",
},
{
field: 'studentName',
title: '姓名', align: "center"
}, {
field: 'sumStudentScore',
title: '得分', align: "center"
}
]]
});
table.on('checkbox(teacherOpenCourseQuestionLogTable)', function (obj) {
var teacherOpenCourseQuestionLog = obj.data;
if(obj.checked){
//按钮逻辑Lib.buttonEnable()
}else{
}
});
//触发行单击事件
table.on('row(studentTable)', function(obj){
var settingId = $("select[name='teacherOpenCourseQuestionSettingId']").val();
var param={
'studentId':obj.data.studentId,
'teacherOpenCourseQuestionSettingId':$.isEmpty(settingId)?questionSettingId:settingId,
};
if(questionSettingType == 'HOMEWORK_FILE'){
url = 'jlw/teacherOpenCourseQuestionLog/homeworkFileLogPageList.json';
param = {"questionSettingIdPlural":questionSettingId};
}
teacherOpenCourseQuestionLogTable.reload({
where: param,
page: {
curr: 1
}
});
});
},
initSearchForm:function(){
//Lib.initSearchForm( $("#searchForm"),teacherOpenCourseQuestionLogTable,form);
//Lib.initSearchForm( $("#studentForm"),studentTable,form);
var btn_s = $("#searchFormSearch");
btn_s.on('click', function () {
var data = $("#searchForm").serializeJson();
data.teacherOpenCourseQuestionSettingId =$.isEmpty(data.teacherOpenCourseQuestionSettingId)?questionSettingId:data.teacherOpenCourseQuestionSettingId
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 = {
/*add: function () {
var url = "/jlw/teacherOpenCourseQuestionLog/add.do";
Common.openDlg(url,"学生签到记录管理>新增");
},
edit: function () {
var data = Common.getOneFromTable(table,"teacherOpenCourseQuestionLogTable");
if(data==null){
return ;
}
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 () {
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable, 1);
view.initToolBar()
},
refresh: function () {
searchForm.reset();
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable, 1);
view.initToolBar()
},
importDocument: function () {
var uploadUrl = Common.ctxPath+"/jlw/teacherOpenCourseQuestionLog/importTemplate.json";
//模板,
var templatePath= Common.ctxPath+"/jlw/teacherOpenCourseQuestionLog/downloadTemplate.json";
//公共的简单上传文件处理
var url = "/core/file/simpleUpload.do?uploadUrl="+uploadUrl+"&templatePath="+templatePath;
Common.openDlg(url, "teacherOpenCourseQuestionLog管理>上传");
},*/
exportDocument: function () {
var url,title;
var settingId = $("select[name='teacherOpenCourseQuestionSettingId']").val();
settingId = $.isEmpty(settingId)?questionSettingId:settingId;
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 = '附件作业详情表';
url = '/jlw/questionLogSummary/homeworkFileAnalysisExport.json?teacherOpenCourseId'+ teacherOpenCourseId + '&questionSettingType=' + questionSettingType;
}else if(questionSettingType == "HOMEWORK_QUESTION"){
title ="题库作业详情表";
url = "/api/teacherOpenCourseQuestionLog/zyDetailExport.do?teacherOpenCourseQuestionSettingId=" + settingId;
}
Common.openConfirm("确认要导出"+title+"?", function (index) {
$.downFile(Common.ctxPath + url);
layer.close(index);
})
},
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(teacherOpenCourseQuestionLogTable)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
//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/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(),
'teacherOpenCourseId': teacherOpenCourseId
};
return param
}
form.render();
view.init();
});
</script>

@ -0,0 +1,454 @@
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/teacherOpenCourseHandsOn/"}){ -->
<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}">
<div class="layui-inline">
<!--#if(questionSettingType=='CHAPTER_EXERCISE'){-->
<label class="layui-form-label">章节名称</label>
<!--#}else if(questionSettingType=='EXAM'){-->
<label class="layui-form-label">考试名称</label>
<!--#}else if(questionSettingType=='HOMEWORK_FILE'){-->
<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;">
<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="teacherOpenCourseQuestionLog.query" class="layui-btn-primary"
action="addButton_cancel"><span class="iconfont">&#xe600;</span>返回</layui:accessButton>
</div>
<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}"/>
<input type="hidden" name="questionSettingId" autocomplete="off" class="layui-input" value="${questionSettingId}"/>
<!--#} -->
<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>
<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 teacherOpenCourseQuestionLogTable = null;
var studentTable = null;
var questionSettingId = $("input[name='questionSettingId']").val();
var teacherOpenCourseId=$("input[name='teacherOpenCourseId']").val();
var questionSettingType = $("input[name='questionSettingType']").val();
laydate.render({
elem: '#test5'
,type: 'datetime'
, trigger: 'click'
});
var data = [];
var url = "/api/teacherOpenCourseQuestionSetting/getList.do?teacherOpenCourseId=" + teacherOpenCourseId + "&teacherOpenCourseQuestionSettingType=" + questionSettingType;
var ret = Common.getAjax(url);
if (ret.code == 0) {
data = ret.data;
}
var getTpl = demo.innerHTML
, view = document.getElementById('view');
laytpl(getTpl).render(data, function(html){
view.innerHTML = html;
});
var view ={
init:function(){
var that = this;
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable);
Lib.doSearchForm($("#searchForm"), studentTable);
that.initToolBar();
}
},
initTable:function(){
var sx_ = localStorage.getItem("teacherOpenCourseQuestionLogTable_field_" + Common.userInfoId); //筛选值显示、隐藏缓存
if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);}
var url = '/api/teacherOpenCourseQuestionLog/list.do?questionLogAddType=FINALLY_SUBMIT';
if(questionSettingType == 'HOMEWORK_FILE'){
url = '/jlw/teacherOpenCourseQuestionLog/homeworkFileLogPageList.json';
}
teacherOpenCourseQuestionLogTable = table.render({
elem: '#teacherOpenCourseQuestionLogTable',
height : Lib.getTableHeight(1),
cellMinWidth: 100,
method : 'post',
url: Common.ctxPath + url // 数据接口
,page : Lib.tablePage // 开启分页
/* ,toolbar: '#toolbar_teacherOpenCourseQuestionLog' //自定义头部左侧工具栏
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏*/
,where:{'teacherOpenCourseQuestionSettingId':questionSettingId}
,limit : 10,
cols : [ [ // 表头
{
field: 'studentSn',
title: '学号',
align: "center",
hideField: false,
},
{
field: 'studentName', //数据字典类型为 student.student_name.student_status=1
title: '姓名',
align: "center",
hideField: false,
},
{
field: 'questionScore', //数据字典类型为 school_class.class_name.class_status=1
title: '题干',
align: "center",
hideField: false,
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
field: 'questionType',
title: '题型',
align: "center",
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: 'teacherOpenCourseQuestionLogAnswer', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
title: '我的选项',
align: "center",
hideField: false,
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
field: 'questionAnswer', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1
title: '正确答案',
align: "center",
hideField: false,
hide: questionSettingType != "HOMEWORK_FILE" ? false : true,
},
{
field: 'status',
title: '状态',
align: "center",
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: 'status',
title: '报告下载',
align: "center",
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(),
cellMinWidth: 80,
method: 'post',
even: true,
// skin:'nob',
where:getParam_s(),
size: "sm",
url: Common.ctxPath + '/api/teacherOpenCourseQuestionLog/studentScoreList.do' // 数据接口
, page: Lib.tablePage // 开启分页
, limit: 10,
cols: [[
{
field: 'studentSn',
title: '学号', align: "center",
},
{
field: 'studentName',
title: '姓名', align: "center"
}, {
field: 'sumStudentScore',
title: '得分', align: "center"
}
]]
});
table.on('checkbox(teacherOpenCourseQuestionLogTable)', function (obj) {
var teacherOpenCourseQuestionLog = obj.data;
if(obj.checked){
//按钮逻辑Lib.buttonEnable()
}else{
}
});
//触发行单击事件
table.on('row(studentTable)', function(obj){
var settingId = $("select[name='teacherOpenCourseQuestionSettingId']").val();
var param={
'studentId':obj.data.studentId,
'teacherOpenCourseQuestionSettingId':$.isEmpty(settingId)?questionSettingId:settingId,
};
if(questionSettingType == 'HOMEWORK_FILE'){
url = 'jlw/teacherOpenCourseQuestionLog/homeworkFileLogPageList.json';
param = {"questionSettingIdPlural":questionSettingId};
}
teacherOpenCourseQuestionLogTable.reload({
where: param,
page: {
curr: 1
}
});
});
},
initSearchForm:function(){
//Lib.initSearchForm( $("#searchForm"),teacherOpenCourseQuestionLogTable,form);
//Lib.initSearchForm( $("#studentForm"),studentTable,form);
var btn_s = $("#searchFormSearch");
btn_s.on('click', function () {
var data = $("#searchForm").serializeJson();
data.teacherOpenCourseQuestionSettingId =$.isEmpty(data.teacherOpenCourseQuestionSettingId)?questionSettingId:data.teacherOpenCourseQuestionSettingId
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 = {
/*add: function () {
var url = "/jlw/teacherOpenCourseQuestionLog/add.do";
Common.openDlg(url,"学生签到记录管理>新增");
},
edit: function () {
var data = Common.getOneFromTable(table,"teacherOpenCourseQuestionLogTable");
if(data==null){
return ;
}
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 () {
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable, 1);
view.initToolBar()
},
refresh: function () {
searchForm.reset();
Lib.doSearchForm($("#searchForm"), teacherOpenCourseQuestionLogTable, 1);
view.initToolBar()
},
importDocument: function () {
var uploadUrl = Common.ctxPath+"/jlw/teacherOpenCourseQuestionLog/importTemplate.json";
//模板,
var templatePath= Common.ctxPath+"/jlw/teacherOpenCourseQuestionLog/downloadTemplate.json";
//公共的简单上传文件处理
var url = "/core/file/simpleUpload.do?uploadUrl="+uploadUrl+"&templatePath="+templatePath;
Common.openDlg(url, "teacherOpenCourseQuestionLog管理>上传");
},*/
exportDocument: function () {
var url,title;
var settingId = $("select[name='teacherOpenCourseQuestionSettingId']").val();
settingId = $.isEmpty(settingId)?questionSettingId:settingId;
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 = '附件作业详情表';
url = '/jlw/questionLogSummary/homeworkFileAnalysisExport.json?teacherOpenCourseId'+ teacherOpenCourseId + '&questionSettingType=' + questionSettingType;
}else if(questionSettingType == "HOMEWORK_QUESTION"){
title ="题库作业详情表";
url = "/api/teacherOpenCourseQuestionLog/zyDetailExport.do?teacherOpenCourseQuestionSettingId=" + settingId;
}
Common.openConfirm("确认要导出"+title+"?", function (index) {
$.downFile(Common.ctxPath + url);
layer.close(index);
})
},
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(teacherOpenCourseQuestionLogTable)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
//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/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(),
'teacherOpenCourseId': teacherOpenCourseId
};
return param
}
form.render();
view.init();
});
</script>
Loading…
Cancel
Save