first commit
This commit is contained in:
747
WebRoot/jsp/exam/daytestpaper.jsp
Normal file
747
WebRoot/jsp/exam/daytestpaper.jsp
Normal file
@ -0,0 +1,747 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
|
||||
.hiddenscroll::-webkit-scrollbar{
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
var addDetailFun = function() {
|
||||
var questitleid=$('#id').val();
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/showExamTitleRangeAdd.do' ,{questitleid:questitleid}, function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#examuserids").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"editForm",hiddenId:"examuserids",textId:"_auditMan",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var typechange = function(){
|
||||
if($("#examtype").val()=="正式考试"){
|
||||
$("#frequency-div").hide();
|
||||
// $("#frequency").attr("value","");
|
||||
}else if($("#examtype").val()=="模拟考试"){
|
||||
$("#frequency-div").show();
|
||||
}
|
||||
}
|
||||
|
||||
//下一题
|
||||
var donext = function() {
|
||||
var quesnum = $("#quesnum");
|
||||
$.post(ext.contextPath + '/exam/examrecord/donext.do', {quesnum:quesnum} , function(data) {
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
//初始化题目
|
||||
var init = function(){
|
||||
var quesnum = $("#quesnum");
|
||||
var examrecordid = $('#examrecordid');
|
||||
// console.log(quesnum);
|
||||
// console.log(examrecordid);
|
||||
$.post(ext.contextPath + '/exam/examrecord/doexamhtml.do', {quesnum:quesnum,examrecordid:examrecordid} , function(data) {
|
||||
$('#examhtml').html(data);
|
||||
});
|
||||
};
|
||||
// 保存用户答案
|
||||
var saveanswer = function(){
|
||||
var quesid = $("#quesid").val();
|
||||
var daytestrecordid = $('#daytestrecordid').val();
|
||||
var questype = $('#questype').val();
|
||||
var useranswer = '';
|
||||
// console.log(questype);
|
||||
if(questype == '填空题'){
|
||||
// console.log("1");
|
||||
useranswer= $('#useranswer').val();
|
||||
// console.log(useranswer);
|
||||
}else{
|
||||
var id_array=new Array();
|
||||
$('input[name="option"]:checked').each(function(){
|
||||
id_array.push($(this).attr('id'));//向数组中添加元素
|
||||
});
|
||||
useranswer=id_array.join(',');//将数组元素连接起来以构建一个字符串
|
||||
// console.log("2"+useranswer);
|
||||
}
|
||||
$.post(ext.contextPath + '/exam/daytestrecord/dosaveanswer.do', {quesid:quesid,useranswer:useranswer,questype:questype} , function(data) {
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
切换上下题
|
||||
*/
|
||||
function doSwitch(switchtype){//switchtype为上一个/下一个的切换类型 quesnum 为当前题序号
|
||||
//切换之前先保存用户答案
|
||||
saveanswer();
|
||||
//隐藏答案区域
|
||||
$("#analysis").hide();
|
||||
//变色
|
||||
// var quescolorid = $('#quesid').val();
|
||||
// console.log("-----"+quescolorid);
|
||||
// $("#"+quescolorid).css({
|
||||
// "border-color":"#568dbd",
|
||||
// "background":"#568dbd",
|
||||
// });
|
||||
// $("#"+quescolorid+"000").css({
|
||||
// 'color':'white',
|
||||
// });
|
||||
var quesallcount = $('#quesallcount').val();
|
||||
var quesnum = $('#quesnum').val();
|
||||
var daytestrecordid = $('#daytestrecordid').val();
|
||||
// console.log(examrecordid);
|
||||
$.post("<%=request.getContextPath()%>/exam/daytestrecord/dodaytesthtml.do",{switchtype:switchtype,quesnum:quesnum,daytestrecordid:daytestrecordid},function(data){
|
||||
if(data==1){
|
||||
swal("没有上一道题了");
|
||||
}else if(data == 2){
|
||||
swal("正在生成答题反馈!");
|
||||
// fullscreen();
|
||||
$(".modal-backdrop").remove();
|
||||
closeModal('subModal');
|
||||
//最后一题,打开题目解析
|
||||
openanalysis(daytestrecordid);
|
||||
}else{
|
||||
var arr= JSON.parse(data);
|
||||
var questitlediv = '<div>'+arr.quesnum+'、'+arr.quesdescript+'</div>';
|
||||
var progress = '当前第'+arr.quesnum+'题,总共'+quesallcount+'题';
|
||||
var questoptiondiv = '';
|
||||
// console.log(arr.rows);
|
||||
if(arr.questype=='填空题'){
|
||||
questoptiondiv += '<div><input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="'+arr.useranswer+'" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
'</div>';
|
||||
}else if(arr.questype=='多选题'){
|
||||
var array = arr.useranswer.split(",");
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
var count = 0;
|
||||
for(var j = 0;j<array.length;j++){
|
||||
count++;
|
||||
if(arr.rows[i].optionid == array[j]){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}else{
|
||||
if(count == array.length){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// console.log("aaa"+i);
|
||||
}
|
||||
}else if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
if(arr.rows[i].optionid == arr.useranswer){
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
}else{
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$('#questitlediv').html(questitlediv);
|
||||
$('#questoptiondiv').html(questoptiondiv);
|
||||
$('#progress').html(progress);
|
||||
$("#quesnum").val(arr.quesnum);
|
||||
$("#quesid").val(arr.quesid);
|
||||
$('#questype').val(arr.questype);
|
||||
$('#leftquesttype').html(arr.questype);
|
||||
$('#analysis').html("答案解析:"+arr.analysis+",本题正确答案为 "+arr.rightanswer);
|
||||
if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
$('#questypenamediv').html(arr.questype+":(只有一个正确答案)");
|
||||
}else if(arr.questype=='多选题'){
|
||||
$('#questypenamediv').html(arr.questype+":(有多个正确答案)");
|
||||
}else if(arr.questype=='填空题'){
|
||||
$('#questypenamediv').html(arr.questype+":(请将答案填写在输入框内并用,隔开)");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
//打开题目解析
|
||||
var openanalysis = function(id) {
|
||||
var daytestrecordid = id;
|
||||
$.post(ext.contextPath + '/exam/daytestrecord/openanalysis.do',{daytestrecordid:daytestrecordid}, function(data) {
|
||||
// console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
function dojumpques(id){
|
||||
var examrecordid = $('#examrecordid').val();
|
||||
var questitleid = id;
|
||||
$.post(ext.contextPath + '/exam/examrecord/dojumpques.do', {examrecordid:examrecordid,questitleid:questitleid} , function(data) {
|
||||
// console.log(data);
|
||||
var arr= JSON.parse(data);
|
||||
var questitlediv = '<div>'+arr.quesnum+'、'+arr.quesdescript+'</div>';
|
||||
var questoptiondiv = '';
|
||||
console.log(arr.rows);
|
||||
if(arr.questype=='填空题'){
|
||||
questoptiondiv += '<div><input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="'+arr.useranswer+'" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
'</div>';
|
||||
}else if(arr.questype=='多选题'){
|
||||
var array = arr.useranswer.split(",");
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
var count = 0;
|
||||
for(var j = 0;j<array.length;j++){
|
||||
count++;
|
||||
if(arr.rows[i].optionid == array[j]){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}else{
|
||||
if(count == array.length){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// console.log("aaa"+i);
|
||||
}
|
||||
}else if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
if(arr.rows[i].optionid == arr.useranswer){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
}else{
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$('#questitlediv').html(questitlediv);
|
||||
$('#questoptiondiv').html(questoptiondiv);
|
||||
$("#quesnum").val(arr.quesnum);
|
||||
$("#quesid").val(arr.quesid);
|
||||
$('#questype').val(arr.questype);
|
||||
$('#leftquesttype').html(arr.questype);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//交卷功能
|
||||
var dosendpaper = function() {
|
||||
//交卷之前先保存用户最后一题答案
|
||||
saveanswer();
|
||||
|
||||
var examrecordid = $("#examrecordid").val();
|
||||
|
||||
swal({
|
||||
title: "您确定要交卷吗?",
|
||||
// text:"这将花费大约几秒的时间",
|
||||
dangerMode: true,
|
||||
icon: "warning",
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
|
||||
$.post(ext.contextPath + '/exam/examrecord/dosendpaper.do', {examrecordid:examrecordid} , function(data) {
|
||||
exitfullscreen();
|
||||
swal("交卷成功!");
|
||||
closeModal('subModal');
|
||||
location.reload();
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//获取当前时间
|
||||
function time() {
|
||||
//获得显示时间的div
|
||||
t_div = document.getElementById('nowtime');
|
||||
var now = new Date()
|
||||
//替换div内容
|
||||
// t_div.innerHTML = "现在是" + now.getFullYear() + "年" + (now.getMonth() + 1) + "月" + now.getDate() + "日" + now.getHours() + "时" + now.getMinutes() + "分" + now.getSeconds() + "秒";
|
||||
var hours = now.getHours();
|
||||
var min = now.getMinutes();
|
||||
var sec = now.getSeconds();
|
||||
if(hours<10){
|
||||
hours = "0"+hours;
|
||||
}
|
||||
if(min<10){
|
||||
min = "0"+min;
|
||||
}
|
||||
if(sec<10){
|
||||
sec = "0"+sec;
|
||||
}
|
||||
t_div.innerHTML = hours + ":" + min + ":" + sec;
|
||||
//等待一秒钟后调用time方法,由于settimeout在time方法内,所以可以无限调用
|
||||
setTimeout(time, 1000);
|
||||
}
|
||||
|
||||
//全屏功能 F11
|
||||
function fullscreen(){
|
||||
//全屏
|
||||
var docElm = document.documentElement;
|
||||
//W3C
|
||||
if(docElm.requestFullscreen) {
|
||||
docElm.requestFullscreen();
|
||||
}
|
||||
|
||||
//FireFox
|
||||
else if(docElm.mozRequestFullScreen) {
|
||||
docElm.mozRequestFullScreen();
|
||||
}
|
||||
|
||||
//Chrome等
|
||||
else if(docElm.webkitRequestFullScreen) {
|
||||
docElm.webkitRequestFullScreen();
|
||||
}
|
||||
|
||||
//IE11
|
||||
else if(elem.msRequestFullscreen) {
|
||||
elem.msRequestFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
//退出全屏
|
||||
function exitfullscreen(){
|
||||
//W3C
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
}
|
||||
//FireFox
|
||||
else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
}
|
||||
//Chrome等
|
||||
else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
}
|
||||
//IE11
|
||||
else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
//题目标记功能
|
||||
function domarkques(){
|
||||
var testpaperid = $('#quesid').val();
|
||||
$.post(ext.contextPath + '/exam/examrecord/domarkques.do', {testpaperid:testpaperid} , function(data) {
|
||||
console.log(data);
|
||||
$("#"+data).css({
|
||||
"border-color":"#E7505A",
|
||||
"background":"#E7505A",
|
||||
});
|
||||
$("#"+data+"000").css({
|
||||
'color':'white',
|
||||
});
|
||||
|
||||
swal("标记成功");
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//题目解析
|
||||
function doanalysis(){
|
||||
$("#analysis").css({
|
||||
display: "block",
|
||||
});
|
||||
}
|
||||
|
||||
function doclose() {
|
||||
swal({
|
||||
title: "您确定要退出吗?",
|
||||
// text:"这将花费大约几秒的时间",
|
||||
dangerMode: true,
|
||||
icon: "warning",
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
|
||||
swal("退出成功!");
|
||||
closeModal('subModal');
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(function () {
|
||||
// $("#status").select2({ minimumResultsForSearch: -1 }).val("${rankType.status}").trigger("change");
|
||||
// init();
|
||||
// time();
|
||||
// fullscreen();
|
||||
// typechange();
|
||||
|
||||
// $("#examtype").change(function(){
|
||||
// typechange();
|
||||
// })
|
||||
|
||||
|
||||
var examPlanId=$('#id').val();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<body class="hold-transition sidebar-mini" >
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<input type="hidden" name="quesnum" id="quesnum" value="${quesnum}" />
|
||||
<input type="hidden" name="quesallcount" id="quesallcount" value="${quesallcount}" />
|
||||
<input type="hidden" name="quesid" id="quesid" value="${quesid}" />
|
||||
<input type="hidden" name="daytestrecordid" id="daytestrecordid" value="${daytestrecordid}" />
|
||||
|
||||
<input type="hidden" name="questype" id="questype" value="${questypename}" />
|
||||
<input type="hidden" name="questitlenum" id="questitlenum" value="${questitlenum}" />
|
||||
<input type="hidden" name="examtime" id="examtime" value="${examtime}" />
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">调查问卷</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body" id="box-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-12 control-label">为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,我们非常重视每位用户的宝贵意见,期待您的参与!现在我们就马上开始吧!</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">开始</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<div class="modal fade hiddenscroll" id="subModal">
|
||||
<!-- <input type="hidden" name="questitleid" id="questitleid" value="${questitleid}"> -->
|
||||
<div>
|
||||
<div class="modal-content" style="width: 82%;margin-left: 10%;height: 88%;margin-top: 3%;">
|
||||
<!-- <div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">考试界面</h4>
|
||||
</div> -->
|
||||
<div class="modal-body">
|
||||
<div style="width: 100%;height: 97%;background-color: #FAFAFA;">
|
||||
<div id="margintopdiv" style="width: 100%;height: 2%;"></div>
|
||||
<div id="out" style="width: 100%;height: 5%;">
|
||||
<div style="width: 90%;height: 100%;float: left;"></div>
|
||||
<div style="width: 8%;height: 100%;float: left;"><img src="<%=request.getContextPath()%>/IMG/main/daytest_out.png" style="width: 100%;height: 100%;cursor: pointer;" onclick="doclose();"></div>
|
||||
<div style="width: 2%;height: 100%;float: left;"></div>
|
||||
</div>
|
||||
|
||||
<div id="topdiv" style="width: 100%;height: 10%;">
|
||||
<div style="width:28%;height: 100%;float: left;"></div>
|
||||
<div id="logo" style="width:13%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 5%;"></div>
|
||||
<div style="width: 100%;height: 90%;">
|
||||
<img src="<%=request.getContextPath()%>/IMG/login/bksw1.png" style="width: 100%;height: 100%;">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="width:0.5%;height:100%;float:left;"></div>
|
||||
<div style="width:0.1%;height:100%;float:left;background-color:#EEEEEE"></div>
|
||||
<div style="width:0.5%;height:100%;float:left;color: white;"></div>
|
||||
<div id="logotitle" style="width:auto;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 34%;color: #2C2C2C;font-weight: 600;font-size: x-large;">
|
||||
北 控 水 务 集 团 有 限 公 司
|
||||
</div>
|
||||
<div style="width: 100%;height: 20%;"></div>
|
||||
<div style="width: 100%;height: 34%;color: #2C2C2C;font-weight: 600;font-size: x-large;">
|
||||
广东业务区技能实训平台应知练习
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:auto;height: 100%;float: left;"></div>
|
||||
|
||||
</div>
|
||||
<div style="width: 100%;height: 4%;"></div>
|
||||
|
||||
<div id="maindiv" style="width: 100%;height: 80%;">
|
||||
<div id="marginleft" style="width: 1%;height:100%;float: left;"></div>
|
||||
<div id="leftmain" style="width:98%;height: 100%;float: left;">
|
||||
<div id="lefttop" style="width: 100%;height:4.5%;color: black;background-color: #FAFAFA;font-weight: 600;font-size: medium;">
|
||||
|
||||
<div style="width: 65%;height: 100%;float: left;">
|
||||
<div id="questypenamediv" style="width: auto;height: 100%;float: left;">
|
||||
<!-- 判断题型 -->
|
||||
<c:if test="${questypename == '单选题'}">
|
||||
单选题:(只有一个正确答案)
|
||||
</c:if>
|
||||
<c:if test="${questypename == '判断题'}">
|
||||
判断题:(只有一个正确答案)
|
||||
</c:if>
|
||||
<c:if test="${questypename == '多选题'}">
|
||||
多选题:(有多个正确答案)
|
||||
</c:if>
|
||||
<c:if test="${questypename == '填空题'}">
|
||||
填空题:(请将答案填写在输入框内并用,隔开)
|
||||
</c:if>
|
||||
</div>
|
||||
<div id="progress" style="width: auto;height: 100%;float: left;">
|
||||
当前第${quesnum}题,总共${quesallcount}题
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 35%;height: 100%;float: left;text-align: right;">
|
||||
练习类别:每日一练
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="leftmid" style="width:100%;height:93.5%;">
|
||||
<!-- <div style="width: 100%;height: 2.5%;"></div> -->
|
||||
<!--竖版-->
|
||||
<!-- <div id="leftques" style="width: 100%;height: 99%;">
|
||||
<div id="questitledivout" style="width: 24%;height: 100%;background-color: white;float: left;">
|
||||
<div style="width: 10%;height: 100%;float: left;"></div>
|
||||
<div style="width: 80%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 6%;"></div>
|
||||
<div id="questitlediv" style="width: 100%;height: 60%;font-size: x-large;"> ${quesnum}、${questitle} </div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div style="width:0.2%;height: 100%;background-color: #EBEBEB;float: left;"></div>
|
||||
<div id="questoptiondivout" style="width: 75.8%;height: 100%;background-color: white;float: left;">
|
||||
<div style="width: 3%;height: 100%;float: left;"></div>
|
||||
<div style="width: 96%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 6%;"></div>
|
||||
<div id="questoptiondiv" style="width: 100%;height: 56%;font-size: x-large;">
|
||||
|
||||
判断填空题
|
||||
<c:if test="${questypename == '填空题'}">
|
||||
<div>
|
||||
<input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '多选题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="checkbox" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '单选题' || questypename == '判断题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="radio" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
</div>
|
||||
<div style="width: 100%;height: 30%;">
|
||||
<div id="analysis" style="width: 100%;height: 100%;font-size: medium;color: #568D8D;display: none;">答案解析:${analysis},本题正确答案为 ${rightanswer}</div>
|
||||
</div>
|
||||
|
||||
<div style="width: 100%;height: 7%;">
|
||||
<div style="width: 75%;height: 100%;float: left;"></div>
|
||||
<div style="width: 11%;height: 100%;float: left;">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/daytest_analysis.png" style="width: 100%;height: 100%;cursor: pointer;" onclick="doanalysis();">
|
||||
</div>
|
||||
<div style="width: 2%;height: 100%;float: left;">
|
||||
|
||||
</div>
|
||||
<div style="width: 9%;height: 100%;float: left;">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/daytest_confirm.png" style="width: 100%;height: 100%;cursor: pointer;" onclick="doSwitch('next')">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div> -->
|
||||
<!--横版-->
|
||||
<div id="leftques" style="width: 100%;height: 99%;background-color: white;">
|
||||
<div style="width: 5%;height: 100%;float: left;"></div>
|
||||
<div style="width: 90%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 5%;"></div>
|
||||
<div id="questitlediv" style="width: 100%;height: auto; min-height:15%;font-size: x-large;border-bottom: 3px solid #EBEBEB;">${quesnum}、${questitle}</div>
|
||||
<div style="width: 100%;height: 5%;"></div>
|
||||
<div id="questoptiondiv" style="width: 100%;height: 45%;font-size: x-large;">
|
||||
<!--判断填空题-->
|
||||
<c:if test="${questypename == '填空题'}">
|
||||
<div>
|
||||
<input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '多选题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="checkbox" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optionx}.${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '单选题' || questypename == '判断题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="radio" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optionx}.${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
<div style="width: 100%;height: 25%;">
|
||||
<div style="width: 70%;height: 100%;float: left;">
|
||||
<div id="analysis" style="width: 100%;height: 100%;font-size: medium;color: #568D8D;display: none;float: left;">答案解析:${analysis},本题正确答案为 ${rightanswer}</div>
|
||||
</div>
|
||||
<div style="width: 30%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 70%;"></div>
|
||||
<div style="width: 100%;height: 30%;">
|
||||
<div style="width: 40%;height: 100%;float: left;"></div>
|
||||
<div style="width: 32%;height: 100%;float: left;">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/daytest_analysis.png" style="width: 100%;height: 100%;cursor: pointer;" onclick="doanalysis();">
|
||||
</div>
|
||||
<div style="width: 2%;height: 100%;float: left;">
|
||||
|
||||
</div>
|
||||
<div style="width: 26%;height: 100%;float: left;">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/daytest_confirm.png" style="width: 100%;height: 100%;cursor: pointer;" onclick="doSwitch('next')">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="marginmid" style="width:1%;height:100%;float:left;"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <div id="examhtml">
|
||||
<div>
|
||||
${quesnum}、${questitlelist.quesdescript}
|
||||
</div>
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="checkbox" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" />
|
||||
${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosendpaper()">交卷</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSwitch('prev')">上一题</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSwitch('next')">下一题</button>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
<script>
|
||||
//倒计时功能
|
||||
// var oBox= document.getElementById('timer');
|
||||
// var maxtime = $("#examtime").val() * 60;
|
||||
// function CountDown() {
|
||||
// if (maxtime >= 0) {
|
||||
// minutes = Math.floor(maxtime / 60);
|
||||
// seconds = Math.floor(maxtime % 60);
|
||||
// if(minutes < 10){
|
||||
// minutes = "0"+minutes;
|
||||
// }
|
||||
// if(seconds < 10){
|
||||
// seconds = "0"+seconds;
|
||||
// }
|
||||
// msg = minutes + ":" + seconds ;
|
||||
// oBox.innerHTML = msg;
|
||||
// if (maxtime == 5 * 60)swal("还剩5分钟!请考生仔细检查试卷");
|
||||
// --maxtime;
|
||||
// } else{
|
||||
// clearInterval(timer);
|
||||
// swal("时间到,考试结束!");
|
||||
// closeModal('subModal');
|
||||
// }
|
||||
// }
|
||||
// timer = setInterval("CountDown()", 1000);
|
||||
|
||||
</script>
|
||||
268
WebRoot/jsp/exam/dodaytest.jsp
Normal file
268
WebRoot/jsp/exam/dodaytest.jsp
Normal file
@ -0,0 +1,268 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
/* .modal{
|
||||
padding-left: 0px !important;
|
||||
} */
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
// $("#subForm").bootstrapValidator('validate');//提交验证
|
||||
// if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/exam/daytestrecord/publishdaytest.do", $("#subForm").serialize(), function(data) {
|
||||
console.log(data);
|
||||
var arr= JSON.parse(JSON.stringify(data));
|
||||
if (arr.res == 1){
|
||||
$(".modal-backdrop").remove();
|
||||
closeModal('subModal');
|
||||
swal("题目准备完毕!");
|
||||
dodaytestpapaer(arr.daytestRecordid);
|
||||
}else if(arr.res == 0){
|
||||
swal("题目准备失败!");
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
// }
|
||||
}
|
||||
|
||||
//打开每日一练
|
||||
var dodaytestpapaer = function(id) {
|
||||
var daytestrecordid = id;
|
||||
$.post(ext.contextPath + '/exam/daytestrecord/daytestpaper.do',{daytestrecordid:daytestrecordid}, function(data) {
|
||||
// console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
function doclose() {
|
||||
closeModal('subModal');
|
||||
}
|
||||
var showSubject4SelectsFun = function() {
|
||||
var userIds= $("#subjecttypeids").val();
|
||||
$.post(ext.contextPath + '/question/subjecttype/subjectForSelect.do', {formId:"subForm2",hiddenId:"subjecttypeids",textId:"subjectName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showRanktype4SelectsFun = function() {
|
||||
var userIds= $("#ranktypeids").val();
|
||||
$.post(ext.contextPath + '/question/ranktype/rankForSelect.do', {formId:"subForm2",hiddenId:"ranktypeids",textId:"rankName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showQuesttype4SelectsFun = function() {
|
||||
var userIds= $("#questtypeids").val();
|
||||
$.post(ext.contextPath + '/question/questtype/questForSelect.do', {formId:"subForm2",hiddenId:"questtypeids",textId:"questName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
function selectnode(){
|
||||
// console.log($('#companytree1').treeview('getChecked'));
|
||||
var arr = $('#companytree1').treeview('getChecked');
|
||||
var ids = "";
|
||||
var texts = "";
|
||||
for(var i=0;i<arr.length;i++){
|
||||
ids+= arr[i].id+",";
|
||||
texts+= arr[i].text+",";
|
||||
}
|
||||
// console.log(ids);
|
||||
$("#cname_input1").val(texts);
|
||||
$("#subjecttypeids").val(ids);
|
||||
document.getElementById('company_select').style.display = "none";
|
||||
$("ul#company_select").hide();
|
||||
}
|
||||
|
||||
function selected(data){
|
||||
if(data.fatherId == undefined){
|
||||
for (var i = 0; i < data.nodes.length; i++) {
|
||||
$("#companytree1").treeview('checkNode', [ data.nodes[i], {silent: true}]);
|
||||
}
|
||||
}else{
|
||||
var parentNode = $('#companytree1').treeview('getParent', data.nodeId);
|
||||
$("#companytree1").treeview('checkNode', [ parentNode, {silent: true}]);
|
||||
}
|
||||
}
|
||||
|
||||
function unSelected(node){
|
||||
if(node.fatherId == undefined){
|
||||
for (var i = 0; i < node.nodes.length; i++) {
|
||||
$("#companytree1").treeview('uncheckNode', [ node.nodes[i], {silent: true}]);
|
||||
}
|
||||
}else{
|
||||
var parentNode = $('#companytree1').treeview('getParent', node.nodeId);
|
||||
var num;
|
||||
for (var i = 0; i < parentNode.nodes.length; i++) {
|
||||
if(parentNode.nodes[i].state.checked == true){
|
||||
num=1;
|
||||
}
|
||||
}
|
||||
if(num!=1){
|
||||
$("#companytree1").treeview('uncheckNode', [ parentNode, {silent: true}]);
|
||||
}
|
||||
console.log(parentNode);
|
||||
}
|
||||
}
|
||||
|
||||
//输入框验证
|
||||
// $("#subForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// project: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '名称不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
$(function () {
|
||||
//树(工作领域)
|
||||
$.post(ext.contextPath + '/question/subjecttype/getSubjecttypeJson.do', { ng: '' }, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid1").val(data[0].id);
|
||||
$("#companyselect1").hide();
|
||||
$("#companyName1").text("公司:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#search_pid1").val(data[0].id);
|
||||
// $("#cname_input1").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree1').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
showCheckbox: true,
|
||||
levels: 1,
|
||||
hierarchicalCheck:true,//级联勾选
|
||||
// onNodeChecked : function(event, data) {
|
||||
// //点击选中
|
||||
// selected(data);
|
||||
// },
|
||||
// onNodeUnchecked : function(event, node){
|
||||
// //点击取消
|
||||
// unSelected(node);
|
||||
// }
|
||||
});
|
||||
// $('#companytree1').on('nodeSelected', function (event, data) {
|
||||
// var nodesnum=0;
|
||||
// if(data.nodes!=null){
|
||||
// nodesnum=data.nodes.length;
|
||||
// }else{
|
||||
// nodesnum=nodesnum;
|
||||
// }
|
||||
|
||||
// if(nodesnum==0){
|
||||
// $("#search_pid1").val(data.id);
|
||||
// $("#cname_input1").val(data.text);
|
||||
// document.getElementById('company_select').style.display = "none";
|
||||
// $("ul#company_select").hide();
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// }
|
||||
|
||||
|
||||
// // $("ul#company_select").hide();
|
||||
// });
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
|
||||
//防止点击树收起下拉框
|
||||
$("#company_select").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
//点击树之外其他区域收起
|
||||
$(document).click(function(){
|
||||
$("#company_select").hide();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">请选择出题范围与出题模式</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<!-- <label class="col-sm-2 control-label">工作领域</label> -->
|
||||
<div class="col-sm-12">
|
||||
<!-- <input type="text" class="form-control" id="subjectName" name ="subjectName" placeholder="点击选择" onclick="showSubject4SelectsFun();" value="${questName}"> -->
|
||||
<input id="subjecttypeids" name="subjecttypeids" type="hidden" value=""/>
|
||||
<input id="search_pid1" name="search_pid1" type="hidden" />
|
||||
<span id="companyName1" style="width:220px;border: none;background: transparent;"></span>
|
||||
<ul class="col-lg-6 col-md-6 col-sm-6 col-xs-6" id="companyselect1" style="list-style-type:none;padding-left:10px;margin-top:8px;width:170px;">
|
||||
<li class="dropdown messages-menu" >
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:80px;"
|
||||
onclick="document.getElementById('company_select').style.display = 'block';">
|
||||
<div class="input-group" style="height: 25px">
|
||||
<span class="input-group-addon" style="height:25px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">问卷类型:</span>
|
||||
<input class="form-control " id="cname_input1" name="cname_input1" style="height:34px;width:472px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
|
||||
readonly />
|
||||
</div>
|
||||
</a>
|
||||
<ul id="company_select" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li>
|
||||
<!-- <a href="javascript:company_selectchange();"> -->
|
||||
<!-- -->
|
||||
<div id="companytree1" style="width: 275px;overflow:auto;">
|
||||
|
||||
</div>
|
||||
<button type="button" class="btn btn-default btn-sm pull-right" onclick="selectnode();">确定</button>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">出题模式</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="type" name="type" class="form-control select2">
|
||||
<option value="普通模式" selected>普通模式</option>
|
||||
<option value="错题模式">错题模式</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="doclose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
332
WebRoot/jsp/exam/examPlanAdd.jsp
Normal file
332
WebRoot/jsp/exam/examPlanAdd.jsp
Normal file
@ -0,0 +1,332 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function saveRankTypeFun() {
|
||||
// console.log($("#addForm").serialize());
|
||||
$('#addForm').data('bootstrapValidator').updateStatus('examnum', 'NOT_VALIDATED', null).validateField('examnum');
|
||||
$('#addForm').data('bootstrapValidator').updateStatus('examminutes', 'NOT_VALIDATED', null).validateField('examminutes');
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/exam/examplan/saveExamPlan.do", $("#addForm").serialize(), function (result) {
|
||||
|
||||
if (result == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (result == 0) {
|
||||
showAlert('d', '用户信息保存失败');
|
||||
} else {
|
||||
showAlert('d', result);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
examname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
examnum: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '允许考试次数不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '允许考试次数必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
// releasetime: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '发布时间不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
startdate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试开始日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
enddate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试结束日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
examminutes: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试时间(分钟)不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '考试时间(分钟)必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
examuserids: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试人员不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#examuserids").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"addForm",hiddenId:"examuserids",textId:"auditMan",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
function gotoDate(){
|
||||
var sdt = $('#startdate').val();
|
||||
var edt = $('#enddate').val();
|
||||
|
||||
if(sdt!=null && sdt!='' && edt!=null && edt!=''){
|
||||
if(edt<sdt){
|
||||
alert('结束时间不能小于开始时间!');
|
||||
$('#enddate').val('');
|
||||
$('#_examminutes').val('');
|
||||
$('#examminutes').val('');
|
||||
}else{
|
||||
var sdttime = new Date(sdt);
|
||||
var endtime = new Date(edt);
|
||||
var span = endtime.getTime() - sdttime.getTime();
|
||||
|
||||
//相差分钟数
|
||||
var leave1 = span % (24 * 3600 * 1000);
|
||||
var hours = Math.floor(leave1 / (60 * 1000))
|
||||
$('#_examminutes').val(hours);//用于显示
|
||||
$('#examminutes').val(hours);//存数据库
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
// $("#computescore").change(function(){
|
||||
// if(this.value=="否"){
|
||||
// $("#passscore-label").hide();
|
||||
// $("#passscore-div").hide();
|
||||
// $("#passscore").val("");
|
||||
// }else if(this.value=="是"){
|
||||
// $("#passscore-label").show();
|
||||
// $("#passscore-div").show();
|
||||
// $("#passscore").val("60");
|
||||
// }
|
||||
// })
|
||||
|
||||
$("#examtype").change(function(){
|
||||
if(this.value=="正式考试"){
|
||||
$("#frequency-div").hide();
|
||||
|
||||
|
||||
// $("#computescore-label").show();
|
||||
// $("#computescore-div").show();
|
||||
$("#computescore").val("是");
|
||||
// $("#passscore-label").show();
|
||||
// $("#passscore-div").show();
|
||||
// $("#passscore").val("60");
|
||||
|
||||
}else if(this.value=="模拟考试"){
|
||||
$("#frequency-div").show();
|
||||
|
||||
|
||||
// $("#computescore-label").hide();
|
||||
// $("#computescore-div").hide();
|
||||
$("#computescore").val("否");
|
||||
// $("#passscore-label").hide();
|
||||
// $("#passscore-div").hide();
|
||||
// $("#passscore").val("");
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
$("#startdate").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "year", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 30,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
$('#addForm')
|
||||
.data('bootstrapValidator')
|
||||
.updateStatus('startdate', 'NOT_VALIDATED', null)
|
||||
.validateField('startdate');
|
||||
gotoDate();
|
||||
});
|
||||
|
||||
|
||||
$("#enddate").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "year", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 30,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
$('#addForm')
|
||||
.data('bootstrapValidator')
|
||||
.updateStatus('enddate', 'NOT_VALIDATED', null)
|
||||
.validateField('enddate');
|
||||
gotoDate();
|
||||
});
|
||||
// $("#startdate").datepicker('setDate',new Date());
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" style="width: 800px">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="id" value="${examPlan.id}" />
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*考试名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="examname" name="examname" placeholder="考试名称" value="${examPlan.examname}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*考试方式</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="exammethod" name="exammethod" class="form-control select2">
|
||||
<option value="应知考试" selected>应知考试</option>
|
||||
<option value="应会考试">应会考试</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*考试类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="examtype" name="examtype" class="form-control select2">
|
||||
<option value="正式考试" selected>正式考试</option>
|
||||
<option value="模拟考试">模拟考试</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*考试开始时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="startdate" name="startdate" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*考试结束时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="enddate" name="enddate" placeholder="请选择"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" id="computescore-label">*是否计分</label>
|
||||
<div class="col-sm-4" id="computescore-div">
|
||||
<select id="computescore" name="computescore" class="form-control select2">
|
||||
<option value="是" selected>是</option>
|
||||
<option value="否">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label" id="passscore-label">*及格分数</label>
|
||||
<div class="col-sm-4" id="passscore-div">
|
||||
<input type="text" class="form-control" id="passscore" name="passscore" placeholder="及格分数" value="60" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*允许考试次数</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="examnum" name="examnum" placeholder="允许考试次数" value="1" style="border-radius:4px">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*考试时长(分钟)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="examminutes" name="examminutes" placeholder="根据时间自动计算" value="" style="border-radius:4px" readonly="true">
|
||||
<input type="hidden" class="form-control" id="_examminutes" name="_examminutes" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="frequency-div" style="display: none;">
|
||||
<label class="col-sm-2 control-label">*考试频率</label>
|
||||
<div class="col-sm-6">
|
||||
<select id="frequency" name="frequency" class="form-control select2">
|
||||
<option value="每天" selected>每天</option>
|
||||
<option value="每周">每周</option>
|
||||
<option value="每月">每月</option>
|
||||
<!-- <option value="一次">一次</option> -->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">考试人员</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="auditMan" name ="auditMan" placeholder="点击选择" onclick="showUser4SelectsFun();" value="${examPlan.memo}"></textarea>
|
||||
<input id="examuserids" name="examuserids" type="hidden" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="memo" name ="memo" placeholder="备注..." value="${examPlan.memo}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="saveRankTypeFun()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
509
WebRoot/jsp/exam/examPlanEdit.jsp
Normal file
509
WebRoot/jsp/exam/examPlanEdit.jsp
Normal file
@ -0,0 +1,509 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-table/jquery.tablednd.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/exam/examplan/updateExamPlan.do", $("#editForm").serialize(), function (result) {
|
||||
if (result == 1) {
|
||||
document.getElementById("subModal").setAttribute("class", "modal hidden fade");
|
||||
$(".modal-backdrop").remove();
|
||||
// closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (result == 0) {
|
||||
showAlert('d', '用户信息保存失败');
|
||||
} else {
|
||||
showAlert('d', result);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
// passscore: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '及格分数不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
examname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
examnum: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '允许考试次数不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '允许考试次数必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
// releasetime: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '发布时间不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
startdate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试开始日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
enddate: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试结束日期不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
examminutes: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试时间(分钟)不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '考试时间(分钟)必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
examuserids: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试人员不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var addDetailFun = function() {
|
||||
var questitleid=$('#id').val();
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/showExamTitleRangeAdd.do' ,{questitleid:questitleid}, function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/showExamTitleRangeEdit.do', {id:id} , function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
$("#subDetailModal").modal("show");
|
||||
});
|
||||
};
|
||||
var deleteDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/deleteExamTitleRange.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function gotoDate(){
|
||||
var sdt = $('#startdate').val();
|
||||
var edt = $('#enddate').val();
|
||||
|
||||
if(sdt!=null && sdt!='' && edt!=null && edt!=''){
|
||||
if(edt<sdt){
|
||||
alert('结束时间不能小于开始时间!');
|
||||
$('#enddate').val('');
|
||||
$('#_examminutes').val('');
|
||||
$('#examminutes').val('');
|
||||
}else{
|
||||
var sdttime = new Date(sdt);
|
||||
var endtime = new Date(edt);
|
||||
var span = endtime.getTime() - sdttime.getTime();
|
||||
|
||||
//相差分钟数
|
||||
var leave1 = span % (24 * 3600 * 1000);
|
||||
var hours = Math.floor(leave1 / (60 * 1000))
|
||||
$('#_examminutes').val(hours);//用于显示
|
||||
$('#examminutes').val(hours);//存数据库
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var deletesDetailFun = function() {
|
||||
var checkedItems = $("#table_Detail").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertDetaildiv');
|
||||
}else{
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/deleteExamTitleRanges.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#examuserids").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"editForm",hiddenId:"examuserids",textId:"_auditMan",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var typechange = function(){
|
||||
if($("#examtype").val()=="正式考试"){
|
||||
$("#frequency-div").hide();
|
||||
|
||||
// $("#computescore-label").show();
|
||||
// $("#computescore-div").show();
|
||||
$("#computescore").val("是");
|
||||
// $("#passscore-label").show();
|
||||
// $("#passscore-div").show();
|
||||
// $("#passscore").val("60");
|
||||
// $("#frequency").attr("value","");
|
||||
}else if($("#examtype").val()=="模拟考试"){
|
||||
$("#frequency-div").show();
|
||||
|
||||
// $("#computescore-label").hide();
|
||||
// $("#computescore-div").hide();
|
||||
$("#computescore").val("否");
|
||||
// $("#passscore-label").hide();
|
||||
// $("#passscore-div").hide();
|
||||
// $("#passscore").val("");
|
||||
}
|
||||
}
|
||||
var scorechange = function(){
|
||||
if($("#computescore").val()=="否"){
|
||||
$("#passscore-label").hide();
|
||||
$("#passscore-div").hide();
|
||||
$("#passscore").val("");
|
||||
}else if($("#computescore").val()=="是"){
|
||||
$("#passscore-label").show();
|
||||
$("#passscore-div").show();
|
||||
}
|
||||
}
|
||||
$(function () {
|
||||
// $("#status").select2({ minimumResultsForSearch: -1 }).val("${rankType.status}").trigger("change");
|
||||
// scorechange();
|
||||
// $("#computescore").change(function(){
|
||||
// scorechange();
|
||||
// })
|
||||
typechange();
|
||||
|
||||
$("#examtype").change(function(){
|
||||
typechange();
|
||||
})
|
||||
|
||||
$("#startdate").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "year", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 30,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
$('#editForm')
|
||||
.data('bootstrapValidator')
|
||||
.updateStatus('startdate', 'NOT_VALIDATED', null)
|
||||
.validateField('startdate');
|
||||
});
|
||||
$("#enddate").datetimepicker({
|
||||
language:'zh-CN',
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
dateFormat: 'yyyy-mm-dd',//日期显示格式
|
||||
timeFormat: 'HH:mm',//时间显示格式
|
||||
startView: "year", //初始化视图是‘年’
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
minuteStep: 30,//分钟间隔1分钟
|
||||
autoclose: true
|
||||
}).on('changeDate', function () {
|
||||
$('#editForm')
|
||||
.data('bootstrapValidator')
|
||||
.updateStatus('enddate', 'NOT_VALIDATED', null)
|
||||
.validateField('enddate');
|
||||
});
|
||||
|
||||
var examPlanId=$('#id').val();
|
||||
$("#table_Detail").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/exam/examTitleRange/getExamTitleRangeList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 5, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
paginationDetailHAlign:' hidden',//去除分页的显示
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
examPlanId: examPlanId
|
||||
}
|
||||
},
|
||||
// sortName: 'ord', // 要排序的字段
|
||||
// sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: '_subjectTypeName', // 返回json数据中的name
|
||||
title: '问卷类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居h中
|
||||
// width: '30%'
|
||||
},{
|
||||
field: '_rankTypeName', // 返回json数据中的name
|
||||
title: '难度等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 110
|
||||
},{
|
||||
field: '_questTypeName', // 返回json数据中的name
|
||||
title: '题型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
// width: '10%'
|
||||
},{
|
||||
field: 'singlyscore', // 返回json数据中的name
|
||||
title: '单题分值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
// width: '10%'
|
||||
},{
|
||||
field: 'titlenum', // 返回json数据中的name
|
||||
title: '抽题数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
// width: '10%'
|
||||
},{
|
||||
field: '_score', // 返回json数据中的name
|
||||
title: '合计(分)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
// width: '10%'
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 90, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editDetailFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteDetailFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
//当拖拽结束后,整个表格的数据
|
||||
onReorderRow: function (newData) {
|
||||
//这里的newData是整个表格数据,数组形式
|
||||
//console.log(newData); 调试用代码
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/dosort.do',
|
||||
{ jsondata: JSON.stringify(newData) },//将整张表数据Post,当然,先序列化成Json
|
||||
function(data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s','排序成功','mainAlertdiv');
|
||||
}else{
|
||||
showAlert('d','数据错误','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" style="width: 800px">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为editForm -->
|
||||
<form class="form-horizontal" id="editForm">
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="id" name="id" value="${examPlan.id}" />
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*考试名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="examname" name="examname" placeholder="考试名称" value="${examPlan.examname}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*考试方式</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="exammethod" name="exammethod" class="form-control select2">
|
||||
<option value="应知考试" <c:if test="${examPlan.exammethod=='应知考试'}">selected</c:if>>应知考试</option>
|
||||
<option value="应会考试" <c:if test="${examPlan.exammethod=='应会考试'}">selected</c:if>>应会考试</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*考试类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="examtype" name="examtype" class="form-control select2">
|
||||
<option value="正式考试" <c:if test="${examPlan.examtype=='正式考试'}">selected</c:if>>正式考试</option>
|
||||
<option value="模拟考试" <c:if test="${examPlan.examtype=='模拟考试'}">selected</c:if>>模拟考试</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*考试开始时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="startdate" name="startdate" placeholder="请选择" value="${examPlan.startdate.substring(0,19)}"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*考试结束时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="enddate" name="enddate" placeholder="请选择" value="${examPlan.enddate.substring(0,19)}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" id="computescore-label">*是否计分</label>
|
||||
<div class="col-sm-4" id="computescore-div">
|
||||
<select id="computescore" name="computescore" class="form-control select2">
|
||||
<option value="是" <c:if test="${examPlan.computescore=='是'}">selected</c:if>>是</option>
|
||||
<option value="否" <c:if test="${examPlan.computescore=='否'}">selected</c:if>>否</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label" id="passscore-label">*及格分数</label>
|
||||
<div class="col-sm-4" id="passscore-div">
|
||||
<input type="text" class="form-control" id="passscore" name="passscore" placeholder="及格分数" value="${examPlan.passscore}" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*允许考试次数</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="examnum" name="examnum" placeholder="允许考试次数" value="${examPlan.examnum}" style="border-radius:4px">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*考试时长(分钟)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="examminutes" name="examminutes" placeholder="根据时间自动计算" value="${examPlan.examminutes}" style="border-radius:4px">
|
||||
<input type="hidden" class="form-control" id="_examminutes" name="_examminutes" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="frequency-div" style="display: none;">
|
||||
<label class="col-sm-2 control-label">*考试频率</label>
|
||||
<div class="col-sm-6">
|
||||
<select id="frequency" name="frequency" class="form-control select2">
|
||||
<option value="每天" <c:if test="${examPlan.frequency=='每天'}">selected</c:if>>每天</option>
|
||||
<option value="每周" <c:if test="${examPlan.frequency=='每周'}">selected</c:if>>每周</option>
|
||||
<option value="每月" <c:if test="${examPlan.frequency=='每月'}">selected</c:if>>每月</option>
|
||||
<!-- <option value="一次">一次</option> -->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">考试人员</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="_auditMan" name ="_auditMan" placeholder="点击选择" onclick="showUser4SelectsFun();">${_auditMan}</textarea>
|
||||
<input id="examuserids" name="examuserids" type="hidden" value="${examPlan.examuserids}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="memo" name ="memo" placeholder="备注...">${examPlan.memo}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="box box-primary" >
|
||||
<div id="mainAlertDetaildiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">抽题范围</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
416
WebRoot/jsp/exam/examPlanList.jsp
Normal file
416
WebRoot/jsp/exam/examPlanList.jsp
Normal file
@ -0,0 +1,416 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<!-- <style type="text/css">
|
||||
.input { padding: 5px; margin: 0; border: 1px solid #beceeb; }
|
||||
.clear { display: none;
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 6px 0 0 -20px;
|
||||
background: url(../IMG/remove-icon-small.png);}
|
||||
|
||||
.input::-ms-clear { display: none; }
|
||||
.input:valid + .clear { display: inline; }
|
||||
|
||||
</style> -->
|
||||
<title>
|
||||
<%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/exam/examplan/showExamPlanAdd.do', {}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/exam/examplan/showExamPlanEdit.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var publishFun = function(id,status){
|
||||
$.post(ext.contextPath + '/exam/examplan/checkpublishstate.do', { id: id }, function (data) {
|
||||
if(data=="0"){
|
||||
swal("请添加抽题范围。");
|
||||
}else if(data=="1"){
|
||||
swal("请添加考试人员。");
|
||||
}else if(data=="2"){
|
||||
swal("请添加题目数量。");
|
||||
}else{
|
||||
if("已发布"==status){
|
||||
swal({
|
||||
title: "该考试记录已发布!",
|
||||
text:"是否再次发布?",
|
||||
dangerMode: true,
|
||||
icon: "warning",
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
swal("考试正在发布", "请稍后……");
|
||||
swal({
|
||||
title: "考试正在发布",
|
||||
text:"请稍后……",
|
||||
closeOnClickOutside: false,
|
||||
});
|
||||
$.post(ext.contextPath + '/exam/examplan/publishExamPlan.do', { id: id }, function (data) {
|
||||
|
||||
if (data == 1) {
|
||||
swal.close();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
swal.close();
|
||||
showAlert('d', '发布失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
swal({
|
||||
title: "您确定要发布此记录?",
|
||||
text:"这将花费大约几秒的时间",
|
||||
dangerMode: true,
|
||||
icon: "warning",
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
swal("考试正在发布", "请稍后……");
|
||||
swal({
|
||||
title: "考试正在发布",
|
||||
text:"请稍后……",
|
||||
closeOnClickOutside: false,
|
||||
});
|
||||
$.post(ext.contextPath + '/exam/examplan/publishExamPlan.do', { id: id }, function (data) {
|
||||
|
||||
if (data == 1) {
|
||||
swal.close();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
swal.close();
|
||||
showAlert('d', '发布失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
var deleteFun = function (id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/exam/examplan/deleteExamPlan.do', { id: id }, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
swal({
|
||||
text: "您确定要删除这些记录吗?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/exam/examplan/deleteExamPlans.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
$table = $("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/exam/examplan/getExamPlanList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order/*,
|
||||
search_name: $('#search_name').val()*/
|
||||
}
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'examname', // 返回json数据中的name
|
||||
title: '考试名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'examtype', // 返回json数据中的name
|
||||
title: '考试类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'passscore', // 返回json数据中的name
|
||||
title: '及格分数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'exammethod', // 返回json数据中的name
|
||||
title: '考试方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'examnum', // 返回json数据中的name
|
||||
title: '允许考试次数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '考试安排状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'startdate', // 返回json数据中的name
|
||||
title: '考试开始日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}, {
|
||||
field: 'enddate', // 返回json数据中的name
|
||||
title: '考试结束日期', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}, {
|
||||
field: 'examminutes', // 返回json数据中的name
|
||||
title: '考试时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
// width: 60, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
str += '<button class="btn btn-default btn-sm" title="发布" onclick="publishFun(\'' + row.id + '\',\''+row.status+'\')"><i class="fa fa-rocket"></i></button>';
|
||||
str += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
str += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button>';
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
var $table;
|
||||
var companyId;
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function () {
|
||||
initFun();
|
||||
// init();
|
||||
//简易公司combotree
|
||||
// $.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
// $('#companySelectTree').html(data);
|
||||
// });
|
||||
|
||||
|
||||
// $('#removea').click(function () {
|
||||
// $('#search_name').val("");
|
||||
// })
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<!-- <section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<li class="active">Here</li>
|
||||
</ol>
|
||||
</section> -->
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
<div>
|
||||
<div class="form-group">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i>
|
||||
新增</button>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="editFun();"><i class="fa fa-edit"></i> 编辑</button> -->
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i>删除</button>
|
||||
<!--<button type="button" class="btn btn-default" onclick="syncFun();"><i class="fa fa-upload"></i> 同步</button> -->
|
||||
</div>
|
||||
|
||||
<div class="form-group pull-right form-inline ">
|
||||
<!-- <div class="form-group has-feedback ">
|
||||
<input type="text" class="form-control " id="search_group" name ="search_group" placeholder="小组" onclick="showUnit4SelectFun();" style="width: 250px;height:30px">
|
||||
<a class="glyphicon glyphicon-remove form-control-feedback btn-sm" id="removea" style="padding-top:6px;pointer-events: auto"></a>
|
||||
</input>
|
||||
</div>
|
||||
<input id="search_pid" class="form-control" name="search_pid" type="hidden" /> -->
|
||||
<!-- <div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
placeholder="姓名">
|
||||
<a class="glyphicon glyphicon-remove form-control-feedback btn-sm" id="removea"
|
||||
style="padding-top:6px;pointer-events: auto"></a>
|
||||
</input>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"
|
||||
onclick="$table.bootstrapTable('refresh');;"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
427
WebRoot/jsp/exam/examRecordTableList.jsp
Normal file
427
WebRoot/jsp/exam/examRecordTableList.jsp
Normal file
@ -0,0 +1,427 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<!-- <style type="text/css">
|
||||
.input { padding: 5px; margin: 0; border: 1px solid #beceeb; }
|
||||
.clear { display: none;
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 6px 0 0 -20px;
|
||||
background: url(../IMG/remove-icon-small.png);}
|
||||
|
||||
.input::-ms-clear { display: none; }
|
||||
.input:valid + .clear { display: inline; }
|
||||
|
||||
</style> -->
|
||||
<title>
|
||||
<%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/AdminLTE/css/AdminLTE.min.css"/>
|
||||
|
||||
<style type="text/css">
|
||||
.liradies {
|
||||
border-top-right-radius: 5px;
|
||||
border-top-left-radius: 5px;
|
||||
border-bottom-right-radius:5px;
|
||||
border-bottom-left-radius:5px;
|
||||
}
|
||||
.nav-tabs-custom>.nav-tabs>li.active{
|
||||
border-top-color:#3c8dbc;
|
||||
}
|
||||
|
||||
/* .nav-tabs>li.active>a:hover{
|
||||
border-top: 2px solid #3c8bdc;
|
||||
} */
|
||||
|
||||
.nav-tabs>li.active{
|
||||
border-top: 2px solid #3c8bdc;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
// var addFun = function () {
|
||||
// $.post(ext.contextPath + '/question/ranktype/showRankTypeAdd.do', {}, function (data) {
|
||||
// $("#subDiv").html(data);
|
||||
// openModal('subModal');
|
||||
// });
|
||||
// };
|
||||
// var editFun = function (id) {
|
||||
// $.post(ext.contextPath + '/question/ranktype/showRankTypeEdit.do', { id: id }, function (data) {
|
||||
// $("#subDiv").html(data);
|
||||
// openModal('subModal');
|
||||
// });
|
||||
// };
|
||||
// var deleteFun = function (id) {
|
||||
// swal({
|
||||
// text: "您确定要删除此记录?",
|
||||
// dangerMode: true,
|
||||
// buttons: {
|
||||
// cancel: {
|
||||
// text: "取消",
|
||||
// value: null,
|
||||
// visible: true,
|
||||
// className: "btn btn-default btn-sm",
|
||||
// closeModal: true,
|
||||
// },
|
||||
// confirm: {
|
||||
// text: "确定",
|
||||
// value: true,
|
||||
// visible: true,
|
||||
// className: "btn btn-danger btn-sm",
|
||||
// closeModal: true
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// .then(function (willDelete) {
|
||||
// if (willDelete) {
|
||||
// $.post(ext.contextPath + '/question/ranktype/deleteRankType.do', { id: id }, function (data) {
|
||||
// if (data == 1) {
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// } else {
|
||||
// showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
// }
|
||||
// });
|
||||
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
swal({
|
||||
text: "您确定要删除这些记录吗?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/question/ranktype/deleteRankTypes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//打开题目解析
|
||||
var openanalysis = function(id,status) {
|
||||
var examrecordid = id;
|
||||
if(status=='未考'){
|
||||
swal("请先完成考试!");
|
||||
}else{
|
||||
$.post(ext.contextPath + '/exam/examrecord/openanalysis.do',{examrecordid:examrecordid}, function(data) {
|
||||
// console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//打开题目解析
|
||||
var opendaytestanalysis = function(id) {
|
||||
var daytestrecordid = id;
|
||||
$.post(ext.contextPath + '/exam/daytestrecord/openanalysis.do',{daytestrecordid:daytestrecordid}, function(data) {
|
||||
// console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
$table = $("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/exam/examrecord/getTableExamPlanList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
// sortName: 'id', // 要排序的字段
|
||||
// sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: '_examname', // 返回json数据中的name
|
||||
title: '考试名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'startdate', // 返回json数据中的name
|
||||
title: '考试时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}, {
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '考试状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'examscore', // 返回json数据中的name
|
||||
title: '考试分数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'passstatus', // 返回json数据中的name
|
||||
title: '合格状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}
|
||||
,
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
// width: 60, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
str += '<button class="btn btn-default btn-sm" title="查看试卷解析" onclick="openanalysis(\'' + row.id + '\',\''+row.status+'\')"><i class="fa fa-eye"></i></button>';
|
||||
// str += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
// str += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button>';
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//每日一练table
|
||||
$table1 = $("#daytesttable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/exam/daytestrecord/getdaytestTableList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
// sortName: 'id', // 要排序的字段
|
||||
// sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '练习模式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'startdate', // 返回json数据中的name
|
||||
title: '练习时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}, {
|
||||
field: 'allcount', // 返回json数据中的name
|
||||
title: '练习结果', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return "正确:"+row.rightcount+"题/总共:"+row.allcount+"题";
|
||||
}
|
||||
}
|
||||
,
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
// width: 60, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
str += '<button class="btn btn-default btn-sm" title="查看试卷解析" onclick="opendaytestanalysis(\'' + row.id + '\')"><i class="fa fa-eye"></i></button>';
|
||||
// str += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
// str += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button>';
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
var $table;
|
||||
var companyId;
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function () {
|
||||
initFun();
|
||||
// init();
|
||||
//简易公司combotree
|
||||
// $.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
// $('#companySelectTree').html(data);
|
||||
// });
|
||||
|
||||
|
||||
// $('#removea').click(function () {
|
||||
// $('#search_name').val("");
|
||||
// })
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<!-- <section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<li class="active">Here</li>
|
||||
</ol>
|
||||
</section> -->
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
|
||||
<!-- 选项卡 -->
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="liradies active">
|
||||
<a class="liradies active" data-toggle="tab" href="#examrecord">考试记录</a>
|
||||
</li>
|
||||
<li class="liradies">
|
||||
<a class="liradies" data-toggle="tab" href="#daytestrecord">每日一练记录</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<!-- 选项卡对应内容 -->
|
||||
<div class="tab-content" style="background-color: white;border-left: 1px solid #ddd;">
|
||||
<div style="width: 100%;height:20px;background-color: white;"></div>
|
||||
<div class="tab-pane active container" id="examrecord" style="width: 100%;"><table id="table"></table></div>
|
||||
<div class="tab-pane container" id="daytestrecord" style="width: 100%;"><table id="daytesttable"></table></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- <div>
|
||||
<div class="form-group">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="user/addUser.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i>
|
||||
新增</button>
|
||||
</security:authorize>
|
||||
<button type="button" class="btn btn-default" onclick="editFun();"><i class="fa fa-edit"></i> 编辑</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i>删除</button>
|
||||
<button type="button" class="btn btn-default" onclick="syncFun();"><i class="fa fa-upload"></i> 同步</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group pull-right form-inline ">
|
||||
<div class="form-group has-feedback ">
|
||||
<input type="text" class="form-control " id="search_group" name ="search_group" placeholder="小组" onclick="showUnit4SelectFun();" style="width: 250px;height:30px">
|
||||
<a class="glyphicon glyphicon-remove form-control-feedback btn-sm" id="removea" style="padding-top:6px;pointer-events: auto"></a>
|
||||
</input>
|
||||
</div>
|
||||
<input id="search_pid" class="form-control" name="search_pid" type="hidden" />
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
placeholder="姓名">
|
||||
<a class="glyphicon glyphicon-remove form-control-feedback btn-sm" id="removea"
|
||||
style="padding-top:6px;pointer-events: auto"></a>
|
||||
</input>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"
|
||||
onclick="$table.bootstrapTable('refresh');;"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div> -->
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
343
WebRoot/jsp/exam/examRecordTableListall.jsp
Normal file
343
WebRoot/jsp/exam/examRecordTableListall.jsp
Normal file
@ -0,0 +1,343 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
// var addFun = function () {
|
||||
// $.post(ext.contextPath + '/question/ranktype/showRankTypeAdd.do', {}, function (data) {
|
||||
// $("#subDiv").html(data);
|
||||
// openModal('subModal');
|
||||
// });
|
||||
// };
|
||||
// var editFun = function (id) {
|
||||
// $.post(ext.contextPath + '/question/ranktype/showRankTypeEdit.do', { id: id }, function (data) {
|
||||
// $("#subDiv").html(data);
|
||||
// openModal('subModal');
|
||||
// });
|
||||
// };
|
||||
// var deleteFun = function (id) {
|
||||
// swal({
|
||||
// text: "您确定要删除此记录?",
|
||||
// dangerMode: true,
|
||||
// buttons: {
|
||||
// cancel: {
|
||||
// text: "取消",
|
||||
// value: null,
|
||||
// visible: true,
|
||||
// className: "btn btn-default btn-sm",
|
||||
// closeModal: true,
|
||||
// },
|
||||
// confirm: {
|
||||
// text: "确定",
|
||||
// value: true,
|
||||
// visible: true,
|
||||
// className: "btn btn-danger btn-sm",
|
||||
// closeModal: true
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// .then(function (willDelete) {
|
||||
// if (willDelete) {
|
||||
// $.post(ext.contextPath + '/question/ranktype/deleteRankType.do', { id: id }, function (data) {
|
||||
// if (data == 1) {
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// } else {
|
||||
// showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
// }
|
||||
// });
|
||||
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
var beginTimeStore = '';
|
||||
var endTimeStore = '';
|
||||
// 起止日期选择
|
||||
function initDate() {
|
||||
|
||||
// 定义locale汉化插件
|
||||
beginTimeStore = $("#startdate").val();
|
||||
endTimeStore = $("#startdate").val();
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime').daterangepicker({
|
||||
"timePicker": false,
|
||||
"timePicker24Hour": false,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
// 汉化按钮部分
|
||||
ranges: {
|
||||
'今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore,
|
||||
endDate: endTimeStore
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore = start.format(this.locale.format);
|
||||
endTimeStore = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
dosearch();
|
||||
console.log(beginTimeStore);
|
||||
console.log(endTimeStore);
|
||||
// console.log("66");
|
||||
});
|
||||
$('#reservationtime').val(beginTimeStore + locale.separator + endTimeStore);
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
swal({
|
||||
text: "您确定要删除这些记录吗?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/question/ranktype/deleteRankTypes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function doback(){
|
||||
window.location.href=ext.contextPath+"/exam/examrecord/showList.do";
|
||||
}
|
||||
|
||||
var initFun = function () {
|
||||
var startdate = $("#startdate").val();
|
||||
var examtype = $("#examtype").val();
|
||||
$table = $("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/exam/examrecord/getTableExamPlanListall.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
startdate: startdate,
|
||||
examtype: examtype,
|
||||
search_pid: companyId,
|
||||
beginTimeStore: beginTimeStore,
|
||||
endTimeStore: endTimeStore
|
||||
|
||||
}
|
||||
},
|
||||
// sortName: 'id', // 要排序的字段
|
||||
// sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: '_examname', // 返回json数据中的name
|
||||
title: '考试名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: '_username', // 返回json数据中的name
|
||||
title: '考生姓名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'startdate', // 返回json数据中的name
|
||||
title: '考试时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}, {
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '考试状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'examscore', // 返回json数据中的name
|
||||
title: '考试分数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
sortable : true
|
||||
}, {
|
||||
field: 'passstatus', // 返回json数据中的name
|
||||
title: '合格状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}
|
||||
// ,
|
||||
// {
|
||||
// title: "操作",
|
||||
// align: 'center',
|
||||
// valign: 'middle',
|
||||
// // width: 60, // 定义列的宽度,单位为像素px
|
||||
// formatter: function (value, row, index) {
|
||||
// var str = '';
|
||||
// str += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
// str += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button>';
|
||||
// str = '<div class="btn-group" >' + str + '</div>';
|
||||
// return str;
|
||||
// /* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
// }
|
||||
// }
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
var $table;
|
||||
var companyId;
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function () {
|
||||
|
||||
|
||||
// init();
|
||||
//简易公司combotree
|
||||
// $.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
// $('#companySelectTree').html(data);
|
||||
// });
|
||||
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
$('#companySelectTree').html(data);
|
||||
});
|
||||
|
||||
|
||||
// $.ajax({
|
||||
// type:"post",
|
||||
// url: ext.contextPath + "/user/showCompanySelectTree.do",
|
||||
// dataType:"json",
|
||||
// async: true,
|
||||
// success:function(data){
|
||||
// alert('123');
|
||||
// $('#companySelectTree').html(data);
|
||||
// },
|
||||
// error:function(jqXHR){
|
||||
// aler("发生错误");
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
initDate();
|
||||
// initFun();
|
||||
$('#removea').click(function () {
|
||||
$('#search_name').val("");
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<input type="hidden" id="startdate" name="startdate" value="${startdate}" >
|
||||
<input type="hidden" id="examtype" name="examtype" value="${examtype}" >
|
||||
|
||||
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="unit4SelectDiv"></div>
|
||||
<div>
|
||||
<div class="form-group">
|
||||
<div style="width: 100%;">
|
||||
<button type="button" class="btn btn-primary" onclick="doback()" style="margin-left: 1%;float: left;">返回</button>
|
||||
<div id="companySelectTree" style="float: left;margin-left: 2%;"></div>
|
||||
<div class="form-inline">
|
||||
<div class="input-group">
|
||||
<label class="form-label">时间范围:</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-clock-o"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="reservationtime" style="width: 195px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group pull-right form-inline ">
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
placeholder="姓名">
|
||||
<a class="glyphicon glyphicon-remove form-control-feedback btn-sm" id="removea"
|
||||
style="padding-top:6px;pointer-events: auto"></a>
|
||||
</input>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"
|
||||
onclick="$table.bootstrapTable('refresh');;"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
261
WebRoot/jsp/exam/examTitleRangeAdd.jsp
Normal file
261
WebRoot/jsp/exam/examTitleRangeAdd.jsp
Normal file
@ -0,0 +1,261 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
/* .modal{
|
||||
padding-left: 0px !important;
|
||||
} */
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
// $("#subForm").bootstrapValidator('validate');//提交验证
|
||||
// if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/exam/examTitleRange/saveExamTitleRange.do", $("#subForm2").serialize(), function(data) {
|
||||
if (data == 1){
|
||||
$(".modal-backdrop").remove();
|
||||
closeModal('subDetailModal');
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
// }
|
||||
}
|
||||
|
||||
function doclose() {
|
||||
closeModal('subDetailModal');
|
||||
}
|
||||
var showSubject4SelectsFun = function() {
|
||||
var userIds= $("#subjecttypeids").val();
|
||||
$.post(ext.contextPath + '/question/subjecttype/subjectForSelect.do', {formId:"subForm2",hiddenId:"subjecttypeids",textId:"subjectName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showRanktype4SelectsFun = function() {
|
||||
var userIds= $("#ranktypeids").val();
|
||||
$.post(ext.contextPath + '/question/ranktype/rankForSelect.do', {formId:"subForm2",hiddenId:"ranktypeids",textId:"rankName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showQuesttype4SelectsFun = function() {
|
||||
var userIds= $("#questtypeids").val();
|
||||
$.post(ext.contextPath + '/question/questtype/questForSelect.do', {formId:"subForm2",hiddenId:"questtypeids",textId:"questName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
function selectnode(){
|
||||
// console.log($('#companytree1').treeview('getChecked'));
|
||||
var arr = $('#companytree1').treeview('getChecked');
|
||||
var ids = "";
|
||||
var texts = "";
|
||||
for(var i=0;i<arr.length;i++){
|
||||
ids+= arr[i].id+",";
|
||||
texts+= arr[i].text+",";
|
||||
}
|
||||
// console.log(ids);
|
||||
$("#cname_input1").val(texts);
|
||||
$("#subjecttypeids").val(ids);
|
||||
document.getElementById('company_select').style.display = "none";
|
||||
$("ul#company_select").hide();
|
||||
}
|
||||
|
||||
function selected(data){
|
||||
if(data.fatherId == undefined){
|
||||
for (var i = 0; i < data.nodes.length; i++) {
|
||||
$("#companytree1").treeview('checkNode', [ data.nodes[i], {silent: true}]);
|
||||
}
|
||||
}else{
|
||||
var parentNode = $('#companytree1').treeview('getParent', data.nodeId);
|
||||
$("#companytree1").treeview('checkNode', [ parentNode, {silent: true}]);
|
||||
}
|
||||
}
|
||||
|
||||
function unSelected(node){
|
||||
if(node.fatherId == undefined){
|
||||
for (var i = 0; i < node.nodes.length; i++) {
|
||||
$("#companytree1").treeview('uncheckNode', [ node.nodes[i], {silent: true}]);
|
||||
}
|
||||
}else{
|
||||
var parentNode = $('#companytree1').treeview('getParent', node.nodeId);
|
||||
var num;
|
||||
for (var i = 0; i < parentNode.nodes.length; i++) {
|
||||
if(parentNode.nodes[i].state.checked == true){
|
||||
num=1;
|
||||
}
|
||||
}
|
||||
if(num!=1){
|
||||
$("#companytree1").treeview('uncheckNode', [ parentNode, {silent: true}]);
|
||||
}
|
||||
console.log(parentNode);
|
||||
}
|
||||
}
|
||||
|
||||
//输入框验证
|
||||
// $("#subForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// project: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '名称不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
$(function () {
|
||||
//树(工作领域)
|
||||
$.post(ext.contextPath + '/question/subjecttype/getSubjecttypeJson.do', { ng: '' }, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid1").val(data[0].id);
|
||||
$("#companyselect1").hide();
|
||||
$("#companyName1").text("公司:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#search_pid1").val(data[0].id);
|
||||
// $("#cname_input1").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree1').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
showCheckbox: true,
|
||||
levels: 1,
|
||||
hierarchicalCheck:true,//级联勾选
|
||||
// onNodeChecked : function(event, data) {
|
||||
// //点击选中
|
||||
// selected(data);
|
||||
// },
|
||||
// onNodeUnchecked : function(event, node){
|
||||
// //点击取消
|
||||
// unSelected(node);
|
||||
// }
|
||||
});
|
||||
// $('#companytree1').on('nodeSelected', function (event, data) {
|
||||
// var nodesnum=0;
|
||||
// if(data.nodes!=null){
|
||||
// nodesnum=data.nodes.length;
|
||||
// }else{
|
||||
// nodesnum=nodesnum;
|
||||
// }
|
||||
|
||||
// if(nodesnum==0){
|
||||
// $("#search_pid1").val(data.id);
|
||||
// $("#cname_input1").val(data.text);
|
||||
// document.getElementById('company_select').style.display = "none";
|
||||
// $("ul#company_select").hide();
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// }
|
||||
|
||||
|
||||
// // $("ul#company_select").hide();
|
||||
// });
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
|
||||
//防止点击树收起下拉框
|
||||
$("#company_select").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
//点击树之外其他区域收起
|
||||
$(document).click(function(){
|
||||
$("#company_select").hide();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subDetailModal" style="width: 800px;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm2">
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="pid" name="pid" value ="${questitleid}">
|
||||
<div class="form-group">
|
||||
<!-- <label class="col-sm-2 control-label">工作领域</label> -->
|
||||
<div class="col-sm-12">
|
||||
<!-- <input type="text" class="form-control" id="subjectName" name ="subjectName" placeholder="点击选择" onclick="showSubject4SelectsFun();" value="${questName}"> -->
|
||||
<input id="subjecttypeids" name="subjecttypeids" type="hidden" value=""/>
|
||||
<input id="search_pid1" name="search_pid1" type="hidden" />
|
||||
<span id="companyName1" style="width:220px;border: none;background: transparent;"></span>
|
||||
<ul class="col-lg-6 col-md-6 col-sm-6 col-xs-6" id="companyselect1" style="list-style-type:none;padding-left:10px;margin-top:8px;width:170px;">
|
||||
<li class="dropdown messages-menu" >
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:80px;"
|
||||
onclick="document.getElementById('company_select').style.display = 'block';">
|
||||
<div class="input-group" style="height: 25px">
|
||||
<span class="input-group-addon" style="height:25px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">问卷类型:</span>
|
||||
<input class="form-control " id="cname_input1" name="cname_input1" style="height:34px;width:472px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
|
||||
readonly />
|
||||
</div>
|
||||
</a>
|
||||
<ul id="company_select" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li>
|
||||
<!-- <a href="javascript:company_selectchange();"> -->
|
||||
<!-- -->
|
||||
<div id="companytree1" style="width: 275px;overflow:auto;">
|
||||
|
||||
</div>
|
||||
<button type="button" class="btn btn-default btn-sm pull-right" onclick="selectnode();">确定</button>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">难度等级</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="rankName" name ="rankName" placeholder="点击选择" onclick="showRanktype4SelectsFun();" value="${questName}">
|
||||
<input id="ranktypeids" name="ranktypeids" type="hidden"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">考试题型</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="questName" name ="questName" placeholder="点击选择" onclick="showQuesttype4SelectsFun();" value="${questName}">
|
||||
<input id="questtypeids" name="questtypeids" type="hidden"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="doclose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
123
WebRoot/jsp/exam/examTitleRangeEdit.jsp
Normal file
123
WebRoot/jsp/exam/examTitleRangeEdit.jsp
Normal file
@ -0,0 +1,123 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
/* .modal{
|
||||
padding-left: 0px !important;
|
||||
}*/
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
// $("#subForm2").bootstrapValidator('validate');//提交验证
|
||||
// if ($("#subForm2").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/exam/examTitleRange/updateExamTitleRange.do", $("#subForm2").serialize(), function(data) {
|
||||
if (data == 1){
|
||||
$(".modal-backdrop").remove();
|
||||
closeModal('subDetailModal');
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data);
|
||||
}
|
||||
},'json');
|
||||
// }
|
||||
}
|
||||
// //输入框验证
|
||||
// $("#subForm2").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// project: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '名称不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
|
||||
function doclose() {
|
||||
closeModal('subDetailModal');
|
||||
}
|
||||
$(function () {
|
||||
$("#subDetailModal").modal("show");
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subDetailModal" style="width: 800px">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm2">
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
|
||||
<input type="hidden" id="id" name="id" value ="${examTitleRange.id}">
|
||||
<!-- <input type="hidden" id="pid" name="pid" value ="${examTitleRange.pid}"> -->
|
||||
<input id="subjecttypeids" name="subjecttypeids" type="hidden"" value ="${examTitleRange.subjecttypeids}"/>
|
||||
<input id="ranktypeids" name="ranktypeids" type="hidden" value ="${examTitleRange.ranktypeids}"/>
|
||||
<input id="questtypeid" name="questtypeid" type="hidden" value ="${examTitleRange.questtypeid}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">问卷类型</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="_subjectTypeName" name="_subjectTypeName" class="form-control pull-right" placeholder="问卷类型" value ="${examTitleRange._subjectTypeName}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">难度类型</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="_rankTypeName" name="_rankTypeName" class="form-control pull-right" placeholder="难度类型" value ="${examTitleRange._rankTypeName}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">题型</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="_questTypeName" name="_questTypeName" class="form-control pull-right" placeholder="题型" value ="${examTitleRange._questTypeName}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">单题分值</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="singlyscore" name="singlyscore" class="form-control pull-right" placeholder="单题分值" value ="${examTitleRange.singlyscore}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">抽题数量</label>
|
||||
<div class="col-sm-4">
|
||||
<c:if test="${num == 0}">
|
||||
<input type="text" id="titlenum" name="titlenum" class="form-control pull-right" placeholder="可抽题目数:${num},请删除" value ="${examTitleRange.titlenum}" readonly>
|
||||
</c:if>
|
||||
<c:if test="${num != 0}">
|
||||
<input type="text" id="titlenum" name="titlenum" class="form-control pull-right" placeholder="可抽题目数量:${num}" value ="${examTitleRange.titlenum}">
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="doclose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
804
WebRoot/jsp/exam/exampaper.jsp
Normal file
804
WebRoot/jsp/exam/exampaper.jsp
Normal file
@ -0,0 +1,804 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
|
||||
.hiddenscroll::-webkit-scrollbar{
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$("#editForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/exam/examplan/updateExamPlan.do", $("#editForm").serialize(), function (result) {
|
||||
if (result == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (result == 0) {
|
||||
showAlert('d', '用户信息保存失败');
|
||||
} else {
|
||||
showAlert('d', result);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#editForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
passscore: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '及格分数不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
examnum: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '允许考试次数不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '允许考试次数必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
// releasetime: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '发布时间不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// startdate: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '考试开始日期不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// enddate: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '考试结束日期不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
examminutes: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试时间(分钟)不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '考试时间(分钟)必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
examuserids: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考试人员不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var addDetailFun = function() {
|
||||
var questitleid=$('#id').val();
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/showExamTitleRangeAdd.do' ,{questitleid:questitleid}, function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/showExamTitleRangeEdit.do', {id:id} , function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
var deleteDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/deleteExamTitleRange.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var deletesDetailFun = function() {
|
||||
var checkedItems = $("#table_Detail").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertDetaildiv');
|
||||
}else{
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/deleteExamTitleRanges.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#examuserids").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"editForm",hiddenId:"examuserids",textId:"_auditMan",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var typechange = function(){
|
||||
if($("#examtype").val()=="正式考试"){
|
||||
$("#frequency-div").hide();
|
||||
// $("#frequency").attr("value","");
|
||||
}else if($("#examtype").val()=="模拟考试"){
|
||||
$("#frequency-div").show();
|
||||
}
|
||||
}
|
||||
|
||||
//下一题
|
||||
var donext = function() {
|
||||
var quesnum = $("#quesnum");
|
||||
$.post(ext.contextPath + '/exam/examrecord/donext.do', {quesnum:quesnum} , function(data) {
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
//初始化题目
|
||||
var init = function(){
|
||||
var quesnum = $("#quesnum");
|
||||
var examrecordid = $('#examrecordid');
|
||||
// console.log(quesnum);
|
||||
// console.log(examrecordid);
|
||||
$.post(ext.contextPath + '/exam/examrecord/doexamhtml.do', {quesnum:quesnum,examrecordid:examrecordid} , function(data) {
|
||||
$('#examhtml').html(data);
|
||||
});
|
||||
};
|
||||
// 保存用户答案
|
||||
var saveanswer = function(){
|
||||
var quesid = $("#quesid").val();
|
||||
var examrecordid = $('#examrecordid').val();
|
||||
var questype = $('#questype').val();
|
||||
var useranswer = '';
|
||||
// console.log(questype);
|
||||
if(questype == '填空题'){
|
||||
// console.log("1");
|
||||
useranswer= $('#useranswer').val();
|
||||
// console.log(useranswer);
|
||||
}else{
|
||||
var id_array=new Array();
|
||||
$('input[name="option"]:checked').each(function(){
|
||||
id_array.push($(this).attr('id'));//向数组中添加元素
|
||||
});
|
||||
useranswer=id_array.join(',');//将数组元素连接起来以构建一个字符串
|
||||
// console.log("2"+useranswer);
|
||||
}
|
||||
$.post(ext.contextPath + '/exam/examrecord/dosaveanswer.do', {quesid:quesid,useranswer:useranswer,questype:questype} , function(data) {
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
切换上下题
|
||||
*/
|
||||
function doSwitch(switchtype){//switchtype为上一个/下一个的切换类型 quesnum 为当前题序号
|
||||
//切换之前先保存用户答案
|
||||
saveanswer();
|
||||
//变色
|
||||
var quescolorid = $('#quesid').val();
|
||||
console.log("-----"+quescolorid);
|
||||
$("#"+quescolorid).css({
|
||||
"border-color":"#568dbd",
|
||||
"background":"#568dbd",
|
||||
});
|
||||
$("#"+quescolorid+"000").css({
|
||||
'color':'white',
|
||||
});
|
||||
|
||||
var quesnum = $('#quesnum').val();
|
||||
var examrecordid = $('#examrecordid').val();
|
||||
// console.log(examrecordid);
|
||||
$.post("<%=request.getContextPath()%>/exam/examrecord/doexamhtml.do",{switchtype:switchtype,quesnum:quesnum,examrecordid:examrecordid},function(data){
|
||||
if(data==1){
|
||||
swal("没有上一道题了");
|
||||
}else if(data == 2){
|
||||
swal("没有下一道题了");
|
||||
// fullscreen();
|
||||
}else{
|
||||
var arr= JSON.parse(data);
|
||||
var questitlediv = '<div>'+arr.quesnum+'、'+arr.quesdescript+'</div>';
|
||||
var questoptiondiv = '';
|
||||
// console.log(arr.rows);
|
||||
if(arr.questype=='填空题'){
|
||||
questoptiondiv += '<div><input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="'+arr.useranswer+'" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
'</div>';
|
||||
}else if(arr.questype=='多选题'){
|
||||
var array = arr.useranswer.split(",");
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
var count = 0;
|
||||
for(var j = 0;j<array.length;j++){
|
||||
count++;
|
||||
if(arr.rows[i].optionid == array[j]){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}else{
|
||||
if(count == array.length){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// console.log("aaa"+i);
|
||||
}
|
||||
}else if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
if(arr.rows[i].optionid == arr.useranswer){
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
}else{
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$('#questitlediv').html(questitlediv);
|
||||
$('#questoptiondiv').html(questoptiondiv);
|
||||
$("#quesnum").val(arr.quesnum);
|
||||
$("#quesid").val(arr.quesid);
|
||||
$('#questype').val(arr.questype);
|
||||
if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,只有一个正确答案)");
|
||||
}else if(arr.questype=='多选题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,有多个正确答案)");
|
||||
}else if(arr.questype=='填空题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,请将答案填写在输入框内并用,隔开)");
|
||||
}
|
||||
// $('#leftquesttype').html(arr.questype);
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
function dojumpques(id){
|
||||
var examrecordid = $('#examrecordid').val();
|
||||
var questitleid = id;
|
||||
$.post(ext.contextPath + '/exam/examrecord/dojumpques.do', {examrecordid:examrecordid,questitleid:questitleid} , function(data) {
|
||||
// console.log(data);
|
||||
var arr= JSON.parse(data);
|
||||
var questitlediv = '<div>'+arr.quesnum+'、'+arr.quesdescript+'</div>';
|
||||
var questoptiondiv = '';
|
||||
console.log(arr.rows);
|
||||
if(arr.questype=='填空题'){
|
||||
questoptiondiv += '<div><input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="'+arr.useranswer+'" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
'</div>';
|
||||
}else if(arr.questype=='多选题'){
|
||||
var array = arr.useranswer.split(",");
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
var count = 0;
|
||||
for(var j = 0;j<array.length;j++){
|
||||
count++;
|
||||
if(arr.rows[i].optionid == array[j]){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}else{
|
||||
if(count == array.length){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// console.log("aaa"+i);
|
||||
}
|
||||
}else if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
if(arr.rows[i].optionid == arr.useranswer){
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
}else{
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+'.'+arr.rows[i].optioncontent+'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$('#questitlediv').html(questitlediv);
|
||||
$('#questoptiondiv').html(questoptiondiv);
|
||||
$("#quesnum").val(arr.quesnum);
|
||||
$("#quesid").val(arr.quesid);
|
||||
$('#questype').val(arr.questype);
|
||||
if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,只有一个正确答案)");
|
||||
}else if(arr.questype=='多选题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,有多个正确答案)");
|
||||
}else if(arr.questype=='填空题'){
|
||||
$('#leftquesttype').html(arr.questype+":(每题"+arr.singlyscore+"分,请将答案填写在输入框内并用,隔开)");
|
||||
}
|
||||
// $('#leftquesttype').html(arr.questype);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//交卷功能
|
||||
var dosendpaper = function() {
|
||||
//交卷之前先保存用户最后一题答案
|
||||
saveanswer();
|
||||
|
||||
var examrecordid = $("#examrecordid").val();
|
||||
|
||||
swal({
|
||||
title: "您确定要交卷吗?",
|
||||
// text:"这将花费大约几秒的时间",
|
||||
dangerMode: true,
|
||||
icon: "warning",
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
|
||||
$.post(ext.contextPath + '/exam/examrecord/dosendpaper.do', {examrecordid:examrecordid} , function(data) {
|
||||
exitfullscreen();
|
||||
swal("交卷成功!");
|
||||
closeModal('subModal');
|
||||
location.reload();
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//获取当前时间
|
||||
function time() {
|
||||
//获得显示时间的div
|
||||
t_div = document.getElementById('nowtime');
|
||||
var now = new Date()
|
||||
//替换div内容
|
||||
// t_div.innerHTML = "现在是" + now.getFullYear() + "年" + (now.getMonth() + 1) + "月" + now.getDate() + "日" + now.getHours() + "时" + now.getMinutes() + "分" + now.getSeconds() + "秒";
|
||||
var hours = now.getHours();
|
||||
var min = now.getMinutes();
|
||||
var sec = now.getSeconds();
|
||||
if(hours<10){
|
||||
hours = "0"+hours;
|
||||
}
|
||||
if(min<10){
|
||||
min = "0"+min;
|
||||
}
|
||||
if(sec<10){
|
||||
sec = "0"+sec;
|
||||
}
|
||||
t_div.innerHTML = hours + ":" + min + ":" + sec;
|
||||
//等待一秒钟后调用time方法,由于settimeout在time方法内,所以可以无限调用
|
||||
setTimeout(time, 1000);
|
||||
}
|
||||
|
||||
//全屏功能 F11
|
||||
function fullscreen(){
|
||||
//全屏
|
||||
var docElm = document.documentElement;
|
||||
//W3C
|
||||
if(docElm.requestFullscreen) {
|
||||
docElm.requestFullscreen();
|
||||
}
|
||||
|
||||
//FireFox
|
||||
else if(docElm.mozRequestFullScreen) {
|
||||
docElm.mozRequestFullScreen();
|
||||
}
|
||||
|
||||
//Chrome等
|
||||
else if(docElm.webkitRequestFullScreen) {
|
||||
docElm.webkitRequestFullScreen();
|
||||
}
|
||||
|
||||
//IE11
|
||||
else if(elem.msRequestFullscreen) {
|
||||
elem.msRequestFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
//退出全屏
|
||||
function exitfullscreen(){
|
||||
//W3C
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
}
|
||||
//FireFox
|
||||
else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
}
|
||||
//Chrome等
|
||||
else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
}
|
||||
//IE11
|
||||
else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
//题目标记功能
|
||||
function domarkques(){
|
||||
var testpaperid = $('#quesid').val();
|
||||
$.post(ext.contextPath + '/exam/examrecord/domarkques.do', {testpaperid:testpaperid} , function(data) {
|
||||
console.log(data);
|
||||
$("#"+data).css({
|
||||
"border-color":"#E7505A",
|
||||
"background":"#E7505A",
|
||||
});
|
||||
$("#"+data+"000").css({
|
||||
'color':'white',
|
||||
});
|
||||
|
||||
swal("标记成功");
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(function () {
|
||||
// $("#status").select2({ minimumResultsForSearch: -1 }).val("${rankType.status}").trigger("change");
|
||||
// init();
|
||||
time();
|
||||
fullscreen();
|
||||
typechange();
|
||||
|
||||
$("#examtype").change(function(){
|
||||
typechange();
|
||||
})
|
||||
|
||||
$("#startdate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
$("#enddate").datepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format:'yyyy-mm-dd',
|
||||
})
|
||||
|
||||
var examPlanId=$('#id').val();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="modal fade hiddenscroll" id="subModal">
|
||||
<input type="hidden" name="quesnum" id="quesnum" value="${quesnum}" />
|
||||
<input type="hidden" name="quesid" id="quesid" value="${quesid}" />
|
||||
<input type="hidden" name="questype" id="questype" value="${questype}" />
|
||||
<input type="hidden" name="questitlenum" id="questitlenum" value="${questitlenum}" />
|
||||
<input type="hidden" name="examrecordid" id="examrecordid" value="${examrecordid}" />
|
||||
<input type="hidden" name="examtime" id="examtime" value="${examtime}" />
|
||||
<!-- <input type="hidden" name="questitleid" id="questitleid" value="${questitleid}"> -->
|
||||
<div>
|
||||
<div class="modal-content">
|
||||
<!-- <div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">考试界面</h4>
|
||||
</div> -->
|
||||
<div class="modal-body">
|
||||
<div style="width: 100%;height: 100%;background-color: #568DBD;">
|
||||
<div id="margintopdiv" style="width: 100%;height: 2%;"></div>
|
||||
|
||||
<div id="topdiv" style="width: 100%;height: 10%;">
|
||||
<div style="width:15%;height: 100%;float: left;"></div>
|
||||
<div id="logo" style="width:13%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height:10%;"></div>
|
||||
<div style="width: 100%;height: 80%;">
|
||||
<img src="<%=request.getContextPath()%>/IMG/login/bksw1.png" style="width: 100%;height: 100%;">
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:0.5%;height:100%;float:left;"></div>
|
||||
<div style="width:0.1%;height:100%;float:left;background-color:#EEEEEE"></div>
|
||||
<div style="width:0.5%;height:100%;float:left;color: white;"></div>
|
||||
<div id="logotitle" style="width:28%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 34%;color: white;font-weight: 600;font-size: x-large;">
|
||||
北 控 水 务 集 团 有 限 公 司
|
||||
</div>
|
||||
<div style="width: 100%;height: 32%;"></div>
|
||||
<div style="width: 100%;height: 34%;color: white;font-weight: 600;font-size: x-large;">
|
||||
广东业务区技能实训平台应知考试
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 26%;height: 100%;float: left;"></div>
|
||||
<div style="width: 15%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 35%;color: white;font-weight: 900;font-size: medium;">
|
||||
考生编号 : ${examusernumber}
|
||||
</div>
|
||||
<div style="width: 100%;height: 50%;color: white;font-weight: 900;font-size: medium;">
|
||||
考生姓名 : ${examusername}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="maindiv" style="width: 100%;height: 90%;">
|
||||
<div id="marginleft" style="width: 2%;height:100%;float: left;"></div>
|
||||
<div id="leftmain" style="width:78%;height: 100%;float: left;">
|
||||
<div id="lefttop" style="width: 100%;height:2.5%;text-align: right;color: blanchedalmond;">
|
||||
考试类别:${examtype}
|
||||
</div>
|
||||
|
||||
<div id="leftmid" style="width:100%;height:90.5%;">
|
||||
<!-- <div style="width: 100%;height: 2.5%;"></div> -->
|
||||
<div id="lefttitle" style="width: 100%;height: 5%;background-color: white;color: #568DBD;text-align: center;font-weight: 600;font-size: x-large;">${examname}</div>
|
||||
|
||||
<div id="leftquesttype" style="width: 100%;height: 3%;background-color:#EBEBEB;color: black;text-align: left;font-weight: 600;">
|
||||
<c:if test="${questype == '判断题'}">
|
||||
${questype}:(每题${singlyscore}分,只有一个正确答案)
|
||||
</c:if>
|
||||
<c:if test="${questype == '单选题'}">
|
||||
${questype}:(每题${singlyscore}分,只有一个正确答案)
|
||||
</c:if>
|
||||
<c:if test="${questype == '多选题'}">
|
||||
${questype}:(每题${singlyscore}分,有多个正确答案)
|
||||
</c:if>
|
||||
<c:if test="${questype == '填空题'}">
|
||||
${questype}:(每题${singlyscore}分,请将答案填写在输入框内并用,隔开)
|
||||
</c:if>
|
||||
|
||||
</div>
|
||||
<!--竖版-->
|
||||
<!-- <div id="leftques" style="width: 100%;height: 92.5%;">
|
||||
<div id="questitledivout" style="width: 24%;height: 100%;background-color: white;float: left;">
|
||||
<div style="width: 10%;height: 100%;float: left;"></div>
|
||||
<div style="width: 80%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 20%;"></div>
|
||||
<div id="questitlediv" style="width: 100%;height: 60%;font-size: x-large;"> ${quesnum}、${questitlelist.quesdescript} </div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="width:1%;height: 100%;background-color: #EBEBEB;float: left;"></div>
|
||||
<div id="questoptiondivout" style="width: 75%;height: 100%;background-color: white;float: left;">
|
||||
<div style="width: 10%;height: 100%;float: left;"></div>
|
||||
<div style="width: 80%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 20%;"></div>
|
||||
<div id="questoptiondiv" style="width: 100%;height: 60%;font-size: x-large;">
|
||||
判断填空题
|
||||
<c:if test="${questypename == '填空题'}">
|
||||
<div>
|
||||
<input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '多选题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="checkbox" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '单选题' || questypename == '判断题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="radio" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!--横版-->
|
||||
<div id="leftques" style="width: 100%;height: 92.5%;background-color: white;">
|
||||
<div style="width: 10%;height: 100%;float: left;"></div>
|
||||
<div style="width: 80%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 10%;"></div>
|
||||
<div id="questitlediv" style="width: 100%;height: auto; min-height:15%;font-size: x-large;border-bottom: 3px solid #EBEBEB;">${quesnum}、${questitlelist.quesdescript}</div>
|
||||
<!-- <div style="width: 100%;height: 0.5%;background-color: #EBEBEB;"></div> -->
|
||||
<div style="width: 100%;height: 5%;"></div>
|
||||
<div id="questoptiondiv" style="width:100%;height:60%;font-size: x-large;">
|
||||
<!--判断填空题-->
|
||||
<c:if test="${questypename == '填空题'}">
|
||||
<div>
|
||||
<input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="" placeholder="请将正确答案填写此处 多个答案用,隔开"/>'+
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '多选题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="checkbox" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optionx}.${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '单选题' || questypename == '判断题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="radio" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optionx}.${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="marginmid" style="width:2%;height:100%;float:left;"></div>
|
||||
|
||||
<div id="rightmain" style="width: 16%;height: 100%;float: left;">
|
||||
<div id="lefttop" style="width: 100%;height:4%;"></div>
|
||||
|
||||
<div style="width: 100%;height:2%;color: white;">北京时间</div>
|
||||
<div id="nowtime" style="width: 100%;height:5%;color: white;font-weight: 600;"></div>
|
||||
<div style="width:100%;height:2%;color: white;">剩余时间</div>
|
||||
<div id="timer" style="width:100%;height:5%;color: white;font-weight: 600;"></div>
|
||||
<!-- 题目跳转卡片 -->
|
||||
<!-- <div id="selectques" style="width: 100%;height: 50%;cursor: pointer;" onclick="doSwitch('prev')">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/selectques.png" style="width: 100%;height: 100%;">
|
||||
</div> -->
|
||||
|
||||
<div id="selectques" style="width: 100%;height: 56%;background-color: #EBEBEB;">
|
||||
<div style="width: 1%;height: 100%;float: left;"></div>
|
||||
|
||||
<div style="width: 98%;height: 100%;float: left;">
|
||||
<div style="width: 100%;height: 1%;"></div>
|
||||
|
||||
|
||||
<div class="hiddenscroll" style="width: 100%;height: 98%;overflow-x: hidden;overflow-y: auto;word-break: break-all;word-wrap: break-word;">
|
||||
<!-- 循环题型 -->
|
||||
<c:forEach var="selectcard" items="${selectcard}">
|
||||
<div style="width: 100%;">${selectcard.ord}、${selectcard.questypename}(共${selectcard.questypenum}题)</div>
|
||||
<div style="width: 100%;height: auto;background-color: white;">
|
||||
<!-- <div style="width: 100%;height: 10%;"></div> -->
|
||||
<div class="hiddenscroll" style="width:100%;overflow-x: hidden;overflow-y: auto;word-break: break-all;word-wrap: break-word;">
|
||||
<c:forEach var="selecttitlelist" items="${selectcard.selecttitlelist}">
|
||||
<div id="${selecttitlelist.questitleid}" class="cricle" style="border-style:solid;border-color:#568DBD;border-width:1px;border-radius: 50%;height: 28px;width: 12%;margin: 2% 3.5%;display: inline-block;background: #FFFFFF;vertical-align: top;cursor: pointer;" onclick="dojumpques('${selecttitlelist.questitleid}')">
|
||||
<div id="${selecttitlelist.questitleid}000" style="display: block;color: #568DBD;height: 20px;line-height: 28px;text-align: center">${selecttitlelist.questitlenum}</div>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</c:forEach>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="width: 100%;height: 1%;"></div>
|
||||
</div>
|
||||
|
||||
<div style="width: 1%;height: 100%;float: left;"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="width:100%;height:2%"></div>
|
||||
|
||||
<div style="width:100%;height:5%;cursor: pointer;" onclick="domarkques()">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/mark.png" style="width: 35%;height: 100%;">
|
||||
</div>
|
||||
<div style="width:100%;height:1.3%"></div>
|
||||
<div style="width:100%;height:5%;cursor: pointer;" onclick="doSwitch('next')">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/nextques.png" style="width: 35%;height: 100%;">
|
||||
</div>
|
||||
<div style="width:100%;height:1.3%"></div>
|
||||
<div style="width:100%;height:5%;cursor: pointer;" onclick="dosendpaper()">
|
||||
<img src="<%=request.getContextPath()%>/IMG/main/sendpaper.png" style="width: 35%;height: 100%;">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <div id="examhtml">
|
||||
<div>
|
||||
${quesnum}、${questitlelist.quesdescript}
|
||||
</div>
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="checkbox" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" />
|
||||
${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosendpaper()">交卷</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSwitch('prev')">上一题</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSwitch('next')">下一题</button>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
<script>
|
||||
//倒计时功能
|
||||
var oBox= document.getElementById('timer');
|
||||
var maxtime = $("#examtime").val() * 60;
|
||||
function CountDown() {
|
||||
if (maxtime >= 0) {
|
||||
minutes = Math.floor(maxtime / 60);
|
||||
seconds = Math.floor(maxtime % 60);
|
||||
if(minutes < 10){
|
||||
minutes = "0"+minutes;
|
||||
}
|
||||
if(seconds < 10){
|
||||
seconds = "0"+seconds;
|
||||
}
|
||||
msg = minutes + ":" + seconds ;
|
||||
oBox.innerHTML = msg;
|
||||
if (maxtime == 5 * 60)swal("还剩5分钟!请考生仔细检查试卷");
|
||||
--maxtime;
|
||||
} else{
|
||||
clearInterval(timer);
|
||||
swal("时间到,考试结束!");
|
||||
closeModal('subModal');
|
||||
}
|
||||
}
|
||||
timer = setInterval("CountDown()", 1000);
|
||||
|
||||
</script>
|
||||
66
WebRoot/jsp/exam/exampaperhtml.jsp
Normal file
66
WebRoot/jsp/exam/exampaperhtml.jsp
Normal file
@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//下一题
|
||||
var donext = function() {
|
||||
var quesnum = $("#quesnum");
|
||||
$.post(ext.contextPath + '/exam/examrecord/donext.do', {quesnum:quesnum} , function(data) {
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subModal">
|
||||
<input type="hidden" name="quesnum" id="quesnum" value="${quesnum}" />
|
||||
<input type="hidden" name="questitlenum" id="questitlenum" value="${questitlenum}" />
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-body"></div>
|
||||
<!-- 新增界面formid强制为editForm -->
|
||||
<form class="form-horizontal" id="editForm">
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="examrecordid" name="examrecordid" value="${examrecordid}" />
|
||||
<input type="hidden" id="questitleid" name="questitleid" value="${questitlelist.id}" />
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<div>
|
||||
${questitlelist.quesdescript}
|
||||
</div>
|
||||
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="checkbox" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" />
|
||||
${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
|
||||
</c:forEach>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
506
WebRoot/jsp/exam/examrecordList.jsp
Normal file
506
WebRoot/jsp/exam/examrecordList.jsp
Normal file
@ -0,0 +1,506 @@
|
||||
<%@page import="com.sipai.tools.DateSpan"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.activiti.ProcessType"%>
|
||||
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%@page import="com.sipai.entity.business.BusinessUnit"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 引入slimscroll-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/AdminLTE/js/jquery.slimscroll.min.js" charset="utf-8"></script>
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/ionicons/css/ionicons.min.css"/>
|
||||
|
||||
<!-- 引入fullcalender -->
|
||||
<!-- 日历 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/fullcalendar/dist/fullcalendar.min.css" />
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/fullcalendar/dist/fullcalendar.print.min.css" media='print' />
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/moment/min/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/fullcalendar/dist/fullcalendar.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/fullcalendar/dist/locale/zh-cn.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/mainPage.js" charset="utf-8"></script>
|
||||
<style>
|
||||
.main-header{display:none;}
|
||||
.content-header{display:none;}
|
||||
.main-footer{display:none;}
|
||||
/*
|
||||
根据不同分辨率显示不同px的文字大小
|
||||
*/
|
||||
@media (min-width: 768px) and (min-height: 432px) {
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 992px) and (min-height: 558px) {
|
||||
.rank2{
|
||||
margin-left: 2.5%;
|
||||
/* color: green; */
|
||||
}
|
||||
.img1{
|
||||
width: 13%;
|
||||
}
|
||||
.rank2out1{
|
||||
margin-top:-10px;
|
||||
}
|
||||
.rank3{
|
||||
margin-top:3px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) and (min-height: 675px) {
|
||||
.rank2{
|
||||
margin-left: 8%;
|
||||
/* color: yellow; */
|
||||
}
|
||||
.rank2out1{
|
||||
margin-top:-5px;
|
||||
}
|
||||
.rank3{
|
||||
margin-top:5px;
|
||||
}
|
||||
}
|
||||
|
||||
/* @media (max-width: 1400px) and (max-height: 675px) {
|
||||
.rank2{
|
||||
margin-left: 6%;
|
||||
color: blue;
|
||||
}
|
||||
} */
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var ChartType_Base='${ChartType_Base}';
|
||||
var ChartType_Gauge='${ChartType_Gauge}';
|
||||
var ChartType_Bar='${ChartType_Bar}';
|
||||
var ChartType_Line='${ChartType_Line}';
|
||||
var dateSpan='${DateSpan_Year}';
|
||||
var beginTimeStore = '';
|
||||
var endTimeStore = '';
|
||||
function goToLocation(url){
|
||||
$.post(ext.contextPath +"/user/getMenuRelation.do",{location:url},function(data){
|
||||
console.info(data)
|
||||
if(data.length>2){
|
||||
doforward(url,data[2].id,data[1].id,data[0].id)
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
var addProblemFun = function() {
|
||||
$.post(ext.contextPath + '/maintenance/addProblem.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var addDetailFun = function() {
|
||||
$.post(ext.contextPath + '/maintenance/addDetail.do', function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var doOpenExamRecordList = function(startdate,examtype) {
|
||||
var startdate = startdate;
|
||||
var examtype = examtype
|
||||
$.post(ext.contextPath + '/exam/examrecord/showTableListall.do', {startdate:startdate,examtype:examtype} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
// openModal('subModalrs');
|
||||
var div = $('#maincanlendar');
|
||||
div.hide();
|
||||
$('.modal-backdrop').remove();//去掉遮罩层
|
||||
});
|
||||
};
|
||||
|
||||
function getCompanies(){
|
||||
$("#table_companies").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/getManageCompaniesWithResult.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
/* pagination: false, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 5000, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页 */
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order, // 排序规则
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
/* sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则 */
|
||||
columns: [
|
||||
{
|
||||
field: 'index', // 返回json数据中的name
|
||||
title: '序号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return index+1;
|
||||
}
|
||||
},{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '客户', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return row.company.name;
|
||||
}
|
||||
},{
|
||||
field: 'totalNum', // 返回json数据中的name
|
||||
title: '总数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'maintenanceNumAll', // 返回json数据中的name
|
||||
title: '发单数目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'taskNumAll', // 返回json数据中的name
|
||||
title: '任务数目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'supplementNumAll', // 返回json数据中的name
|
||||
title: '补录数目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'maintainNumAll', // 返回json数据中的name
|
||||
title: '保养数目', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(data){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_companies");
|
||||
$('#companiesTitle').text("运维客户总数:"+data.length+"");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
var initialInfo =function(){
|
||||
initialMainPageType('mainpage_container',bizId,'${cu.id}');
|
||||
//initialMainPageType('mainpage_container',$("#bizId").val(),'${cu.id}');
|
||||
/* initialProduceBase('produceBase');
|
||||
initialProduceGauge('produceGauge');
|
||||
initialProduceBarAndLine('produceBarALine');
|
||||
initialEfficiencyBase('efficiencyBase');
|
||||
initialEfficiencyGauge('efficiencyGauge');
|
||||
initialEfficiencyBarAndLine('efficiencyBarALine');
|
||||
initialSecurityBase('securityBase');
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
var bizId;
|
||||
$(function() {
|
||||
var flag = IsApp();
|
||||
if (flag==true){
|
||||
|
||||
}else{
|
||||
$(".main-header").show();
|
||||
$(".content-header").show();
|
||||
$(".main-footer").show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 设备管理日历
|
||||
$('#calendar').fullCalendar({
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: ''
|
||||
},
|
||||
aspectRatio: 1.35,
|
||||
// defaultDate: '2018-03-12',
|
||||
timeFormat: 'HH:mm',
|
||||
// 定义表格中显示的时间格式如:22:30,默认格式为HH(:mm)效果是整点的时候自动隐藏分钟,例如23:00会显示成23
|
||||
displayEventEnd: true,
|
||||
// 显示事件的结束时间,默认是false
|
||||
// aspectRatio: 1, //设置日历单元格显示的宽高比,数值越小越窄高
|
||||
navLinks: false, // can click day/week names to navigate views
|
||||
eventLimit: true, // allow "more" link when too many events
|
||||
editable: false, // 允许编辑
|
||||
eventStartEditable: false, // 允许直接在界面中编辑事件的开始时间
|
||||
eventDurationEditable: false, // 允许编辑事件的时长
|
||||
events: function (start, end, timezone, callback) { // 单击日历中事件时触发的函数,实现效果是获取当前点击事件的标题,开始时间,结束时间传给DOM控件
|
||||
var events = [];
|
||||
/*
|
||||
* var starttime = moment(calEvent.start).format('YYYY-MM-DD
|
||||
* HH:mm:ss'); //使用moment.js对时间进行格式化 var endtime =
|
||||
* moment(calEvent.end).format('YYYY-MM-DD HH:mm:ss');
|
||||
*/
|
||||
$.post(ext.contextPath + '/exam/examrecord/getAllList.do', {
|
||||
// sdt: start.format(),
|
||||
// edt: end.format(),
|
||||
// companyId: companyId,
|
||||
// pSectionId: $("#processSection").val(),
|
||||
}, function (data) {
|
||||
|
||||
// for (var i = 0; i < data.maintenanceList.length; i++) {
|
||||
// var obj = new Object();
|
||||
// obj.id = data.maintenanceList[i].ids;
|
||||
// obj.title = "缺陷" + data.maintenanceList[i].number;
|
||||
// obj.color = '#FF0000';
|
||||
// obj.start = data.maintenanceList[i].sdt;
|
||||
// events.push(obj);
|
||||
// }
|
||||
// for (var i = 0; i < data.abnormalList.length; i++) {
|
||||
// var obj = new Object();
|
||||
// obj.id = data.abnormalList[i].ids;
|
||||
// obj.title = "异常" + data.abnormalList[i].number;
|
||||
// obj.color = '#EEC900';
|
||||
// obj.start = data.abnormalList[i].sdt;
|
||||
// events.push(obj);
|
||||
// }
|
||||
console.log("in");
|
||||
|
||||
for(var i=0;i<data.monilist.length;i++){
|
||||
|
||||
var obj = new Object();
|
||||
obj.title = '<div class="rank1" style="margin-top:-28px;width:100%;height:100%;cursor: pointer;" onclick="doOpenExamRecordList(\''+data.monilist[i].startdate+'\',\'moni\')"><img class="img1" style="float:left;margin-left:8%;margin-right:8%;" src="'+ext.contextPath+'/IMG/main/moni.png"></img><h4 style="margin: 0%;float:left;color: #3BA96A">模拟考试</h4></div>';
|
||||
obj.color = '#ECF0F5';
|
||||
obj.start = data.monilist[i].startdate;
|
||||
obj.order = 1;
|
||||
events.push(obj);
|
||||
|
||||
var obj1 = new Object();
|
||||
obj1.title = "<div class='rank2out1'><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left;'>报名人数 : "+data.monilist[i].allcount+"</div><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left;'> 缺考人数 : "+data.monilist[i].notcount+"</div></div>";
|
||||
obj1.color = '#ECF0F5';
|
||||
obj1.textColor = '#000'
|
||||
obj1.start = data.monilist[i].startdate;
|
||||
obj1.order = 2;
|
||||
events.push(obj1);
|
||||
|
||||
var obj2 = new Object();
|
||||
obj2.title = "<div style='margin-top:0px;'><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left'>通过人数 : "+data.monilist[i].passcount+"</div><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left'> 通过率 : "+data.monilist[i].passrate+"%</div></div>";
|
||||
obj2.color = '#ECF0F5';
|
||||
obj2.textColor = '#000'
|
||||
obj2.start = data.monilist[i].startdate;
|
||||
obj2.order = 3;
|
||||
events.push(obj2);
|
||||
}
|
||||
|
||||
for(var j=0;j<data.zhengshilist.length;j++){
|
||||
if(data.zhengshilist[j].mark == '0'){
|
||||
var obj = new Object();
|
||||
obj.title = '<div class="rank1" style="margin-top:-28px;width:100%;height:100%;cursor: pointer;" onclick="doOpenExamRecordList(\''+data.zhengshilist[j].startdate+'\',\'zhengshi\')"><img class="img1" style="float:left;margin-left:8%;margin-right:8%;" src="'+ext.contextPath+'/IMG/main/zhengshi.png"></img><h4 style="margin: 0%;float:left;color: #3C8DBC">正式考试</h4></div>';
|
||||
obj.color = '#ECF0F5';
|
||||
obj.start = data.zhengshilist[j].startdate;
|
||||
obj.order = 1;
|
||||
events.push(obj);
|
||||
|
||||
var obj1 = new Object();
|
||||
obj1.title = "<div class='rank2out1'><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left;'>报名人数 : "+data.zhengshilist[j].allcount+"</div><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left;'> 缺考人数 : "+data.zhengshilist[j].notcount+"</div></div>";
|
||||
obj1.color = '#ECF0F5';
|
||||
obj1.textColor = '#000'
|
||||
obj1.start = data.zhengshilist[j].startdate;
|
||||
obj1.order = 2;
|
||||
events.push(obj1);
|
||||
|
||||
var obj2 = new Object();
|
||||
obj2.title = "<div style='margin-top:0px;'><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left'>通过人数 : "+data.zhengshilist[j].passcount+"</div><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left'> 通过率 : "+data.zhengshilist[j].passrate+"%</div></div>";
|
||||
obj2.color = '#ECF0F5';
|
||||
obj2.textColor = '#000'
|
||||
obj2.start = data.zhengshilist[j].startdate;
|
||||
obj2.order = 3;
|
||||
events.push(obj2);
|
||||
|
||||
}else{
|
||||
var obj3 = new Object();
|
||||
obj3.title = '<div class="rank3" style="width:100%;height:100%;cursor: pointer;border-bottom:1px solid #BDBDBD" onclick="doOpenExamRecordList(\''+data.zhengshilist[j].startdate+'\',\'zhengshi\')"><img class="img1" style="float:left;margin-left:8%;margin-right:8%;margin-top:5%" src="'+ext.contextPath+'/IMG/main/zhengshi.png"></img><h4 style="margin: 0%;float:left;color: #3C8DBC;margin-top:5%">正式考试</h4></div>';
|
||||
obj3.color = '#ECF0F5';
|
||||
obj3.start = data.zhengshilist[j].startdate;
|
||||
obj3.order = 4;
|
||||
events.push(obj3);
|
||||
|
||||
var obj4 = new Object();
|
||||
obj4.title = "<div style='margin-top:0px;'><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left'>报名人数 : "+data.zhengshilist[j].allcount+"</div><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left'> 缺考人数 : "+data.zhengshilist[j].notcount+"</div></div>";
|
||||
obj4.color = '#ECF0F5';
|
||||
obj4.textColor = '#000'
|
||||
obj4.start = data.zhengshilist[j].startdate;
|
||||
obj4.order = 5;
|
||||
events.push(obj4);
|
||||
|
||||
var obj5 = new Object();
|
||||
obj5.title = "<div style='margin-top:0px;'><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left'>通过人数 : "+data.zhengshilist[j].passcount+"</div><div class='rank2' style='width:auto;height:100%;margin-top:2px;font-weight: 600;float:left'> 通过率 : "+data.zhengshilist[j].passrate+"%</div></div>";
|
||||
obj5.color = '#ECF0F5';
|
||||
obj5.textColor = '#000'
|
||||
obj5.start = data.zhengshilist[j].startdate;
|
||||
obj5.order = 6;
|
||||
events.push(obj5);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// var obj = new Object();
|
||||
// obj.title = "<div style='width:100%;height:100%'><img style='float:left;' src='"+ext.contextPath+"/IMG/main/moni.png'></img><h4 style='margin: 0%;float:left;color: #3BA96A'>模拟考试</h4></div>";
|
||||
// obj.color = '#ECF0F5';
|
||||
// obj.start = '2020-06-15';
|
||||
// obj.order = 1;
|
||||
// events.push(obj);
|
||||
|
||||
// var obj1 = new Object();
|
||||
// obj1.title = "<div style='width:100%;height:100%;margin-top:2px;font-weight: 600;'>报名人数:90 缺考人数:10</div>";
|
||||
// obj1.color = '#ECF0F5';
|
||||
// obj1.textColor = '#000'
|
||||
// obj1.start = '2020-06-15';
|
||||
// obj1.order = 2;
|
||||
// events.push(obj1);
|
||||
|
||||
|
||||
// var obj2 = new Object();
|
||||
// obj2.title = "<div style='width:100%;height:100%;margin-top:5px;'><img style='float:left;' src='"+ext.contextPath+"/IMG/main/zhengshi.png'></img><h4 style='margin: 0%;float:left;color: #3C8DBC'>正式考试</h4></div>";
|
||||
// obj2.color = '#ECF0F5';
|
||||
// obj2.start = '2020-06-15';
|
||||
// obj2.order = 3;
|
||||
// events.push(obj2);
|
||||
|
||||
// var obj3 = new Object();
|
||||
// obj3.title = "<div style='width:100%;height:100%;margin-top:2px;font-weight: 600;'>报名人数:90 缺考人数:10</div>";
|
||||
// obj3.color = '#ECF0F5';
|
||||
// obj3.textColor = '#000'
|
||||
// obj3.start = '2020-06-15';
|
||||
// obj3.order = 4;
|
||||
// events.push(obj3);
|
||||
|
||||
// var obj4 = new Object();
|
||||
// obj4.title = "<div style='width:100%;height:100%;margin-top:2px;font-weight: 600;'>通过人数:90 通过率:90%</div>";
|
||||
// obj4.color = '#ECF0F5';
|
||||
// obj4.textColor = '#000'
|
||||
// obj4.start = '2020-06-15';
|
||||
// obj4.order = 5;
|
||||
// events.push(obj4);
|
||||
|
||||
|
||||
callback(events);
|
||||
}, 'json'); // 把从后台取出的数据进行封装以后在页面上以fullCalendar的方式进行显示
|
||||
|
||||
|
||||
},
|
||||
eventClick: function (event, jsEvent, view) {
|
||||
if (event.color == '#FF0000') {
|
||||
viewDefectFun(event.id);// 查看缺陷
|
||||
} else if (event.color == '#EEC900') {
|
||||
viewAbnormalFun(event.id);// 查看异常
|
||||
}
|
||||
},
|
||||
dayClick: function (date, jsEvent, view) {
|
||||
// 点击空白日期调用
|
||||
},
|
||||
eventOrder: 'order',
|
||||
eventRender: function (event, element) {// title以HTML显示(换行)
|
||||
element.html(event.title);
|
||||
if(event.imageurl){
|
||||
console.log(event.imageurl);
|
||||
element.find("div.fc-event-inner").prepend("<img src='" + event.imageurl +"' width='12' height='12'>");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function refreshMainPage(){
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu();" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<%-- <section class="content-header">
|
||||
<h1 id ="head_title">
|
||||
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' onclick="goToMainPage();" style="cursor:pointer "><i class="glyphicon glyphicon-refresh"></i> </a></li>
|
||||
</ol>
|
||||
</section>--%>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid " >
|
||||
<div id="subDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="maincanlendar" class="row connectedSortable" >
|
||||
<div class="canlendar" id="calendar"></div>
|
||||
</div>
|
||||
<!-- <div class="row connectedSortable" id="mainpage_container"></div> -->
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<jsp:include page="/jsp/bottom.jsp"></jsp:include>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<!-- bootstrap-switch-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<!-- echarts-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js" charset="utf-8"></script>
|
||||
<script src="<%=request.getContextPath()%>/JS/activiti/workflow.js" type="text/javascript"></script>
|
||||
<script src="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.js" type="text/javascript"></script>
|
||||
<%-- 引入CSS --%>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/JS/qtip/jquery.qtip.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/CSS/style-activiti.css" type="text/css">
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js" charset="utf-8"></script>
|
||||
</html>
|
||||
154
WebRoot/jsp/exam/openVisualexam.jsp
Normal file
154
WebRoot/jsp/exam/openVisualexam.jsp
Normal file
@ -0,0 +1,154 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<!-- <link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-table/jquery.tablednd.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js" charset="utf-8"></script> -->
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
$("#table_Detail").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/exam/examrecord/getUserVisualexamList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 5, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
paginationDetailHAlign:' hidden',//去除分页的显示
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order
|
||||
}
|
||||
},
|
||||
// sortName: 'ord', // 要排序的字段
|
||||
// sortOrder: 'asc', // 排序规则
|
||||
// onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// //viewFun(row.id);
|
||||
// },
|
||||
columns: [
|
||||
{
|
||||
field: '_examname', // 返回json数据中的name
|
||||
title: '考试名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居h中
|
||||
// width: '30%'
|
||||
},{
|
||||
field: 'startdate', // 返回json数据中的name
|
||||
title: '开始时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
},{
|
||||
field: 'enddate', // 返回json数据中的name
|
||||
title: '结束时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
// width: '10%'
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
},{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '考试状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
// width: '10%'
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 90, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
if(row.status=='未考'){
|
||||
buts+= '<button class="btn btn-default btn-sm" title="开始考试" onclick="doexam(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 开始考试</span></button>';
|
||||
}
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
//当拖拽结束后,整个表格的数据
|
||||
// onReorderRow: function (newData) {
|
||||
// //这里的newData是整个表格数据,数组形式
|
||||
// //console.log(newData); 调试用代码
|
||||
// $.post(ext.contextPath + '/exam/examTitleRange/dosort.do',
|
||||
// { jsondata: JSON.stringify(newData) },//将整张表数据Post,当然,先序列化成Json
|
||||
// function(data) {
|
||||
// if (data == 1) {
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// showAlert('s','排序成功','mainAlertdiv');
|
||||
// }else{
|
||||
// showAlert('d','数据错误','mainAlertdiv');
|
||||
// }
|
||||
// });
|
||||
|
||||
// }
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" style="width: 800px">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">模拟考试列表界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- <div class="box box-primary" >
|
||||
<div id="mainAlertDetaildiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">模拟考试列表</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
|
||||
</div>
|
||||
</div> -->
|
||||
<div style="height: 54%;">
|
||||
<table id="table_Detail" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
276
WebRoot/jsp/exam/openanalysis.jsp
Normal file
276
WebRoot/jsp/exam/openanalysis.jsp
Normal file
@ -0,0 +1,276 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
/* .modal{
|
||||
padding-left: 0px !important;
|
||||
} */
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
// $("#subForm").bootstrapValidator('validate');//提交验证
|
||||
// if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/exam/daytestrecord/publishdaytest.do", $("#subForm").serialize(), function(data) {
|
||||
console.log(data);
|
||||
var arr= JSON.parse(JSON.stringify(data));
|
||||
if (arr.res == 1){
|
||||
$(".modal-backdrop").remove();
|
||||
closeModal('subModal');
|
||||
swal("题目准备完毕!");
|
||||
dodaytestpapaer(arr.daytestRecordid);
|
||||
}else if(arr.res == 0){
|
||||
swal("题目准备失败!");
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
// }
|
||||
}
|
||||
|
||||
//打开每日一练
|
||||
var dodaytestpapaer = function(id) {
|
||||
var daytestrecordid = id;
|
||||
$.post(ext.contextPath + '/exam/daytestrecord/daytestpaper.do',{daytestrecordid:daytestrecordid}, function(data) {
|
||||
// console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
function doclose() {
|
||||
closeModal('subModal');
|
||||
}
|
||||
var showSubject4SelectsFun = function() {
|
||||
var userIds= $("#subjecttypeids").val();
|
||||
$.post(ext.contextPath + '/question/subjecttype/subjectForSelect.do', {formId:"subForm2",hiddenId:"subjecttypeids",textId:"subjectName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showRanktype4SelectsFun = function() {
|
||||
var userIds= $("#ranktypeids").val();
|
||||
$.post(ext.contextPath + '/question/ranktype/rankForSelect.do', {formId:"subForm2",hiddenId:"ranktypeids",textId:"rankName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showQuesttype4SelectsFun = function() {
|
||||
var userIds= $("#questtypeids").val();
|
||||
$.post(ext.contextPath + '/question/questtype/questForSelect.do', {formId:"subForm2",hiddenId:"questtypeids",textId:"questName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
function selectnode(){
|
||||
// console.log($('#companytree1').treeview('getChecked'));
|
||||
var arr = $('#companytree1').treeview('getChecked');
|
||||
var ids = "";
|
||||
var texts = "";
|
||||
for(var i=0;i<arr.length;i++){
|
||||
ids+= arr[i].id+",";
|
||||
texts+= arr[i].text+",";
|
||||
}
|
||||
// console.log(ids);
|
||||
$("#cname_input1").val(texts);
|
||||
$("#subjecttypeids").val(ids);
|
||||
document.getElementById('company_select').style.display = "none";
|
||||
$("ul#company_select").hide();
|
||||
}
|
||||
|
||||
function selected(data){
|
||||
if(data.fatherId == undefined){
|
||||
for (var i = 0; i < data.nodes.length; i++) {
|
||||
$("#companytree1").treeview('checkNode', [ data.nodes[i], {silent: true}]);
|
||||
}
|
||||
}else{
|
||||
var parentNode = $('#companytree1').treeview('getParent', data.nodeId);
|
||||
$("#companytree1").treeview('checkNode', [ parentNode, {silent: true}]);
|
||||
}
|
||||
}
|
||||
|
||||
function unSelected(node){
|
||||
if(node.fatherId == undefined){
|
||||
for (var i = 0; i < node.nodes.length; i++) {
|
||||
$("#companytree1").treeview('uncheckNode', [ node.nodes[i], {silent: true}]);
|
||||
}
|
||||
}else{
|
||||
var parentNode = $('#companytree1').treeview('getParent', node.nodeId);
|
||||
var num;
|
||||
for (var i = 0; i < parentNode.nodes.length; i++) {
|
||||
if(parentNode.nodes[i].state.checked == true){
|
||||
num=1;
|
||||
}
|
||||
}
|
||||
if(num!=1){
|
||||
$("#companytree1").treeview('uncheckNode', [ parentNode, {silent: true}]);
|
||||
}
|
||||
console.log(parentNode);
|
||||
}
|
||||
}
|
||||
|
||||
//输入框验证
|
||||
// $("#subForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// project: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '名称不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
$(function () {
|
||||
//树(工作领域)
|
||||
$.post(ext.contextPath + '/question/subjecttype/getSubjecttypeJson.do', { ng: '' }, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid1").val(data[0].id);
|
||||
$("#companyselect1").hide();
|
||||
$("#companyName1").text("公司:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#search_pid1").val(data[0].id);
|
||||
// $("#cname_input1").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree1').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
showCheckbox: true,
|
||||
levels: 1,
|
||||
hierarchicalCheck:true,//级联勾选
|
||||
// onNodeChecked : function(event, data) {
|
||||
// //点击选中
|
||||
// selected(data);
|
||||
// },
|
||||
// onNodeUnchecked : function(event, node){
|
||||
// //点击取消
|
||||
// unSelected(node);
|
||||
// }
|
||||
});
|
||||
// $('#companytree1').on('nodeSelected', function (event, data) {
|
||||
// var nodesnum=0;
|
||||
// if(data.nodes!=null){
|
||||
// nodesnum=data.nodes.length;
|
||||
// }else{
|
||||
// nodesnum=nodesnum;
|
||||
// }
|
||||
|
||||
// if(nodesnum==0){
|
||||
// $("#search_pid1").val(data.id);
|
||||
// $("#cname_input1").val(data.text);
|
||||
// document.getElementById('company_select').style.display = "none";
|
||||
// $("ul#company_select").hide();
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// }
|
||||
|
||||
|
||||
// // $("ul#company_select").hide();
|
||||
// });
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
|
||||
//防止点击树收起下拉框
|
||||
$("#company_select").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
//点击树之外其他区域收起
|
||||
$(document).click(function(){
|
||||
$("#company_select").hide();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" style="width: 100%;height: auto;">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">答题反馈</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="width: 100%;height: auto;">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<div style="width: 2%;height: auto;"></div>
|
||||
<div style="width: 96%;height: auto;">
|
||||
<div style="width: 100%;">本次练习您共完成${numcount}题,其中答对${rightnum}题,答错${errornum}题。</div>
|
||||
<div style="width: 100%;">答题情况</div>
|
||||
<!--开始循环titlelist-->
|
||||
<c:forEach var="titlelist" items="${titlelist}">
|
||||
<c:if test="${titlelist.status=='正确'}">
|
||||
<div style="width: 100%;">${titlelist.quesnum}.(${titlelist.questypename})${titlelist.questitle}</div>
|
||||
<!--开始循环选项-->
|
||||
<c:forEach var="optionlist" items="${titlelist.optionlist}">
|
||||
<div style="width: 100%;">
|
||||
<c:if test="${optionlist.optionvalue=='T'}">
|
||||
<input type="checkbox" name="option" id="${optionlist.optionid}" value="${optionlist.optionid}" style="zoom: 140%;" checked="checked"/>
|
||||
${optionlist.optioncontent}
|
||||
</c:if>
|
||||
<c:if test="${optionlist.optionvalue=='F'}">
|
||||
<input type="checkbox" name="option" id="${optionlist.optionid}" value="${optionlist.optionid}" style="zoom: 140%;"/>
|
||||
${optionlist.optioncontent}
|
||||
</c:if>
|
||||
</div>
|
||||
</c:forEach>
|
||||
<!--答案解析-->
|
||||
<div style="width: 100%;height: 5px;"></div>
|
||||
<div style="width: 100%;">您的答案:${titlelist.useranswer}</div>
|
||||
<div style="width: 100%;">答案解析:${titlelist.analysis};本题正确答案为 ${titlelist.rightanswer}</div>
|
||||
<div style="width: 100%;height: 5px;"></div>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${titlelist.status=='错误'}">
|
||||
<div style="width: 100%;color: red;">${titlelist.quesnum}.(${titlelist.questypename})${titlelist.questitle}</div>
|
||||
<!--开始循环选项-->
|
||||
<c:forEach var="optionlist" items="${titlelist.optionlist}">
|
||||
<div style="width: 100%;color: red;">
|
||||
<c:if test="${optionlist.optionvalue=='T'}">
|
||||
<input type="checkbox" name="option" id="${optionlist.optionid}" value="${optionlist.optionid}" style="zoom: 140%;" checked="checked"/>
|
||||
${optionlist.optioncontent}
|
||||
</c:if>
|
||||
<c:if test="${optionlist.optionvalue=='F'}">
|
||||
<input type="checkbox" name="option" id="${optionlist.optionid}" value="${optionlist.optionid}" style="zoom: 140%;"/>
|
||||
${optionlist.optioncontent}
|
||||
</c:if>
|
||||
</div>
|
||||
</c:forEach>
|
||||
<!--答案解析-->
|
||||
<div style="width: 100%;height: 5px;"></div>
|
||||
<div style="width: 100%;color: red;">您的答案:${titlelist.useranswer}</div>
|
||||
<div style="width: 100%;color: red;">答案解析:${titlelist.analysis},本题正确答案为 ${titlelist.rightanswer}</div>
|
||||
<div style="width: 100%;height: 5px;"></div>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
|
||||
</div>
|
||||
<div style="width: 2%;height: auto;"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="doclose()">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">确定</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
291
WebRoot/jsp/exam/openexamanalysis.jsp
Normal file
291
WebRoot/jsp/exam/openexamanalysis.jsp
Normal file
@ -0,0 +1,291 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
/* .modal{
|
||||
padding-left: 0px !important;
|
||||
} */
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
// $("#subForm").bootstrapValidator('validate');//提交验证
|
||||
// if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/exam/daytestrecord/publishdaytest.do", $("#subForm").serialize(), function(data) {
|
||||
console.log(data);
|
||||
var arr= JSON.parse(JSON.stringify(data));
|
||||
if (arr.res == 1){
|
||||
$(".modal-backdrop").remove();
|
||||
closeModal('subModal');
|
||||
swal("题目准备完毕!");
|
||||
dodaytestpapaer(arr.daytestRecordid);
|
||||
}else if(arr.res == 0){
|
||||
swal("题目准备失败!");
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
// }
|
||||
}
|
||||
|
||||
//打开每日一练
|
||||
var dodaytestpapaer = function(id) {
|
||||
var daytestrecordid = id;
|
||||
$.post(ext.contextPath + '/exam/daytestrecord/daytestpaper.do',{daytestrecordid:daytestrecordid}, function(data) {
|
||||
// console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
function doclose() {
|
||||
closeModal('subModal');
|
||||
}
|
||||
var showSubject4SelectsFun = function() {
|
||||
var userIds= $("#subjecttypeids").val();
|
||||
$.post(ext.contextPath + '/question/subjecttype/subjectForSelect.do', {formId:"subForm2",hiddenId:"subjecttypeids",textId:"subjectName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showRanktype4SelectsFun = function() {
|
||||
var userIds= $("#ranktypeids").val();
|
||||
$.post(ext.contextPath + '/question/ranktype/rankForSelect.do', {formId:"subForm2",hiddenId:"ranktypeids",textId:"rankName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showQuesttype4SelectsFun = function() {
|
||||
var userIds= $("#questtypeids").val();
|
||||
$.post(ext.contextPath + '/question/questtype/questForSelect.do', {formId:"subForm2",hiddenId:"questtypeids",textId:"questName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
function selectnode(){
|
||||
// console.log($('#companytree1').treeview('getChecked'));
|
||||
var arr = $('#companytree1').treeview('getChecked');
|
||||
var ids = "";
|
||||
var texts = "";
|
||||
for(var i=0;i<arr.length;i++){
|
||||
ids+= arr[i].id+",";
|
||||
texts+= arr[i].text+",";
|
||||
}
|
||||
// console.log(ids);
|
||||
$("#cname_input1").val(texts);
|
||||
$("#subjecttypeids").val(ids);
|
||||
document.getElementById('company_select').style.display = "none";
|
||||
$("ul#company_select").hide();
|
||||
}
|
||||
|
||||
function selected(data){
|
||||
if(data.fatherId == undefined){
|
||||
for (var i = 0; i < data.nodes.length; i++) {
|
||||
$("#companytree1").treeview('checkNode', [ data.nodes[i], {silent: true}]);
|
||||
}
|
||||
}else{
|
||||
var parentNode = $('#companytree1').treeview('getParent', data.nodeId);
|
||||
$("#companytree1").treeview('checkNode', [ parentNode, {silent: true}]);
|
||||
}
|
||||
}
|
||||
|
||||
function unSelected(node){
|
||||
if(node.fatherId == undefined){
|
||||
for (var i = 0; i < node.nodes.length; i++) {
|
||||
$("#companytree1").treeview('uncheckNode', [ node.nodes[i], {silent: true}]);
|
||||
}
|
||||
}else{
|
||||
var parentNode = $('#companytree1').treeview('getParent', node.nodeId);
|
||||
var num;
|
||||
for (var i = 0; i < parentNode.nodes.length; i++) {
|
||||
if(parentNode.nodes[i].state.checked == true){
|
||||
num=1;
|
||||
}
|
||||
}
|
||||
if(num!=1){
|
||||
$("#companytree1").treeview('uncheckNode', [ parentNode, {silent: true}]);
|
||||
}
|
||||
console.log(parentNode);
|
||||
}
|
||||
}
|
||||
|
||||
//输入框验证
|
||||
// $("#subForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// project: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '名称不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
$(function () {
|
||||
//树(工作领域)
|
||||
$.post(ext.contextPath + '/question/subjecttype/getSubjecttypeJson.do', { ng: '' }, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid1").val(data[0].id);
|
||||
$("#companyselect1").hide();
|
||||
$("#companyName1").text("公司:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#search_pid1").val(data[0].id);
|
||||
// $("#cname_input1").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree1').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
showCheckbox: true,
|
||||
levels: 1,
|
||||
hierarchicalCheck:true,//级联勾选
|
||||
// onNodeChecked : function(event, data) {
|
||||
// //点击选中
|
||||
// selected(data);
|
||||
// },
|
||||
// onNodeUnchecked : function(event, node){
|
||||
// //点击取消
|
||||
// unSelected(node);
|
||||
// }
|
||||
});
|
||||
// $('#companytree1').on('nodeSelected', function (event, data) {
|
||||
// var nodesnum=0;
|
||||
// if(data.nodes!=null){
|
||||
// nodesnum=data.nodes.length;
|
||||
// }else{
|
||||
// nodesnum=nodesnum;
|
||||
// }
|
||||
|
||||
// if(nodesnum==0){
|
||||
// $("#search_pid1").val(data.id);
|
||||
// $("#cname_input1").val(data.text);
|
||||
// document.getElementById('company_select').style.display = "none";
|
||||
// $("ul#company_select").hide();
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// }
|
||||
|
||||
|
||||
// // $("ul#company_select").hide();
|
||||
// });
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
|
||||
//防止点击树收起下拉框
|
||||
$("#company_select").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
//点击树之外其他区域收起
|
||||
$(document).click(function(){
|
||||
$("#company_select").hide();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" style="width: 100%;height: auto;">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">答题反馈</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="width: 100%;height: auto;">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<div style="width: 2%;height: auto;"></div>
|
||||
<div style="width: 96%;height: auto;">
|
||||
<div style="width: 100%;">本次练习您共完成${numcount}题,其中答对${rightnum}题,答错${errornum}题。</div>
|
||||
<div style="width: 100%;">答题情况</div>
|
||||
<!--开始循环题目类型-->
|
||||
<c:forEach var="analysislist" items="${analysislist}">
|
||||
<c:if test="${analysislist.questypename=='判断题'}">
|
||||
<div style="width: 100%;font-weight: 600;">${analysislist.ord}、${analysislist.questypename}(每题只有一个正确答案)(共${analysislist.questypenum}道)</div>
|
||||
</c:if>
|
||||
<c:if test="${analysislist.questypename=='单选题'}">
|
||||
<div style="width: 100%;font-weight: 600;">${analysislist.ord}、${analysislist.questypename}(每题只有一个正确答案)(共${analysislist.questypenum}道)</div>
|
||||
</c:if>
|
||||
<c:if test="${analysislist.questypename=='多选题'}">
|
||||
<div style="width: 100%;font-weight: 600;">${analysislist.ord}、${analysislist.questypename}(每题有多个正确答案)(共${analysislist.questypenum}道)</div>
|
||||
</c:if>
|
||||
<c:if test="${analysislist.questypename=='填空题'}">
|
||||
<div style="width: 100%;font-weight: 600;">${analysislist.ord}、${analysislist.questypename}(每题只有一个正确答案)(共${analysislist.questypenum}道)</div>
|
||||
</c:if>
|
||||
<!--开始循环titlelist-->
|
||||
<c:forEach var="titlelist" items="${analysislist.titlelist}">
|
||||
<c:if test="${titlelist.status=='正确'}">
|
||||
<div style="width: 100%;">${titlelist.quesnum}.(${titlelist.questypename})${titlelist.questitle}</div>
|
||||
<!--开始循环选项-->
|
||||
<c:forEach var="optionlist" items="${titlelist.optionlist}">
|
||||
<div style="width: 100%;">
|
||||
<c:if test="${optionlist.optionvalue=='T'}">
|
||||
<input type="checkbox" name="option" id="${optionlist.optionid}" value="${optionlist.optionid}" style="zoom: 100%;" checked="checked"/>
|
||||
${optionlist.optioncontent}
|
||||
</c:if>
|
||||
<c:if test="${optionlist.optionvalue=='F'}">
|
||||
<input type="checkbox" name="option" id="${optionlist.optionid}" value="${optionlist.optionid}" style="zoom: 100%;"/>
|
||||
${optionlist.optioncontent}
|
||||
</c:if>
|
||||
</div>
|
||||
</c:forEach>
|
||||
<!--答案解析-->
|
||||
<div style="width: 100%;height: 5px;"></div>
|
||||
<div style="width: 100%;">您的答案:${titlelist.useranswer}</div>
|
||||
<div style="width: 100%;">答案解析:${titlelist.analysis},本题正确答案为 ${titlelist.rightanswer}</div>
|
||||
<div style="width: 100%;height: 5px;"></div>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${titlelist.status=='错误' || titlelist.status=='' || titlelist.status==null}">
|
||||
<div style="width: 100%;color: red;">${titlelist.quesnum}.(${titlelist.questypename})${titlelist.questitle}</div>
|
||||
<!--开始循环选项-->
|
||||
<c:forEach var="optionlist" items="${titlelist.optionlist}">
|
||||
<div style="width: 100%;color: red;">
|
||||
<c:if test="${optionlist.optionvalue=='T'}">
|
||||
<input type="checkbox" name="option" id="${optionlist.optionid}" value="${optionlist.optionid}" style="zoom: 100%;" checked="checked"/>
|
||||
${optionlist.optioncontent}
|
||||
</c:if>
|
||||
<c:if test="${optionlist.optionvalue=='F'}">
|
||||
<input type="checkbox" name="option" id="${optionlist.optionid}" value="${optionlist.optionid}" style="zoom: 100%;"/>
|
||||
${optionlist.optioncontent}
|
||||
</c:if>
|
||||
</div>
|
||||
</c:forEach>
|
||||
<!--答案解析-->
|
||||
<div style="width: 100%;height: 5px;"></div>
|
||||
<div style="width: 100%;color: red;">您的答案:${titlelist.useranswer}</div>
|
||||
<div style="width: 100%;color: red;">答案解析:${titlelist.analysis},本题正确答案为 ${titlelist.rightanswer}</div>
|
||||
<div style="width: 100%;height: 5px;"></div>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
|
||||
</div>
|
||||
<div style="width: 2%;height: auto;"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="doclose()">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">确定</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
283
WebRoot/jsp/exam/questForSelect.jsp
Normal file
283
WebRoot/jsp/exam/questForSelect.jsp
Normal file
@ -0,0 +1,283 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchUser = function() {
|
||||
$("#table_user").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelect(dialog,grid) {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
datas_name="";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
});
|
||||
$.post(ext.contextPath + '/question/questtype/getQuestTypesByIds.do', {ids : datas}, function(resp) {
|
||||
$.each(resp, function(index, item){
|
||||
if(datas_name!=""){
|
||||
datas_name+=",";
|
||||
}
|
||||
datas_name+=item.name;
|
||||
});
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
$(".modal-backdrop").remove();
|
||||
closeModal("user4SelectModal")
|
||||
},'json');
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${users}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${users}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${users}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name_user').val()
|
||||
};
|
||||
var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function() {
|
||||
$("#searchForm_User").attr("onsubmit", "return false;");
|
||||
$("#search_name_user").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车执行查询
|
||||
doSearchUser();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
/* $("#search_pid").select2({
|
||||
ajax: {
|
||||
type:'POST',
|
||||
url: ext.contextPath +"/work/group/getListForSelect.do",
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: data
|
||||
}
|
||||
},
|
||||
cache: true
|
||||
},
|
||||
placeholder:'请选择部门',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
}); */
|
||||
//$("#active").select2({minimumResultsForSearch: -1}).val("${menu.active}").trigger("change");
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText:'是',
|
||||
offText:'否',
|
||||
size:"small",
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table=$("#table_user").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/question/questtype/getQuestTypeList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'ord', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'name',
|
||||
title: "题型",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '100%'
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_user");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
if('check'==e.type){
|
||||
obj.parent().addClass("checked");
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
}
|
||||
//adjustBootstrapTableView("table_user");
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="user4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="width:100%">
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
|
||||
<div class="box-header">
|
||||
<!-- tools box -->
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
|
||||
style="margin-right: 5px;">
|
||||
<i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<!-- /. tools -->
|
||||
<i class="fa fa-search"></i>
|
||||
</div>
|
||||
<div class="box-body collapse" >
|
||||
<form class="form-horizontal" id="searchForm_User">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<!-- <label class="col-sm-2 control-label">部门</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="search_pid" name ="search_pid" style="width:170px;"></select>
|
||||
</div> -->
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_name_user" name="search_name_user" class="form-control input-sm" placeholder="名称" style="width:170px;">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">只看选中</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id ="switchBtn" type="checkbox" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
|
||||
<div class=" col-sm-offset-6 button-group" style="padding: 0;">
|
||||
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchUser();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_user" style="height:230px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
254
WebRoot/jsp/exam/questionnaire.jsp
Normal file
254
WebRoot/jsp/exam/questionnaire.jsp
Normal file
@ -0,0 +1,254 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title>
|
||||
<%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$.post(ext.contextPath + "/exam/daytestrecord/publishdaytest.do", $("#subForm").serialize(), function(data) {
|
||||
var arr= JSON.parse(JSON.stringify(data));
|
||||
if (arr.res == 1){
|
||||
swal({
|
||||
text: "题目准备完毕",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(willDelete =>{
|
||||
if (willDelete) {
|
||||
dodaytestpapaer(arr.daytestRecordid);
|
||||
}
|
||||
});
|
||||
}else if(arr.res == 0){
|
||||
swal("题目准备失败!");
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
// }
|
||||
}
|
||||
|
||||
//打开每日一练
|
||||
var dodaytestpapaer = function(id) {
|
||||
var daytestrecordid = id;
|
||||
$.post(ext.contextPath + '/exam/daytestrecord/questionnairepaper.do',{daytestrecordid:daytestrecordid,visitorsID: '${param.visitorsID}'}, function(data) {
|
||||
// console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
function doclose() {
|
||||
closeModal('subModal');
|
||||
}
|
||||
var showSubject4SelectsFun = function() {
|
||||
var userIds= $("#subjecttypeids").val();
|
||||
$.post(ext.contextPath + '/question/subjecttype/subjectForSelect.do', {formId:"subForm2",hiddenId:"subjecttypeids",textId:"subjectName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showRanktype4SelectsFun = function() {
|
||||
var userIds= $("#ranktypeids").val();
|
||||
$.post(ext.contextPath + '/question/ranktype/rankForSelect.do', {formId:"subForm2",hiddenId:"ranktypeids",textId:"rankName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showQuesttype4SelectsFun = function() {
|
||||
var userIds= $("#questtypeids").val();
|
||||
$.post(ext.contextPath + '/question/questtype/questForSelect.do', {formId:"subForm2",hiddenId:"questtypeids",textId:"questName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
function selectnode(){
|
||||
// console.log($('#companytree1').treeview('getChecked'));
|
||||
var arr = $('#companytree1').treeview('getChecked');
|
||||
var ids = "";
|
||||
var texts = "";
|
||||
for(var i=0;i<arr.length;i++){
|
||||
ids+= arr[i].id+",";
|
||||
texts+= arr[i].text+",";
|
||||
}
|
||||
// console.log(ids);
|
||||
$("#cname_input1").val(texts);
|
||||
$("#subjecttypeids").val(ids);
|
||||
document.getElementById('company_select').style.display = "none";
|
||||
$("ul#company_select").hide();
|
||||
}
|
||||
|
||||
function selected(data){
|
||||
if(data.fatherId == undefined){
|
||||
for (var i = 0; i < data.nodes.length; i++) {
|
||||
$("#companytree1").treeview('checkNode', [ data.nodes[i], {silent: true}]);
|
||||
}
|
||||
}else{
|
||||
var parentNode = $('#companytree1').treeview('getParent', data.nodeId);
|
||||
$("#companytree1").treeview('checkNode', [ parentNode, {silent: true}]);
|
||||
}
|
||||
}
|
||||
|
||||
function unSelected(node){
|
||||
if(node.fatherId == undefined){
|
||||
for (var i = 0; i < node.nodes.length; i++) {
|
||||
$("#companytree1").treeview('uncheckNode', [ node.nodes[i], {silent: true}]);
|
||||
}
|
||||
}else{
|
||||
var parentNode = $('#companytree1').treeview('getParent', node.nodeId);
|
||||
var num;
|
||||
for (var i = 0; i < parentNode.nodes.length; i++) {
|
||||
if(parentNode.nodes[i].state.checked == true){
|
||||
num=1;
|
||||
}
|
||||
}
|
||||
if(num!=1){
|
||||
$("#companytree1").treeview('uncheckNode', [ parentNode, {silent: true}]);
|
||||
}
|
||||
console.log(parentNode);
|
||||
}
|
||||
}
|
||||
|
||||
//输入框验证
|
||||
// $("#subForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// project: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '名称不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
$(function () {
|
||||
//树(工作领域)
|
||||
$.post(ext.contextPath + '/question/subjecttype/getSubjecttypeJson.do', { ng: '' }, function (data) {
|
||||
//console.log("data",data[0]);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid1").val(data[0].id);
|
||||
$("#companyselect1").hide();
|
||||
$("#companyName1").text("公司:" + data[0].text);
|
||||
// showtable();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
// $("#search_pid1").val(data[0].id);
|
||||
// $("#cname_input1").val(data[0].text);
|
||||
// showtable();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree1').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
showCheckbox: true,
|
||||
levels: 1,
|
||||
hierarchicalCheck:true,//级联勾选
|
||||
// onNodeChecked : function(event, data) {
|
||||
// //点击选中
|
||||
// selected(data);
|
||||
// },
|
||||
// onNodeUnchecked : function(event, node){
|
||||
// //点击取消
|
||||
// unSelected(node);
|
||||
// }
|
||||
});
|
||||
// $('#companytree1').on('nodeSelected', function (event, data) {
|
||||
// var nodesnum=0;
|
||||
// if(data.nodes!=null){
|
||||
// nodesnum=data.nodes.length;
|
||||
// }else{
|
||||
// nodesnum=nodesnum;
|
||||
// }
|
||||
|
||||
// if(nodesnum==0){
|
||||
// $("#search_pid1").val(data.id);
|
||||
// $("#cname_input1").val(data.text);
|
||||
// document.getElementById('company_select').style.display = "none";
|
||||
// $("ul#company_select").hide();
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// }
|
||||
|
||||
|
||||
// // $("ul#company_select").hide();
|
||||
// });
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
|
||||
//防止点击树收起下拉框
|
||||
$("#company_select").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
//点击树之外其他区域收起
|
||||
$(document).click(function(){
|
||||
$("#company_select").hide();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<body class="hold-transition sidebar-mini" >
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box box-primary text-center">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">调查问卷</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-12" id="box-body">为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,我们非常重视每位用户的宝贵意见,期待您的参与!现在我们就马上开始吧!</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">开始</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
502
WebRoot/jsp/exam/questionnairepaper.jsp
Normal file
502
WebRoot/jsp/exam/questionnairepaper.jsp
Normal file
@ -0,0 +1,502 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
|
||||
.hiddenscroll::-webkit-scrollbar{
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
var addDetailFun = function() {
|
||||
var questitleid=$('#id').val();
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/exam/examTitleRange/showExamTitleRangeAdd.do' ,{questitleid:questitleid}, function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#examuserids").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"editForm",hiddenId:"examuserids",textId:"_auditMan",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var typechange = function(){
|
||||
if($("#examtype").val()=="正式考试"){
|
||||
$("#frequency-div").hide();
|
||||
// $("#frequency").attr("value","");
|
||||
}else if($("#examtype").val()=="模拟考试"){
|
||||
$("#frequency-div").show();
|
||||
}
|
||||
}
|
||||
|
||||
//下一题
|
||||
var donext = function() {
|
||||
var quesnum = $("#quesnum");
|
||||
$.post(ext.contextPath + '/exam/examrecord/donext.do', {quesnum:quesnum} , function(data) {
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
//初始化题目
|
||||
var init = function(){
|
||||
var quesnum = $("#quesnum");
|
||||
var examrecordid = $('#examrecordid');
|
||||
// console.log(quesnum);
|
||||
// console.log(examrecordid);
|
||||
$.post(ext.contextPath + '/exam/examrecord/doexamhtml.do', {quesnum:quesnum,examrecordid:examrecordid} , function(data) {
|
||||
$('#examhtml').html(data);
|
||||
});
|
||||
};
|
||||
// 保存用户答案
|
||||
var saveanswer = function(){
|
||||
var quesid = $("#quesid").val();
|
||||
var daytestrecordid = $('#daytestrecordid').val();
|
||||
var questype = $('#questype').val();
|
||||
var useranswer = '';
|
||||
// console.log(questype);
|
||||
if(questype == '填空题'){
|
||||
// console.log("1");
|
||||
useranswer= $('#useranswer').val();
|
||||
// console.log(useranswer);
|
||||
}else{
|
||||
var id_array=new Array();
|
||||
$('input[name="option"]:checked').each(function(){
|
||||
id_array.push($(this).attr('id'));//向数组中添加元素
|
||||
});
|
||||
useranswer=id_array.join(',');//将数组元素连接起来以构建一个字符串
|
||||
// console.log("2"+useranswer);
|
||||
}
|
||||
$.post(ext.contextPath + '/exam/daytestrecord/dosaveanswer.do', {quesid:quesid,useranswer:useranswer,questype:questype,visitorsID: '${param.visitorsID}'} , function(data) {
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
切换上下题
|
||||
*/
|
||||
function doSwitch(switchtype){//switchtype为上一个/下一个的切换类型 quesnum 为当前题序号
|
||||
//切换之前先保存用户答案
|
||||
saveanswer();
|
||||
//隐藏答案区域
|
||||
$("#analysis").hide();
|
||||
//变色
|
||||
var quesallcount = $('#quesallcount').val();
|
||||
var quesnum = $('#quesnum').val();
|
||||
var daytestrecordid = $('#daytestrecordid').val();
|
||||
// console.log(examrecordid);
|
||||
$.post("<%=request.getContextPath()%>/exam/daytestrecord/dodaytesthtml.do",{switchtype:switchtype,quesnum:quesnum,daytestrecordid:daytestrecordid},function(data){
|
||||
if(data==1){
|
||||
swal("没有上一道题了");
|
||||
}else if(data == 2){
|
||||
swal("问卷到此结束,感谢您的参与!");
|
||||
// fullscreen();
|
||||
$("#box-body").html("问卷到此结束,感谢您的参与!");
|
||||
$("#btn_save").hide();
|
||||
$(".modal-backdrop").remove();
|
||||
closeModal('subModal');
|
||||
//最后一题,打开题目解析
|
||||
//openanalysis(daytestrecordid);
|
||||
}else{
|
||||
var arr= JSON.parse(data);
|
||||
var questitlediv = '<div>'+arr.quesnum+'、'+arr.quesdescript+'</div>';
|
||||
var progress = '当前第'+arr.quesnum+'题,总共'+quesallcount+'题';
|
||||
var questoptiondiv = '';
|
||||
// console.log(arr.rows);
|
||||
if(arr.questype=='填空题'){
|
||||
questoptiondiv += '<div><input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="'+arr.useranswer+'" placeholder="请填写此处"/>'+
|
||||
'</div>';
|
||||
}else if(arr.questype=='多选题'){
|
||||
var array = arr.useranswer.split(",");
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
var count = 0;
|
||||
for(var j = 0;j<array.length;j++){
|
||||
count++;
|
||||
if(arr.rows[i].optionid == array[j]){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}else{
|
||||
if(count == array.length){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// console.log("aaa"+i);
|
||||
}
|
||||
}else if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
if(arr.rows[i].optionid == arr.useranswer){
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
}else{
|
||||
questoptiondiv += '<div><input type="radio" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$('#questitlediv').html(questitlediv);
|
||||
$('#questoptiondiv').html(questoptiondiv);
|
||||
$('#progress').html(progress);
|
||||
$("#quesnum").val(arr.quesnum);
|
||||
$("#quesid").val(arr.quesid);
|
||||
$('#questype').val(arr.questype);
|
||||
$('#leftquesttype').html(arr.questype);
|
||||
if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
$('#questypenamediv').html(arr.questype+":");
|
||||
}else if(arr.questype=='多选题'){
|
||||
$('#questypenamediv').html(arr.questype+":");
|
||||
}else if(arr.questype=='填空题'){
|
||||
$('#questypenamediv').html(arr.questype+":");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
//打开题目解析
|
||||
var openanalysis = function(id) {
|
||||
var daytestrecordid = id;
|
||||
$.post(ext.contextPath + '/exam/daytestrecord/openanalysis.do',{daytestrecordid:daytestrecordid}, function(data) {
|
||||
// console.log(data);
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
function dojumpques(id){
|
||||
var examrecordid = $('#examrecordid').val();
|
||||
var questitleid = id;
|
||||
$.post(ext.contextPath + '/exam/examrecord/dojumpques.do', {examrecordid:examrecordid,questitleid:questitleid} , function(data) {
|
||||
// console.log(data);
|
||||
var arr= JSON.parse(data);
|
||||
var questitlediv = '<div>'+arr.quesnum+'、'+arr.quesdescript+'</div>';
|
||||
var questoptiondiv = '';
|
||||
console.log(arr.rows);
|
||||
if(arr.questype=='填空题'){
|
||||
questoptiondiv += '<div><input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="'+arr.useranswer+'" placeholder="请填写此处"/>'+
|
||||
'</div>';
|
||||
}else if(arr.questype=='多选题'){
|
||||
var array = arr.useranswer.split(",");
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
var count = 0;
|
||||
for(var j = 0;j<array.length;j++){
|
||||
count++;
|
||||
if(arr.rows[i].optionid == array[j]){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}else{
|
||||
if(count == array.length){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// console.log("aaa"+i);
|
||||
}
|
||||
}else if(arr.questype=='单选题' || arr.questype=='判断题'){
|
||||
for(var i = 0;i<arr.rows.length;i++){
|
||||
if(arr.rows[i].optionid == arr.useranswer){
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" checked="checked"/>'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
}else{
|
||||
questoptiondiv += '<div><input type="checkbox" style="zoom: 140%;" name="option" id="'+arr.rows[i].optionid+'" value="'+arr.rows[i].optionid+'" />'+
|
||||
''+arr.rows[i].optionx+"."+arr.rows[i].optioncontent+'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$('#questitlediv').html(questitlediv);
|
||||
$('#questoptiondiv').html(questoptiondiv);
|
||||
$("#quesnum").val(arr.quesnum);
|
||||
$("#quesid").val(arr.quesid);
|
||||
$('#questype').val(arr.questype);
|
||||
$('#leftquesttype').html(arr.questype);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//交卷功能
|
||||
var dosendpaper = function() {
|
||||
//交卷之前先保存用户最后一题答案
|
||||
saveanswer();
|
||||
|
||||
var examrecordid = $("#examrecordid").val();
|
||||
|
||||
swal({
|
||||
title: "您确定要交卷吗?",
|
||||
// text:"这将花费大约几秒的时间",
|
||||
dangerMode: true,
|
||||
icon: "warning",
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
|
||||
$.post(ext.contextPath + '/exam/examrecord/dosendpaper.do', {examrecordid:examrecordid} , function(data) {
|
||||
exitfullscreen();
|
||||
swal("交卷成功!");
|
||||
closeModal('subModal');
|
||||
location.reload();
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//获取当前时间
|
||||
function time() {
|
||||
//获得显示时间的div
|
||||
t_div = document.getElementById('nowtime');
|
||||
var now = new Date()
|
||||
//替换div内容
|
||||
// t_div.innerHTML = "现在是" + now.getFullYear() + "年" + (now.getMonth() + 1) + "月" + now.getDate() + "日" + now.getHours() + "时" + now.getMinutes() + "分" + now.getSeconds() + "秒";
|
||||
var hours = now.getHours();
|
||||
var min = now.getMinutes();
|
||||
var sec = now.getSeconds();
|
||||
if(hours<10){
|
||||
hours = "0"+hours;
|
||||
}
|
||||
if(min<10){
|
||||
min = "0"+min;
|
||||
}
|
||||
if(sec<10){
|
||||
sec = "0"+sec;
|
||||
}
|
||||
t_div.innerHTML = hours + ":" + min + ":" + sec;
|
||||
//等待一秒钟后调用time方法,由于settimeout在time方法内,所以可以无限调用
|
||||
setTimeout(time, 1000);
|
||||
}
|
||||
|
||||
//全屏功能 F11
|
||||
function fullscreen(){
|
||||
//全屏
|
||||
var docElm = document.documentElement;
|
||||
//W3C
|
||||
if(docElm.requestFullscreen) {
|
||||
docElm.requestFullscreen();
|
||||
}
|
||||
|
||||
//FireFox
|
||||
else if(docElm.mozRequestFullScreen) {
|
||||
docElm.mozRequestFullScreen();
|
||||
}
|
||||
|
||||
//Chrome等
|
||||
else if(docElm.webkitRequestFullScreen) {
|
||||
docElm.webkitRequestFullScreen();
|
||||
}
|
||||
|
||||
//IE11
|
||||
else if(elem.msRequestFullscreen) {
|
||||
elem.msRequestFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
//退出全屏
|
||||
function exitfullscreen(){
|
||||
//W3C
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
}
|
||||
//FireFox
|
||||
else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
}
|
||||
//Chrome等
|
||||
else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
}
|
||||
//IE11
|
||||
else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
//题目标记功能
|
||||
function domarkques(){
|
||||
var testpaperid = $('#quesid').val();
|
||||
$.post(ext.contextPath + '/exam/examrecord/domarkques.do', {testpaperid:testpaperid} , function(data) {
|
||||
console.log(data);
|
||||
$("#"+data).css({
|
||||
"border-color":"#E7505A",
|
||||
"background":"#E7505A",
|
||||
});
|
||||
$("#"+data+"000").css({
|
||||
'color':'white',
|
||||
});
|
||||
|
||||
swal("标记成功");
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//题目解析
|
||||
function doanalysis(){
|
||||
$("#analysis").css({
|
||||
display: "block",
|
||||
});
|
||||
}
|
||||
|
||||
function doclose() {
|
||||
swal({
|
||||
title: "您确定要退出吗?",
|
||||
// text:"这将花费大约几秒的时间",
|
||||
dangerMode: true,
|
||||
icon: "warning",
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
swal("退出成功!");
|
||||
closeModal('subModal');
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function () {
|
||||
var examPlanId=$('#id').val();
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">调查问卷</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="quesnum" id="quesnum" value="${quesnum}" />
|
||||
<input type="hidden" name="quesallcount" id="quesallcount" value="${quesallcount}" />
|
||||
<input type="hidden" name="quesid" id="quesid" value="${quesid}" />
|
||||
<input type="hidden" name="daytestrecordid" id="daytestrecordid" value="${daytestrecordid}" />
|
||||
<input type="hidden" name="questype" id="questype" value="${questypename}" />
|
||||
<input type="hidden" name="questitlenum" id="questitlenum" value="${questitlenum}" />
|
||||
<input type="hidden" name="examtime" id="examtime" value="${examtime}" />
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h3 id="questypenamediv" style="width: 100%;">
|
||||
<!-- 判断题型 -->
|
||||
<c:if test="${questypename == '单选题'}">
|
||||
单选题:
|
||||
</c:if>
|
||||
<c:if test="${questypename == '判断题'}">
|
||||
判断题:
|
||||
</c:if>
|
||||
<c:if test="${questypename == '多选题'}">
|
||||
多选题:
|
||||
</c:if>
|
||||
<c:if test="${questypename == '填空题'}">
|
||||
填空题:
|
||||
</c:if>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<h3 id="progress" style="width: 100%;">
|
||||
当前第${quesnum}题,总共${quesallcount}题
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<!--横版-->
|
||||
<h4 id="questitlediv">${quesnum}、${questitle}</h4>
|
||||
<h4 id="questoptiondiv" >
|
||||
<!--判断填空题-->
|
||||
<c:if test="${questypename == '填空题'}">
|
||||
<div>
|
||||
<input type="text" name="useranswer" id="useranswer" style="width: 90%;" value="" placeholder="请填写此处"/>'+
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '多选题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="checkbox" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optionx}.${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${questypename == '单选题' || questypename == '判断题'}">
|
||||
<c:forEach var="quesoptionlist" items="${quesoptionlist}">
|
||||
<div>
|
||||
<input type="radio" name="option" id="${quesoptionlist.optionid}" value="${quesoptionlist.optionid}" style="zoom: 140%;"/>
|
||||
${quesoptionlist.optionx}.${quesoptionlist.optioncontent}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer text-center">
|
||||
<button type="button" class="btn btn-primary" onclick="doSwitch('next')" >确定</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
</div>
|
||||
289
WebRoot/jsp/exam/rankForSelect.jsp
Normal file
289
WebRoot/jsp/exam/rankForSelect.jsp
Normal file
@ -0,0 +1,289 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchUser = function() {
|
||||
$("#table_user").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelect(dialog,grid) {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
datas_name="";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
});
|
||||
$.post(ext.contextPath + '/question/ranktype/getRankTypesByIds.do', {ids : datas}, function(resp) {
|
||||
$.each(resp, function(index, item){
|
||||
if(datas_name!=""){
|
||||
datas_name+=",";
|
||||
}
|
||||
datas_name+=item.name;
|
||||
});
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
$(".modal-backdrop").remove();
|
||||
closeModal("user4SelectModal")
|
||||
},'json');
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${users}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${users}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${users}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name_user').val()
|
||||
};
|
||||
var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function() {
|
||||
$("#searchForm_User").attr("onsubmit", "return false;");
|
||||
$("#search_name_user").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车执行查询
|
||||
doSearchUser();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
/* $("#search_pid").select2({
|
||||
ajax: {
|
||||
type:'POST',
|
||||
url: ext.contextPath +"/work/group/getListForSelect.do",
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: data
|
||||
}
|
||||
},
|
||||
cache: true
|
||||
},
|
||||
placeholder:'请选择部门',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
}); */
|
||||
//$("#active").select2({minimumResultsForSearch: -1}).val("${menu.active}").trigger("change");
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText:'是',
|
||||
offText:'否',
|
||||
size:"small",
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table=$("#table_user").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/question/ranktype/getRankTypeList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'ord', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'name',
|
||||
title: "难度名称",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '50%'
|
||||
},{
|
||||
field: 'difficultyrank',
|
||||
title: "难易度",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '50%'
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_user");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
if('check'==e.type){
|
||||
obj.parent().addClass("checked");
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
}
|
||||
//adjustBootstrapTableView("table_user");
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="user4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="width:100%">
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
|
||||
<div class="box-header">
|
||||
<!-- tools box -->
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
|
||||
style="margin-right: 5px;">
|
||||
<i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<!-- /. tools -->
|
||||
<i class="fa fa-search"></i>
|
||||
</div>
|
||||
<div class="box-body collapse" >
|
||||
<form class="form-horizontal" id="searchForm_User">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<!-- <label class="col-sm-2 control-label">部门</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="search_pid" name ="search_pid" style="width:170px;"></select>
|
||||
</div> -->
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_name_user" name="search_name_user" class="form-control input-sm" placeholder="名称" style="width:170px;">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">只看选中</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id ="switchBtn" type="checkbox" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
|
||||
<div class=" col-sm-offset-6 button-group" style="padding: 0;">
|
||||
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchUser();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_user" style="height:230px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
283
WebRoot/jsp/exam/subjectForSelect.jsp
Normal file
283
WebRoot/jsp/exam/subjectForSelect.jsp
Normal file
@ -0,0 +1,283 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchUser = function() {
|
||||
$("#table_user").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelect(dialog,grid) {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
datas_name="";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
});
|
||||
$.post(ext.contextPath + '/question/subjecttype/getSubjectTypesByIds.do', {ids : datas}, function(resp) {
|
||||
$.each(resp, function(index, item){
|
||||
if(datas_name!=""){
|
||||
datas_name+=",";
|
||||
}
|
||||
datas_name+=item.name;
|
||||
});
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
$(".modal-backdrop").remove();
|
||||
closeModal("user4SelectModal")
|
||||
},'json');
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
$.each(eval('${users}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${users}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${users}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name_user').val()
|
||||
};
|
||||
var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function() {
|
||||
$("#searchForm_User").attr("onsubmit", "return false;");
|
||||
$("#search_name_user").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车执行查询
|
||||
doSearchUser();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
/* $("#search_pid").select2({
|
||||
ajax: {
|
||||
type:'POST',
|
||||
url: ext.contextPath +"/work/group/getListForSelect.do",
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: data
|
||||
}
|
||||
},
|
||||
cache: true
|
||||
},
|
||||
placeholder:'请选择部门',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
}); */
|
||||
//$("#active").select2({minimumResultsForSearch: -1}).val("${menu.active}").trigger("change");
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText:'是',
|
||||
offText:'否',
|
||||
size:"small",
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table=$("#table_user").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/question/subjecttype/getSubjectTypeList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'name', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'name',
|
||||
title: "工作领域",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '100%'
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_user");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
if('check'==e.type){
|
||||
obj.parent().addClass("checked");
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
}
|
||||
//adjustBootstrapTableView("table_user");
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="user4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="width:100%">
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
|
||||
<div class="box-header">
|
||||
<!-- tools box -->
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
|
||||
style="margin-right: 5px;">
|
||||
<i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<!-- /. tools -->
|
||||
<i class="fa fa-search"></i>
|
||||
</div>
|
||||
<div class="box-body collapse" >
|
||||
<form class="form-horizontal" id="searchForm_User">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<!-- <label class="col-sm-2 control-label">部门</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="search_pid" name ="search_pid" style="width:170px;"></select>
|
||||
</div> -->
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_name_user" name="search_name_user" class="form-control input-sm" placeholder="名称" style="width:170px;">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">只看选中</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id ="switchBtn" type="checkbox" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
|
||||
<div class=" col-sm-offset-6 button-group" style="padding: 0;">
|
||||
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchUser();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_user" style="height:230px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user