添加切换页数

This commit is contained in:
强 杨 2023-09-21 11:09:46 +08:00
parent 9d99b99ba6
commit f27ff2b368
3 changed files with 378 additions and 311 deletions

View File

@ -4,88 +4,112 @@
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"> <head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>导入外部答题卡制作模板</title> <title>导入外部答题卡制作模板</title>
<script src="../js/jquery-1.10.2.min.js"></script> <script src="../js/jquery-1.10.2.min.js"></script>
<link href="../css/default.css" rel="stylesheet" /> <link href="../css/default.css" rel="stylesheet" />
</head> </head>
<body> <body>
<div class="divBG backgroundGo" style=" display:none;"></div> <div class="divBG backgroundGo" style="display: none;"></div>
<div class="divbgbox backgroundGo" style=" display:none;"> <div class="divbgbox backgroundGo" style="display: none;">
<input type="hidden" value="" id="TiMU_num" /> <input type="hidden" value="" id="TiMU_num" />
<input type="hidden" value="" id="TiMU_Type" /> <input type="hidden" value="" id="TiMU_Type" />
<h3 id="divbig_title">单选题15题</h3> <h3 id="divbig_title">单选题15题</h3>
<div style="width:100%;margin-top:10px; font-size:14px; display:none;" id="scoreShow"> <div style="width: 100%; margin-top: 10px; font-size: 14px; display: none;" id="scoreShow">
分数设置: 分数设置:
<select style="font-size:14px; padding:5PX; padding-left:10px; padding-right:10px;" id="git_fix"> <select style="font-size: 14px; padding: 5PX; padding-left: 10px; padding-right: 10px;" id="git_fix">
<option></option> <option></option>
</select> </select>
</div> </div>
<div style="width:100%;margin-top:10px; font-size:14px; display:none;" id="dfxShow"> <div style="width: 100%; margin-top: 10px; font-size: 14px; display: none;" id="dfxShow">
打分项设定: 打分项设定:
<select style="font-size:14px; padding:5PX; padding-left:10px; padding-right:10px;" id="git_sd_fix"> <select style="font-size: 14px; padding: 5PX; padding-left: 10px; padding-right: 10px;" id="git_sd_fix">
<option value="5">5</option> <option value="5">5</option>
<option value="4.5">4.5</option> <option value="4.5">4.5</option>
<option value="4">4</option> <option value="4">4</option>
<option value="3.5">3.5</option> <option value="3.5">3.5</option>
<option value="3">3</option> <option value="3">3</option>
<option value="2.5">2.5</option> <option value="2.5">2.5</option>
<option value="2">2</option> <option value="2">2</option>
<option value="1.5">1.5</option> <option value="1.5">1.5</option>
<option value="1">1</option> <option value="1">1</option>
<option value=".5">.5</option> <option value=".5">.5</option>
</select> </select>
</div>
<div style="width: 100%; margin-top: 10px; font-size: 14px;">
<input type="button" style="width: 100px; height: 30px;" value="确定" onclick="GoChange()" />
<input type="button" style="width: 100px; height: 30px;" onclick="DeleteUpdateBaseData()" value="取消" />
</div>
</div> </div>
<div style="width:100%;margin-top:10px; font-size:14px;">
<input type="button" style="width:100px; height:30px;" value="确定" onclick="GoChange()" />
<input type="button" style="width:100px; height:30px;" onclick="DeleteUpdateBaseData()" value="取消" />
</div>
</div>
<input type="text" style=" display:none;" value="<%=isHand %>" id="hd_isHand" /> <input type="text" style="display: none;" value="<%=isHand %>" id="hd_isHand" />
<input type="text" style=" display:none;" value="<%=Bindlist %>" id="Bindlist" /> <input type="text" style="display: none;" value="<%=Bindlist %>" id="Bindlist" />
<input type="text" style=" display:none;" value="<%=TempID %>" id="TempID" /> <input type="text" style="display: none;" value="<%=TempID %>" id="TempID" />
<input type="text" style=" display:none;" value="<%=isLocked %>" id="isLocked" /> <input type="text" style="display: none;" value="<%=AnotherTempID %>" id="AnotherTempID" />
<input type="text" style=" display:none;" value="<%=tenant %>" id="tenant" /> <input type="text" style="display: none;" value="<%=isLocked %>" id="isLocked" />
<input type="text" style=" display:none;" value="<%=PageIndex %>" id="PageIndex" /> <input type="text" style="display: none;" value="<%=tenant %>" id="tenant" />
<input type="text" style=" display:none;" value="<%=MainTempId %>" id="MainTempId" /> <input type="text" style="display: none;" value="<%=PageIndex %>" id="PageIndex" />
<input type="text" style="display: none;" value="<%=MainTempId %>" id="MainTempId" />
<input type="text" style="display: none;" value="<%=PageCount %>" id="PageCount" />
<textarea id="HideAreaText" style=" display:none;"><%=HideAreaText %></textarea> <textarea id="HideAreaText" style="display: none;"><%=HideAreaText %></textarea>
<input id="IsPostionValue" type="text" style="display:none;" value="<%=IsPostionValue %>" /> <input id="IsPostionValue" type="text" style="display: none;" value="<%=IsPostionValue %>" />
<input type="hidden" id="pager_A" value="<%=pager %>" /> <input type="hidden" id="pager_A" value="<%=pager %>" />
<div class="main"> <div class="main">
<div class="main_tool"> <div class="main_tool">
<table> <table>
<tr> <tr>
<th class="lockHide" >选定锚点</th> <th style="display: none" class="lockHide">选定锚点</th>
<td class="lockHide" valign="middle"> <td style="display: none" class="lockHide" valign="middle">
<div class="maodian" id="point_0" >左上锚点</div> <div class="maodian" id="point_0">左上锚点</div>
<div class="maodian" id="point_1">右上锚点</div> <div class="maodian" id="point_1">右上锚点</div>
<div class="maodian" id="point_2">左下锚点</div> <div class="maodian" id="point_2">左下锚点</div>
<div class="maodian" id="point_3">右下锚点</div> <div class="maodian" id="point_3">右下锚点</div>
</td> </td>
<td class="lockHide"> <td style="padding: 0;" valign="top" class="lockHide">
<% if (PageIndex == "1") { %>
<div class="tiaomasz_hover">第一页</div>
<% }
else
{ %>
<div class="tiaomasz" onclick="ChangePageNum(<%=AnotherTempID %>)">第一页</div>
<% } %>
</td>
<% if (PageCount >1) { %>
<td style="padding: 0;" valign="top" class="lockHide">
<% if (PageIndex == "2") { %>
<div class="tiaomasz_hover">第二页</div>
<% }
else
{ %>
<div class="tiaomasz" onclick="ChangePageNum(<%=AnotherTempID %>)">第二页</div>
<% } %>
</td>
<% } %>
<td class="lockHide">
<span>纸张类型:</span> <span>纸张类型:</span>
<select id="selectPageSize" disabled onchange="ChangePageSize(this)" style="font-size:14px; padding-left:10px; padding-right:20px; width:100px;"> <select id="selectPageSize" disabled onchange="ChangePageSize(this)" style="font-size: 14px; padding-left: 10px; padding-right: 20px; width: 100px;">
<option value="1200">A4</option> <option value="1200">A4</option>
<option value="1570">A3</option> <option value="1570">A3</option>
</select> </select>
</td> </td>
<th valign="middle" class="lockHide"> <th valign="middle" class="lockHide">
<div class="main_select_one"> <div class="main_select_one">
<span>准考证号:</span> <span>准考证号:</span>
<select id="xuehaonum" style="font-size:14px; "> <select id="xuehaonum" style="font-size: 14px;">
<option value="3">3</option> <option value="3">3</option>
<option value="4">4</option> <option value="4">4</option>
<option value="5">5</option> <option value="5">5</option>
<option selected="selected" value="6">6</option> <option selected="selected" value="6">6</option>
<option value="7">7</option> <option value="7">7</option>
<option value="8">8</option> <option value="8">8</option>
<option value="9">9</option> <option value="9">9</option>
<option value="10">10</option> <option value="10">10</option>
<option value="11">11</option> <option value="11">11</option>
<option value="12">12</option> <option value="12">12</option>
@ -94,36 +118,36 @@
</div> </div>
</th> </th>
<td style=" padding:0;" valign="top" class="lockHide"> <td style="padding: 0;" valign="top" class="lockHide">
<div class="tiaomasz" onclick="SetTiaoMa(this)">设置条码</div> <div class="tiaomasz" onclick="SetTiaoMa(this)">设置条码</div>
</td> </td>
<td class="lockHide"> <td class="lockHide">
<div class="quelapsz" onclick="SetWenziQuyu(this)">设置缺考</div> <div class="quelapsz" onclick="SetWenziQuyu(this)">设置缺考</div>
</td> </td>
<td class="lockHide"> <td class="lockHide">
<div class="biaozhundian" onclick="SetBiaoZhunDian(this)">标准涂点</div> <div class="biaozhundian" onclick="SetBiaoZhunDian(this)">标准涂点</div>
</td> </td>
<td class="lockHide"> <td class="lockHide">
<div class="pingbi" onclick="SetHideArea()" >增加屏蔽</div> <div class="pingbi" onclick="SetHideArea()">增加屏蔽</div>
</td> </td>
<td> <td>
<input type="button" id="noButton" style="padding:5px;font-size:14px; padding-left:10px; padding-right:10px; height:40px; " onclick="GetDataTotal(-1,'<%=tenant %>')" value="保存数据" /> <input type="button" id="noButton" style="padding: 5px; font-size: 14px; padding-left: 10px; padding-right: 10px; height: 40px;" onclick="GetDataTotal(-1,'<%=tenant %>')" value="保存数据" />
</td> </td>
<td> <td>
<input type="button" id="ansyButton" style="padding:5px;font-size:14px; padding-left:10px; padding-right:10px;height:40px; " onclick="GetDataTotal(1,'<%=tenant %>')" value="锁定模板" /> <input type="button" id="ansyButton" style="padding: 5px; font-size: 14px; padding-left: 10px; padding-right: 10px; height: 40px;" onclick="GetDataTotal(1,'<%=tenant %>')" value="锁定模板" />
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div style="width:1570px; overflow:hidden;"> <div style="width: 1570px; overflow: hidden;">
<div class="main_papermain"> <div class="main_papermain">
<img id="SelectImg" src="<%=imgage %>" style=" width:100%; float:left; z-index:0; " /> <img id="SelectImg" src="<%=imgage %>" style="width: 100%; float: left; z-index: 0;" />
</div> </div>
</div> </div>
</div> </div>
<div onclick="HideRight(this)" style=" position:fixed;right:0;top:0; z-index:333; height:40px; width:40px; background:#000000; color:#fff; text-align:center; line-height:40px; font-size:12px;">折叠</div> <div onclick="HideRight(this)" style="position: fixed; right: 0; top: 0; z-index: 333; height: 40px; width: 40px; background: #000000; color: #fff; text-align: center; line-height: 40px; font-size: 12px;">折叠</div>
<script> <script>
function HideRight(obj) { function HideRight(obj) {
if ($(obj).html() == "折叠") { if ($(obj).html() == "折叠") {
@ -139,78 +163,87 @@
} }
} }
</script> </script>
<div class="right_list"> <div class="right_list">
<ul class="ul lockHide" > <ul class="ul lockHide">
<li class="hover">客观题设置</li> <li class="hover">客观题设置</li>
<li> <li>
<div style=" text-align:left; padding-left:20px;"> <div style="text-align: left; padding-left: 20px;">
<br /><br /> <br />
题号:<input type="text" id="tihao" placeholder="例:16或者16M1" style="font-size:14px; width:100px;"/>-<input type="text" id="tihao_end" placeholder="例:16或者16M1" value=""style="font-size:14px; width:100px;" /> <br />
<br /> <br /> 题号:<input type="text" id="tihao" placeholder="例:16或者16M1" style="font-size: 14px; width: 100px;" />-<input type="text" id="tihao_end" placeholder="例:16或者16M1" value="" style="font-size: 14px; width: 100px;" />
<label style=" width:80%; margin-left:35px; text-align:left; float:none; color:#f00; margin-top:5px; padding:5px; margin-bottom:5px;">如果以大题下面有小题类型用16M1-16M5表示</label> <br />
<br /><br /><br /> <br />
选项:<select id="selectNum" style="font-size:14px; padding:4px; padding-right:10px;"> <label style="width: 80%; margin-left: 35px; text-align: left; float: none; color: #f00; margin-top: 5px; padding: 5px; margin-bottom: 5px;">如果以大题下面有小题类型用16M1-16M5表示</label>
<option value="1">1</option> <br />
<option value="2">2</option> <br />
<option value="3">3</option> <br />
<option selected="selected" value="4">4</option> 选项:<select id="selectNum" style="font-size: 14px; padding: 4px; padding-right: 10px;">
<option value="5">5</option> <option value="1">1</option>
<option value="6">6</option> <option value="2">2</option>
<option value="7">7</option> <option value="3">3</option>
<option value="8">8</option> <option selected="selected" value="4">4</option>
<option value="9">9</option> <option value="5">5</option>
<option value="10">10</option> <option value="6">6</option>
<option value="11">11</option> <option value="7">7</option>
<option value="12">12</option> <option value="8">8</option>
<option value="13">13</option> <option value="9">9</option>
<option value="14">14</option> <option value="10">10</option>
<option value="15">15</option> <option value="11">11</option>
<option value="16">16</option> <option value="12">12</option>
<option value="17">17</option> <option value="13">13</option>
<option value="18">18</option> <option value="14">14</option>
<option value="19">19</option> <option value="15">15</option>
<option value="20">20</option> <option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
</select>
<label style="padding: 6px; border-radius: 2px;">横向<input checked="checked" type="radio" name="listtype" value="0" style="margin-top: 3px;" /></label>
<label style="padding: 6px; border-radius: 2px;">竖向<input name="listtype" type="radio" value="1" /></label>
<br />
<br />
<br />
类型:<select id="questiontype" style="font-size: 12px; width: 100px;">
<option value="0">单选</option>
<option value="1">多选</option>
<option value="2">判断</option>
</select>
分数:
<select id="questionscroe" style="font-size: 12px; width: 80px; text-align: center;">
<option value="">无分</option>
<option value="0.5">0.5</option>
</select> </select>
<label style="padding:6px; border-radius:2px;">横向<input checked="checked" type="radio" name="listtype" value="0" style="margin-top:3px;" /></label> <br />
<label style="padding:6px; border-radius:2px;">竖向<input name="listtype" type="radio" value="1" /></label> <br />
<br /><br /><br /> <div class="goPeizhi" onclick="SetKeguanTi()">开始配置</div>
类型:<select id="questiontype" style="font-size:12px; width:100px;"> </div>
<option value="0">单选</option> </li>
<option value="1">多选</option> </ul>
<option value="2">判断</option>
</select>
分数:
<select id="questionscroe" style="font-size:12px; width:80px; text-align:center;">
<option value="">无分</option><option value="0.5">0.5</option>
</select>
<br /><br />
<div class="goPeizhi" onclick="SetKeguanTi()">开始配置</div>
</div>
</li>
</ul>
<ul class="ul" style="display:none;"> <ul class="ul" style="display: none;">
<li class="hover" >准考证号识别</li> <li class="hover">准考证号识别</li>
<li> <li>题号:<input id="zhunkaozhenghao" type="text" value="6" />
题号:<input id="zhunkaozhenghao" type="text" value="6" /> <div class="goPeizhi" onclick="SetZunkaoZheng()">开始配置</div>
<div class="goPeizhi" onclick="SetZunkaoZheng()">开始配置</div> </li>
</li> </ul>
</ul>
<ul class="ul lockHide"> <ul class="ul lockHide">
<li class="hover">主观题设置</li> <li class="hover">主观题设置</li>
<li> <li>
<span style="float:left; width:100%; display:block; padding-top:1px; border:0; border:1px solid #ffd800; margin-top:10px; color:#f00">切割成两半 如11题 如 第一半11X1 第二半11X2</span> <span style="float: left; width: 100%; display: block; padding-top: 1px; border: 0; border: 1px solid #ffd800; margin-top: 10px; color: #f00">切割成两半 如11题 如 第一半11X1 第二半11X2</span>
<div style=" margin-top:15px;padding-left:20px; text-align:left;margin-bottom:10px;"> <div style="margin-top: 15px; padding-left: 20px; text-align: left; margin-bottom: 10px;">
题号:<input id="zhuguan_tihao" style="font-size:14px; width:60px;" type="text" value="" />小题:<input id="zhuguan_xiaoti" style=" width:40px;font-size:14px; " type="text" value="0" /> 题号:<input id="zhuguan_tihao" style="font-size: 14px; width: 60px;" type="text" value="" />小题:<input id="zhuguan_xiaoti" style="width: 40px; font-size: 14px;" type="text" value="0" />
分数: 分数:
<select id="zgquestionscroe" style="font-size:14px; width:80px; text-align:center;"> <select id="zgquestionscroe" style="font-size: 14px; width: 80px; text-align: center;">
<option value="">无分</option><option value="0.5">0.5</option> <option value="">无分</option>
</select> <option value="0.5">0.5</option>
<br /><br /> </select>
阅卷分值间隔: <br />
<select id="questionscroetype" style="font-size:14px; width:80px; margin-top:5px; text-align:center;"> <br />
阅卷分值间隔:
<select id="questionscroetype" style="font-size: 14px; width: 80px; margin-top: 5px; text-align: center;">
<option value="5">5分</option> <option value="5">5分</option>
<option value="4.5">4.5分</option> <option value="4.5">4.5分</option>
<option value="4">4分</option> <option value="4">4分</option>
@ -221,54 +254,58 @@
<option value="1.5">1.5分</option> <option value="1.5">1.5分</option>
<option value="1" selected="selected">1分</option> <option value="1" selected="selected">1分</option>
<option value=".5">0.5分</option> <option value=".5">0.5分</option>
</select> </select>
类型: <% if (Request.QueryString["ishand"] == "1")
<select id="questiontype_zg" style="font-size:14px; width:80px; margin-top:5px; text-align:center;"> { %>
<option value="1">大题</option> 类型:
<option value="2">填空题</option> <select id="questiontype_zg" style="font-size: 14px; width: 80px; margin-top: 5px; text-align: center;">
</select> <option value="1">主观题</option>
</div> <option value="2">填空题</option>
</select>
<% } %>
</div>
<br /><br /><br /> <br />
<div style="margin-left:45px;" class="goPeizhi" onclick="SetZhuguanTi()">开始配置</div> <br />
<br />
<div style="margin-left: 45px;" class="goPeizhi" onclick="SetZhuguanTi()">开始配置</div>
<div id="isHand_Py" style="float:left; width:100%; text-align:left; margin-top:10px; border-bottom:1px solid #ddd; padding-bottom:5px;"> <div id="isHand_Py" style="float: left; width: 100%; text-align: left; margin-top: 10px; border-bottom: 1px solid #ddd; padding-bottom: 5px;">
先批后阅题号: 先批后阅题号:
<select id="py_tihao"></select> <select id="py_tihao"></select>
<input type="button" value="题目配置" id="pytimups" onclick="SetPYPostion(0)" style="width:90px;margin-right:10px;" /> <input type="button" value="题目配置" id="pytimups" onclick="SetPYPostion(0)" style="width: 90px; margin-right: 10px;" />
<%-- <input onclick="SetPYPostion(1)" style="width:100px;margin-right:10px;" type="button" value="常规题" />--%> <%-- <input onclick="SetPYPostion(1)" style="width:100px;margin-right:10px;" type="button" value="常规题" />--%>
</div> </div>
</li> </li>
</ul> </ul>
<div style=" width:100%; text-align:center; float:left; padding-bottom:10px; font-size:14px; padding-top:10px; background:#044775; border-top:2px solid #000000; color:#fff;">模板删减区</div> <div style="width: 100%; text-align: center; float: left; padding-bottom: 10px; font-size: 14px; padding-top: 10px; background: #044775; border-top: 2px solid #000000; color: #fff;">模板删减区</div>
<ul id="NowSelect" class="lineul" style="overflow-y:scroll; height:240px; "> <ul id="NowSelect" class="lineul" style="overflow-y: scroll; height: 240px;">
</ul>
</ul> </div>
</div>
<script> <script>
function SelectValueList() { function SelectValueList() {
var html = ""; var html = "";
var score = 0.5; var score = 0.5;
var git_fix = document.getElementById("git_fix"); var git_fix = document.getElementById("git_fix");
var git = document.getElementById("zgquestionscroe"); var git = document.getElementById("zgquestionscroe");
var git00 = document.getElementById("questionscroe"); var git00 = document.getElementById("questionscroe");
git.options[0] = new Option("0分", "0"); git.options[0] = new Option("0分", "0");
git00.options[0] = new Option("0分", "0"); git00.options[0] = new Option("0分", "0");
git_fix.options[0] = new Option("0分", "0"); git_fix.options[0] = new Option("0分", "0");
for (var i = 1; i <= 121; i++) { for (var i = 1; i <= 121; i++) {
score = parseFloat(score) + parseFloat(0.5); score = parseFloat(score) + parseFloat(0.5);
git.options[i] = new Option(score, score); git.options[i] = new Option(score, score);
git00.options[i] = new Option(score, score); git00.options[i] = new Option(score, score);
git_fix.options[i] = new Option(score, score); git_fix.options[i] = new Option(score, score);
} }
} }
SelectValueList(); SelectValueList();
</script> </script>
<script src="../js/index.js"></script> <script src="../js/index.js"></script>
</body> </body>

View File

@ -26,6 +26,7 @@ using System.Security.AccessControl;
public partial class _Default : System.Web.UI.Page public partial class _Default : System.Web.UI.Page
{ {
public long TempID = 0; public long TempID = 0;
public long AnotherTempID = 0;
public string PageIndex = "0"; public string PageIndex = "0";
public string Bindlist = ""; public string Bindlist = "";
public string imgage = ""; public string imgage = "";
@ -37,13 +38,14 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
public string pager = ""; public string pager = "";
public int isHand = 0; public int isHand = 0;
public string MainTempId = "0"; public string MainTempId = "0";
public int PageCount = 0;
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
int action = Globals.Request("action") == "" ? 0 : Convert.ToInt32(Globals.Request("action")); int action = Globals.Request("action") == "" ? 0 : Convert.ToInt32(Globals.Request("action"));
tenant = Globals.Request("tenant") == "" ? 0 : Convert.ToInt64(Globals.Request("tenant")); tenant = Globals.Request("tenant") == "" ? 0 : Convert.ToInt64(Globals.Request("tenant"));
isHand = Globals.Request("isHand") == "" ? 0 : Convert.ToInt32(Globals.Request("isHand")); isHand = Globals.Request("isHand") == "" ? 0 : Convert.ToInt32(Globals.Request("isHand"));
pager = Globals.Request("pager").ToLower() ; pager = Globals.Request("pager").ToLower();
if (action != 0) if (action != 0)
{ {
@ -62,7 +64,8 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
else else
{ {
TempID = Globals.Request("TempID") == "" ? 0 : Convert.ToInt32(Globals.Request("TempID"));//获取小模板ID TempID = Globals.Request("TempID") == "" ? 0 : Convert.ToInt32(Globals.Request("TempID"));//获取小模板ID
if (TempID == 0) { if (TempID == 0)
{
Response.Write("<script>alert('无模板数据');window.close();</script>"); Response.Write("<script>alert('无模板数据');window.close();</script>");
return; return;
} }
@ -76,21 +79,36 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
HideAreaText = dtx.Rows[0]["HideAreaPostionList_nvarchar"] == null ? "" : dtx.Rows[0]["HideAreaPostionList_nvarchar"].ToString(); HideAreaText = dtx.Rows[0]["HideAreaPostionList_nvarchar"] == null ? "" : dtx.Rows[0]["HideAreaPostionList_nvarchar"].ToString();
IsPostionValue = dtx.Rows[0]["HideAreaPostionList_nvarchar"] == null ? "" : dtx.Rows[0]["HideAreaPostionList_nvarchar"].ToString(); IsPostionValue = dtx.Rows[0]["HideAreaPostionList_nvarchar"] == null ? "" : dtx.Rows[0]["HideAreaPostionList_nvarchar"].ToString();
PageIndex = dtx.Rows[0]["PageIndex_int"] == null ? "" : dtx.Rows[0]["PageIndex_int"].ToString(); PageIndex = dtx.Rows[0]["PageIndex_int"] == null ? "" : dtx.Rows[0]["PageIndex_int"].ToString();
sql = "select HasPosition FROM MK_TempleteMain WHERE ID_bigint=" + dtx.Rows[0]["MainID_bigint"].ToString();
MainTempId = dtx.Rows[0]["MainID_bigint"].ToString(); MainTempId = dtx.Rows[0]["MainID_bigint"].ToString();
IsPostionValue = new MysqlDBHelper(tenant).ExecuteScalar(sql).ToString();
sql = "select MainPage_int,HasPosition from MK_TempleteMain where ID_bigint=" + MainTempId;
var maindt = new MysqlDBHelper(tenant).ExecuteQuery(sql);
if (maindt == null || maindt.Rows.Count <= 0)
{
Response.Write("<script>alert('主模板数据有问题');</script>");
return;
}
PageCount = Convert.ToInt32(maindt.Rows[0]["MainPage_int"]);
IsPostionValue = maindt.Rows[0]["HasPosition"].ToString();
if (PageCount > 1)
{
sql = "select ID_bigint from MK_TempleteData where MainID_bigint="+ MainTempId + " and ID_bigint!=" + TempID;
AnotherTempID = Convert.ToInt32(new MysqlDBHelper(tenant).ExecuteScalar(sql));
}
} }
} }
} }
private void UpdateTempData() { private void UpdateTempData()
{
TempID = Globals.Request("TempID") == "" ? 0 : Convert.ToInt32(Globals.Request("TempID"));//获取小模板ID TempID = Globals.Request("TempID") == "" ? 0 : Convert.ToInt32(Globals.Request("TempID"));//获取小模板ID
string totalHtml = Server.UrlDecode(Globals.Request("totalHtml")); string totalHtml = Server.UrlDecode(Globals.Request("totalHtml"));
string HideAreaPostionList= Server.UrlDecode(Globals.Request("HideAreaPostionList")); string HideAreaPostionList = Server.UrlDecode(Globals.Request("HideAreaPostionList"));
if (AnsyTemp(HideAreaPostionList, totalHtml)) { if (AnsyTemp(HideAreaPostionList, totalHtml))
{
string sql = "Update MK_TempleteData SET TempValue_nvarchar=@TempValue_nvarchar,HideAreaPostionList_nvarchar=@HideAreaPostionList_nvarchar where ID_bigint=" + TempID; string sql = "Update MK_TempleteData SET TempValue_nvarchar=@TempValue_nvarchar,HideAreaPostionList_nvarchar=@HideAreaPostionList_nvarchar where ID_bigint=" + TempID;
MySqlParameter[] sp = new MySqlParameter[] { MySqlParameter[] sp = new MySqlParameter[] {
new MySqlParameter("@TempValue_nvarchar",totalHtml), new MySqlParameter("@TempValue_nvarchar",totalHtml),
@ -153,7 +171,8 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
//} //}
} }
private void AddQuestionData(string totalHtml) { private void AddQuestionData(string totalHtml)
{
TempID = Convert.ToInt64(Globals.Request("TempID")); TempID = Convert.ToInt64(Globals.Request("TempID"));
string[] totalHtmlList = totalHtml.Split('$'); string[] totalHtmlList = totalHtml.Split('$');
string kg = totalHtmlList[2]; string kg = totalHtmlList[2];
@ -171,7 +190,8 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
string endNum = detailtList[5].ToUpper(); string endNum = detailtList[5].ToUpper();
string score = detailtList[9]; string score = detailtList[9];
if (score == "") { if (score == "")
{
score = "0"; score = "0";
} }
string selectNum = detailtList[6]; string selectNum = detailtList[6];
@ -253,7 +273,8 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
{ {
mkscoretype = "1"; mkscoretype = "1";
} }
else { else
{
mkscoretype = detailtList[7]; mkscoretype = detailtList[7];
} }
@ -279,12 +300,12 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
/// <summary> /// <summary>
/// 锁定模板数据 /// 锁定模板数据
/// </summary> /// </summary>
public bool AnsyTemp(string HideAreaPostionList,string totalHtml) public bool AnsyTemp(string HideAreaPostionList, string totalHtml)
{ {
try try
{ {
CommonUse commonUse = new CommonUse(); CommonUse commonUse = new CommonUse();
long TempID =Convert.ToInt64(Globals.Request("TempID")); long TempID = Convert.ToInt64(Globals.Request("TempID"));
string sql = "SELECT * FROM MK_TempleteData WHERE ID_bigint=" + TempID; string sql = "SELECT * FROM MK_TempleteData WHERE ID_bigint=" + TempID;
DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql); DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql);
if (dt.Rows.Count <= 0) if (dt.Rows.Count <= 0)
@ -321,7 +342,8 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
Image<Gray, byte> currentFramext = new Image<Gray, byte>(PictureBoxBitMap); Image<Gray, byte> currentFramext = new Image<Gray, byte>(PictureBoxBitMap);
Mat color_mxxx = commonUse.GetPostionXYByFindPostionAndXieLv(imagex.Mat, selected_contours1, GetData[0], out PYPostionList, currentFramext, out xielv); Mat color_mxxx = commonUse.GetPostionXYByFindPostionAndXieLv(imagex.Mat, selected_contours1, GetData[0], out PYPostionList, currentFramext, out xielv);
if (xielv == -100) { if (xielv == -100)
{
Response.Write("模板配置错误,斜率无法计算"); Response.Write("模板配置错误,斜率无法计算");
return false; return false;
} }
@ -337,7 +359,8 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
int PageIndex = Convert.ToInt32(Globals.Request("PageIndex")); int PageIndex = Convert.ToInt32(Globals.Request("PageIndex"));
if (PageIndex == 1) { if (PageIndex == 1)
{
int mx = GetOtherBitmaplist(currentFramext.Mat, 160, PYPostionList.Split(','), GetData[9]); int mx = GetOtherBitmaplist(currentFramext.Mat, 160, PYPostionList.Split(','), GetData[9]);
if (mx == 0) if (mx == 0)
{ {
@ -442,8 +465,8 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
string[] quekao = postiontiaomaX.Split(','); string[] quekao = postiontiaomaX.Split(',');
//int X = Convert.ToInt32(Convert.ToDouble(quekao[0])) - Convert.ToInt32(PYPostion[0]); //int X = Convert.ToInt32(Convert.ToDouble(quekao[0])) - Convert.ToInt32(PYPostion[0]);
//int Y = Convert.ToInt32(Convert.ToDouble(quekao[1])) - Convert.ToInt32(PYPostion[1]); //int Y = Convert.ToInt32(Convert.ToDouble(quekao[1])) - Convert.ToInt32(PYPostion[1]);
int X = Convert.ToInt32(Convert.ToDouble(quekao[0])) ; int X = Convert.ToInt32(Convert.ToDouble(quekao[0]));
int Y = Convert.ToInt32(Convert.ToDouble(quekao[1])) ; int Y = Convert.ToInt32(Convert.ToDouble(quekao[1]));
int W = Convert.ToInt32(Convert.ToDouble(quekao[2])); int W = Convert.ToInt32(Convert.ToDouble(quekao[2]));
int H = Convert.ToInt32(Convert.ToDouble(quekao[3])); int H = Convert.ToInt32(Convert.ToDouble(quekao[3]));
int xuanXiang = 1;//选项数量 int xuanXiang = 1;//选项数量
@ -459,7 +482,7 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
CvInvoke.Threshold(src, mat_threshold, Threshold, 254, Emgu.CV.CvEnum.ThresholdType.BinaryInv); CvInvoke.Threshold(src, mat_threshold, Threshold, 254, Emgu.CV.CvEnum.ThresholdType.BinaryInv);
Mat mat_dilate = commonUse.MyDilate(mat_threshold); Mat mat_dilate = commonUse.MyDilate(mat_threshold);
VectorOfVectorOfPoint selected_contours; VectorOfVectorOfPoint selected_contours;
int option_pixel_options =0; int option_pixel_options = 0;
selected_contours = GetUsefulContoursSelectoOptionQK(mat_dilate, 1, out option_pixel_options); selected_contours = GetUsefulContoursSelectoOptionQK(mat_dilate, 1, out option_pixel_options);
mx = GetValueAndDrawGrid_Other(src.Bitmap, selected_contours, X, wL, xuanXiang, Y, hL, tiliang, ""); mx = GetValueAndDrawGrid_Other(src.Bitmap, selected_contours, X, wL, xuanXiang, Y, hL, tiliang, "");
@ -476,7 +499,7 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
/// <param name="width2">轮廓外接矩形小于该宽度值</param> /// <param name="width2">轮廓外接矩形小于该宽度值</param>
/// <param name="height1">轮廓外接矩形大于该高度值</param> /// <param name="height1">轮廓外接矩形大于该高度值</param>
/// <param name="height2">轮廓外接矩形小于该高度值</param> /// <param name="height2">轮廓外接矩形小于该高度值</param>
public static VectorOfVectorOfPoint GetUsefulContoursSelectoOptionQK(Mat mat, double ratio,out int option_pixel_options) public static VectorOfVectorOfPoint GetUsefulContoursSelectoOptionQK(Mat mat, double ratio, out int option_pixel_options)
{ {
option_pixel_options = 0; option_pixel_options = 0;
VectorOfVectorOfPoint contours = new VectorOfVectorOfPoint();//所有的轮廓 VectorOfVectorOfPoint contours = new VectorOfVectorOfPoint();//所有的轮廓
@ -498,10 +521,11 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
CvInvoke.ApproxPolyDP(contours[i], approx_curve, length * 0.02, true); CvInvoke.ApproxPolyDP(contours[i], approx_curve, length * 0.02, true);
//bool bo = (area > 500 && area < 12000);//&& rect.Height<100 //bool bo = (area > 500 && area < 12000);//&& rect.Height<100
//bool bo = ((area > 20 && area < 150000) && rect.Height > 8 ); //bool bo = ((area > 20 && area < 150000) && rect.Height > 8 );
bool bo = ((area > 10 && area < 150000) && rect.Height > 5 ); bool bo = ((area > 10 && area < 150000) && rect.Height > 5);
if (bo) if (bo)
{ {
if (pxNums > (area * 0.7)) { if (pxNums > (area * 0.7))
{
option_pixel_options = pxNums; option_pixel_options = pxNums;
selected_contours.Push(contours[i]); selected_contours.Push(contours[i]);
} }
@ -741,7 +765,8 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
/// 检查边距是否合格 /// 检查边距是否合格
/// </summary> /// </summary>
/// <param name="getdata"></param> /// <param name="getdata"></param>
private string TempV(string[] GetData,string PYPostionList,int oldWidth,int oldHeight,string HideAreaPostionList) { private string TempV(string[] GetData, string PYPostionList, int oldWidth, int oldHeight, string HideAreaPostionList)
{
double pyLeft = Convert.ToInt32(PYPostionList.Split(',')[0]); double pyLeft = Convert.ToInt32(PYPostionList.Split(',')[0]);
double pyTop = Convert.ToInt32(PYPostionList.Split(',')[1]); double pyTop = Convert.ToInt32(PYPostionList.Split(',')[1]);
double Xtop = 0; double Xtop = 0;
@ -771,14 +796,15 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
if (Xtop + Xheight - pyTop > oldHeight) if (Xtop + Xheight - pyTop > oldHeight)
{ {
return "学号编辑框下边超过定位点边界!"; return "学号编辑框下边超过定位点边界!";
} }
} }
if (GetData[2] != "")//客观题 if (GetData[2] != "")//客观题
{ {
string[] keguantiList = GetData[2].Split('^'); string[] keguantiList = GetData[2].Split('^');
foreach (string slist in keguantiList) { foreach (string slist in keguantiList)
{
string[] list = slist.Split(','); string[] list = slist.Split(',');
Xleft = Convert.ToDouble(list[0]); Xleft = Convert.ToDouble(list[0]);
Xtop = Convert.ToDouble(list[1]); Xtop = Convert.ToDouble(list[1]);
@ -814,7 +840,7 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
Xtop = Convert.ToDouble(list[1]); Xtop = Convert.ToDouble(list[1]);
Xwidth = Convert.ToDouble(list[2]); Xwidth = Convert.ToDouble(list[2]);
Xheight = Convert.ToDouble(list[3]); Xheight = Convert.ToDouble(list[3]);
string tihao = list[4] ; string tihao = list[4];
if (Xleft < pyLeft) if (Xleft < pyLeft)
{ {
return "主观题:[" + tihao + "] 编辑框左边超过定位点边界!"; return "主观题:[" + tihao + "] 编辑框左边超过定位点边界!";
@ -944,11 +970,12 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
return "批阅分数编辑框编辑框下边超过定位点边界!"; return "批阅分数编辑框编辑框下边超过定位点边界!";
} }
} }
if (HideAreaPostionList != "") { if (HideAreaPostionList != "")
{
JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
List<HideAreaData> ht = javaScriptSerializer.Deserialize<List<HideAreaData>>(HideAreaPostionList); List<HideAreaData> ht = javaScriptSerializer.Deserialize<List<HideAreaData>>(HideAreaPostionList);
int count =0; int count = 0;
foreach (HideAreaData h in ht) foreach (HideAreaData h in ht)
{ {
count++; count++;
@ -958,7 +985,7 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
Xheight = Convert.ToDouble(h.height); Xheight = Convert.ToDouble(h.height);
if (Xleft < pyLeft) if (Xleft < pyLeft)
{ {
return "屏蔽区"+count+"编辑框左边超过定位点边界!"; return "屏蔽区" + count + "编辑框左边超过定位点边界!";
} }
if (Xleft + Xwidth - pyLeft > oldWidth) if (Xleft + Xwidth - pyLeft > oldWidth)

View File

@ -8,7 +8,7 @@ function ChangePageSize(obj) {
//设定全卷遮挡区域 //设定全卷遮挡区域
function SetHideArea() { function SetHideArea() {
var html=""; var html = "";
html += "<div class=\"main_tabletop hidearea\" style='top:100px;width:400px;'>"; html += "<div class=\"main_tabletop hidearea\" style='top:100px;width:400px;'>";
html += " <div class=\"hidetext\">屏蔽显示区</div>"; html += " <div class=\"hidetext\">屏蔽显示区</div>";
html += " <div class=\"hideareaclose\" onclick=\"CloseHideArea(this)\">X</div>"; html += " <div class=\"hideareaclose\" onclick=\"CloseHideArea(this)\">X</div>";
@ -34,20 +34,20 @@ function SetMao(obj, index) {
return; return;
} }
var style = ""; var style = "";
var pright=parseInt($(".main_papermain").width()) -120; var pright = parseInt($(".main_papermain").width()) - 120;
var pheight=parseInt($(".main_papermain").height())-100; var pheight = parseInt($(".main_papermain").height()) - 100;
if (index == 0) { if (index == 0) {
style = "left:60px; top:40px;" style = "left:60px; top:40px;"
} }
if (index == 1) { if (index == 1) {
style = "left:"+pright+"px; top:30px;" style = "left:" + pright + "px; top:30px;"
} }
if (index == 2) { if (index == 2) {
style = "left:60px; top:"+pheight+"px;" style = "left:60px; top:" + pheight + "px;"
} }
if (index == 3) { if (index == 3) {
style = "left:"+pright+"px; top:"+pheight+"px;" style = "left:" + pright + "px; top:" + pheight + "px;"
} }
$(obj).attr("class", "maodian_hover"); $(obj).attr("class", "maodian_hover");
@ -55,7 +55,7 @@ function SetMao(obj, index) {
$("#draggable_" + index).draggable({ containment: ".main_papermain" }); $("#draggable_" + index).draggable({ containment: ".main_papermain" });
$("#draggable_" + index).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 $("#draggable_" + index).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放
} }
///设置锚点 ///设置锚点
///设置学号 ///设置学号
@ -79,7 +79,7 @@ function SetXuehao(obj) {
$(".main_papermain").append("<div id=\"xuehaoTable\" listNum='" + num + "' class='main_tabletop' style='width:300px; height:200px'>" + html + "</div>"); $(".main_papermain").append("<div id=\"xuehaoTable\" listNum='" + num + "' class='main_tabletop' style='width:300px; height:200px'>" + html + "</div>");
$("#xuehaoTable").draggable({ containment: ".main_papermain" }); $("#xuehaoTable").draggable({ containment: ".main_papermain" });
$("#xuehaoTable").resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 $("#xuehaoTable").resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放
} }
//设置学号 //设置学号
@ -119,8 +119,7 @@ function SetKeguanTi() {
var startnum = parseInt(tihaoList[0]); var startnum = parseInt(tihaoList[0]);
var endnum = parseInt(tihaoList[1]); var endnum = parseInt(tihaoList[1]);
if (endnum == undefined) if (endnum == undefined) {
{
endnum = startnum; endnum = startnum;
} }
var html = "<table class='keguan_list' cellpadding=\"0\" style='background:#ff3300;' cellspacing=\"0\">"; var html = "<table class='keguan_list' cellpadding=\"0\" style='background:#ff3300;' cellspacing=\"0\">";
@ -134,12 +133,10 @@ function SetKeguanTi() {
if (listtype == 0)//横向 if (listtype == 0)//横向
{ {
for (var i = parseInt(startnum); i <=parseInt(endnum); i++) for (var i = parseInt(startnum); i <= parseInt(endnum); i++) {
{
html += "<tr>"; html += "<tr>";
for (var j = 0; j < selectNum; j++) for (var j = 0; j < selectNum; j++) {
{
html += "<td></td>"; html += "<td></td>";
} }
html += "</tr>"; html += "</tr>";
@ -167,9 +164,9 @@ function SetKeguanTi() {
$(".main_papermain").append("<div id=\"keguan_" + tihao + "\" class='main_tabletop keguanti' questiontype='" + questiontype + "' tihaovalue='" + tihao + "' startnum='" + BigTihao + "" + startnum + "' endNum='" + BigTihao + "" + endnum + "' selectNum='" + selectNum + "' listtype='" + listtype + "' score='" + score + "' style='width:200px;background:none; left:100px; top:" + (100 + $(document).scrollTop()) + "px; height:140px'><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + tihaoM + "</div>" + html + "</div>"); $(".main_papermain").append("<div id=\"keguan_" + tihao + "\" class='main_tabletop keguanti' questiontype='" + questiontype + "' tihaovalue='" + tihao + "' startnum='" + BigTihao + "" + startnum + "' endNum='" + BigTihao + "" + endnum + "' selectNum='" + selectNum + "' listtype='" + listtype + "' score='" + score + "' style='width:200px;background:none; left:100px; top:" + (100 + $(document).scrollTop()) + "px; height:140px'><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + tihaoM + "</div>" + html + "</div>");
$("#keguan_" + tihao).draggable({ containment: ".main_papermain" }); $("#keguan_" + tihao).draggable({ containment: ".main_papermain" });
$("#keguan_" + tihao).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 $("#keguan_" + tihao).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放
var listtypeText = listtype == 0 ? "横向" : "竖向"; var listtypeText = listtype == 0 ? "横向" : "竖向";
$("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + tihao + "' ><div class='sp'><div class='go'>" + questionHtml + "</div></div><div class='sf'>" + tihaoM + "</div> <div class='sm'>" + selectNum + "</div><div class='sx'>" + listtypeText + "</div><div class='ss' idAtt='keguan_" + tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + tihao +"','客观题')\">" + score + "</div><div class='sd' onclick=\"DeleteKeguanti('" + tihao + "')\">x</div></li>"); $("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + tihao + "' ><div class='sp'><div class='go'>" + questionHtml + "</div></div><div class='sf'>" + tihaoM + "</div> <div class='sm'>" + selectNum + "</div><div class='sx'>" + listtypeText + "</div><div class='ss' idAtt='keguan_" + tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + tihao + "','客观题')\">" + score + "</div><div class='sd' onclick=\"DeleteKeguanti('" + tihao + "')\">x</div></li>");
} }
function DeleteKeguanti(tihao) { function DeleteKeguanti(tihao) {
@ -187,7 +184,7 @@ function DeleteKeguanti(tihao) {
function SetZhuguanTi() { function SetZhuguanTi() {
var zhuguan_tihao = $("#zhuguan_tihao").val().toUpperCase().replace(".", "·").replace("(", "").replace(")", "").replace(")", "").replace("=", "").replace("@",""); var zhuguan_tihao = $("#zhuguan_tihao").val().toUpperCase().replace(".", "·").replace("(", "").replace(")", "").replace(")", "").replace("=", "").replace("@", "");
if (zhuguan_tihao == "") { if (zhuguan_tihao == "") {
alert("主观题 题号不能为空"); alert("主观题 题号不能为空");
@ -207,13 +204,13 @@ function SetZhuguanTi() {
if (zhuguan_xiaoti == "") { if (zhuguan_xiaoti == "") {
zhuguan_xiaoti = "0"; zhuguan_xiaoti = "0";
} }
var lineWh = "width:800px;height:200px;"; var lineWh = "width:450px;height:250px;";
var lineWhTx = "大题"; var lineWhTx = "大题";
if (questiontype_zg == "2") { if (questiontype_zg == "2") {
var lineWh = "width:200px;height:90px;"; var lineWh = "width:200px;height:90px;";
lineWhTx="填空" lineWhTx = "填空"
} }
$(".main_papermain").append("<div id=\"keguan_" + zhuguan_tihao + "\" class='main_tabletop zhuguanti' questiontype_zg='" + questiontype_zg+"' tihaovalue='" + zhuguan_tihao + "' zhuguan_xiaoti='" + zhuguan_xiaoti + "' score='" + score + "' scoretype='" + scoretype + "' style='" + lineWh + ";background:none; left:100px; top:" + (100+$(document).scrollTop()) + "px;'><div style=\" float:left; width:auto;text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + lineWhTx+"" + zhuguan_tihao + "</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>"); $(".main_papermain").append("<div id=\"keguan_" + zhuguan_tihao + "\" class='main_tabletop zhuguanti' questiontype_zg='" + questiontype_zg + "' tihaovalue='" + zhuguan_tihao + "' zhuguan_xiaoti='" + zhuguan_xiaoti + "' score='" + score + "' scoretype='" + scoretype + "' style='" + lineWh + ";background:none; left:100px; top:" + (100 + $(document).scrollTop()) + "px;'><div style=\" float:left; width:auto;text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + lineWhTx + "" + zhuguan_tihao + "</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>");
$("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" });
$("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' });
@ -238,7 +235,7 @@ function SetTiaoMa(obj) {
$(".main_papermain").append("<div id=\"keguan_tiaomashibie\" class='main_tabletop' style='width:200px;background:none; left:100px; top:200px; height:80px'><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">条码</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>"); $(".main_papermain").append("<div id=\"keguan_tiaomashibie\" class='main_tabletop' style='width:200px;background:none; left:100px; top:200px; height:80px'><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">条码</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>");
setTimeout(function () { setTimeout(function () {
$("#keguan_tiaomashibie").draggable({ containment: ".main_papermain" }); $("#keguan_tiaomashibie").draggable({ containment: ".main_papermain" });
$("#keguan_tiaomashibie").resizable({ containment: ".main_papermain", handles: 'all' }); $("#keguan_tiaomashibie").resizable({ containment: ".main_papermain", handles: 'all' });
}, 500); }, 500);
} }
@ -255,7 +252,7 @@ function SetZunkaoZheng() {
} }
$(".main_papermain").append("<div id=\"keguan_zhunkaozhenghaoshibie\" class='main_tabletop' style='width:300px;background:none; left:100px; top:200px; height:200px'><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">准考证号</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>"); $(".main_papermain").append("<div id=\"keguan_zhunkaozhenghaoshibie\" class='main_tabletop' style='width:300px;background:none; left:100px; top:200px; height:200px'><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">准考证号</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>");
$("#keguan_zhunkaozhenghaoshibie").draggable({ containment: ".main_papermain" }); $("#keguan_zhunkaozhenghaoshibie").draggable({ containment: ".main_papermain" });
$("#keguan_zhunkaozhenghaoshibie").resizable({ containment: ".main_papermain", handles: 'all' }); $("#keguan_zhunkaozhenghaoshibie").resizable({ containment: ".main_papermain", handles: 'all' });
$("#NowSelect").append("<li id='selectNow_zhunkaozhenghaoshibie' >准考证号<span onclick=\"DeleteKeguanti('zhunkaozhenghaoshibie')\">删除</span></li>"); $("#NowSelect").append("<li id='selectNow_zhunkaozhenghaoshibie' >准考证号<span onclick=\"DeleteKeguanti('zhunkaozhenghaoshibie')\">删除</span></li>");
} }
@ -284,7 +281,7 @@ function SetWenziQuyu(obj) {
} }
$(".main_papermain").append("<div id=\"keguan_" + zhuguan_tihao + "\" class='main_tabletop wenzimiaoshu' wenzimiaoshu='" + zhuguan_tihao + "' style='width:80px;background:none; left:100px; top:200px; height:60px'><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + zhuguan_tihao + "</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>"); $(".main_papermain").append("<div id=\"keguan_" + zhuguan_tihao + "\" class='main_tabletop wenzimiaoshu' wenzimiaoshu='" + zhuguan_tihao + "' style='width:80px;background:none; left:100px; top:200px; height:60px'><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + zhuguan_tihao + "</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>");
$("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" });
$("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' });
} }
@ -340,7 +337,7 @@ function SetPYPostion(type) {
if (isHaveX) { if (isHaveX) {
score = $("#keguan_" + py_tihao + "X1").attr("score"); score = $("#keguan_" + py_tihao + "X1").attr("score");
type = $("#keguan_" + py_tihao+"X1").attr("questiontype_zg"); type = $("#keguan_" + py_tihao + "X1").attr("questiontype_zg");
} }
else { else {
score = $("#keguan_" + py_tihao).attr("score"); score = $("#keguan_" + py_tihao).attr("score");
@ -373,7 +370,7 @@ function SetPYPostion(type) {
var html = ""; var html = "";
html += "<div id=\"pyti_" + py_tihao + "\" class='main_tabletop pyti' piyueType='" + type+"' tihaovalue='" + py_tihao + "' score='" + score + "' style='" + lineWh + ";background:none;font-size:11px; background:#ff3300; left:100px; top:" + (100 + $(document).scrollTop()) + "px;'>"; html += "<div id=\"pyti_" + py_tihao + "\" class='main_tabletop pyti' piyueType='" + type + "' tihaovalue='" + py_tihao + "' score='" + score + "' style='" + lineWh + ";background:none;font-size:11px; background:#ff3300; left:100px; top:" + (100 + $(document).scrollTop()) + "px;'>";
html += "<div style =\" float:left; width:auto;text-align:center;font-size:12px; min-width:150px; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + lineWhTx + "" + py_tihao + "<span style='float:right; margin-left:5px; background:#000;color:fff; padding-left:5px; padding-right:5px;' onclick=\"closepy_hi(this)\">x</span></div>"; html += "<div style =\" float:left; width:auto;text-align:center;font-size:12px; min-width:150px; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + lineWhTx + "" + py_tihao + "<span style='float:right; margin-left:5px; background:#000;color:fff; padding-left:5px; padding-right:5px;' onclick=\"closepy_hi(this)\">x</span></div>";
html += "<div style = 'width:100%;height:100%;background:#fff;border:1px solid red;' >"; html += "<div style = 'width:100%;height:100%;background:#fff;border:1px solid red;' >";
html += "</div >"; html += "</div >";
@ -427,7 +424,7 @@ function GetKeguanPostion() {
} }
var xy = ""; var xy = "";
$(".keguanti").each(function () { $(".keguanti").each(function () {
xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("startnum") + "," + $(this).attr("endNum") + "," + $(this).attr("selectNum") + "," + $(this).attr("listtype") + "," + $(this).attr("questiontype") + "," + $(this).attr("score") + "^"; xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("startnum") + "," + $(this).attr("endNum") + "," + $(this).attr("selectNum") + "," + $(this).attr("listtype") + "," + $(this).attr("questiontype") + "," + $(this).attr("score") + "^";
}) })
return xy.trim('^'); return xy.trim('^');
} }
@ -439,7 +436,7 @@ function GetZhuguanPostion() {
return ""; return "";
} }
$(".zhuguanti").each(function () { $(".zhuguanti").each(function () {
xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("tihaovalue") + "," + $(this).attr("zhuguan_xiaoti") + "," + $(this).attr("score") + "," + $(this).attr("scoretype") + "," + $(this).attr("questiontype_zg")+"^"; xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("tihaovalue") + "," + $(this).attr("zhuguan_xiaoti") + "," + $(this).attr("score") + "," + $(this).attr("scoretype") + "," + $(this).attr("questiontype_zg") + "^";
}) })
return xy.trim('^'); return xy.trim('^');
} }
@ -512,7 +509,7 @@ function GetPyAreaPostion() {
return ""; return "";
} }
$(".pyti").each(function () { $(".pyti").each(function () {
xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("tihaovalue") + "," + $(this).attr("score") + "," + $(this).attr("piyueType")+"^"; xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("tihaovalue") + "," + $(this).attr("score") + "," + $(this).attr("piyueType") + "^";
}) })
return xy.trim('^'); return xy.trim('^');
@ -521,7 +518,7 @@ function GetPyAreaPostion() {
///////////////////统计数据////////////////////////// ///////////////////统计数据//////////////////////////
function GetDataTotal(objvalue,tenant) { function GetDataTotal(objvalue, tenant) {
if ($("#hd_isHand").val() == "1") { if ($("#hd_isHand").val() == "1") {
if ($("#py_tihao").val() != "all") { if ($("#py_tihao").val() != "all") {
alert("主观题有未批阅分数,请先配置好主观题分数选择框!"); alert("主观题有未批阅分数,请先配置好主观题分数选择框!");
@ -555,7 +552,7 @@ function GetDataTotal(objvalue,tenant) {
return; return;
} }
if (document.getElementById("keguan_缺考") == undefined && $("#PageIndex").val()=="1") { if (document.getElementById("keguan_缺考") == undefined && $("#PageIndex").val() == "1") {
if (confirm("您尚未设置缺考标记,无需设置点击取消按钮")) { if (confirm("您尚未设置缺考标记,无需设置点击取消按钮")) {
return; return;
} }
@ -574,7 +571,7 @@ function GetDataTotal(objvalue,tenant) {
if (confirm("锁定模板后,仅可修改识别区域,无法增删主客观题!")) { if (confirm("锁定模板后,仅可修改识别区域,无法增删主客观题!")) {
$("#ansyButton").attr("disabled", "disabled"); $("#ansyButton").attr("disabled", "disabled");
$("#ansyButton").attr("value", "正在更新数据"); $("#ansyButton").attr("value", "正在更新数据");
$.post("default.aspx", { action: "2", rd: Math.round(), MainTempId: MainTempId, PageIndex: PageIndex, totalHtml: encodeURIComponent(totalHtml), TempID: $("#TempID").val(), HideAreaPostionList: encodeURIComponent(hideArea),tenant:tenant }, function (res) { $.post("default.aspx", { action: "2", rd: Math.round(), MainTempId: MainTempId, PageIndex: PageIndex, totalHtml: encodeURIComponent(totalHtml), TempID: $("#TempID").val(), HideAreaPostionList: encodeURIComponent(hideArea), tenant: tenant }, function (res) {
if (res == "ok") { if (res == "ok") {
$("#ansyButton").attr("disabled", "disabled"); $("#ansyButton").attr("disabled", "disabled");
$("#ansyButton").attr("value", "模板已锁定"); $("#ansyButton").attr("value", "模板已锁定");
@ -593,7 +590,7 @@ function GetDataTotal(objvalue,tenant) {
else { else {
$("#noButton").attr("disabled", "disabled"); $("#noButton").attr("disabled", "disabled");
$("#noButton").attr("value", "正在更新数据"); $("#noButton").attr("value", "正在更新数据");
$.post("default.aspx", { action: "1", rd: Math.round(), MainTempId: MainTempId, PageIndex: PageIndex, totalHtml: encodeURIComponent(totalHtml), TempID: $("#TempID").val(), HideAreaPostionList: encodeURIComponent(hideArea),tenant:tenant }, function (res) { $.post("default.aspx", { action: "1", rd: Math.round(), MainTempId: MainTempId, PageIndex: PageIndex, totalHtml: encodeURIComponent(totalHtml), TempID: $("#TempID").val(), HideAreaPostionList: encodeURIComponent(hideArea), tenant: tenant }, function (res) {
$("#noButton").removeAttr("disabled"); $("#noButton").removeAttr("disabled");
$("#noButton").attr("value", "保存数据"); $("#noButton").attr("value", "保存数据");
if (res == "ok") { if (res == "ok") {
@ -601,7 +598,7 @@ function GetDataTotal(objvalue,tenant) {
} }
else { else {
alert(res +"或更新失败,定位点错误"); alert(res + "或更新失败,定位点错误");
} }
}) })
} }
@ -656,17 +653,17 @@ function BaseDataBind() {
} }
//if(pageWidth==""){ //if(pageWidth==""){
var pageType= $("#pager_A").val(); var pageType = $("#pager_A").val();
if(pageType=="a3"){ if (pageType == "a3") {
pageWidth = 1570; pageWidth = 1570;
} }
else{ else {
pageWidth = 1200; pageWidth = 1200;
} }
//} //}
$(".main_papermain").width(pageWidth+"px"); $(".main_papermain").width(pageWidth + "px");
if ($("#pager_A").val() == "a3") { if ($("#pager_A").val() == "a3") {
$("#selectPageSize").val("1570"); $("#selectPageSize").val("1570");
@ -721,7 +718,7 @@ function SetPyPostion(PostionData) {
var style = ""; var style = "";
style = "left:" + zhuguanList[0] + "px; top: " + zhuguanList[1] + "px; width:" + zhuguanList[2] + "px;height:" + zhuguanList[3] + "px;"; style = "left:" + zhuguanList[0] + "px; top: " + zhuguanList[1] + "px; width:" + zhuguanList[2] + "px;height:" + zhuguanList[3] + "px;";
var html = ""; var html = "";
html += "<div id=\"pyti_" + py_tihao + "\" class='main_tabletop pyti' piyueType='" + type + "' tihaovalue='" + py_tihao + "' score='" + score + "' style='" + style+";background:none;font-size:11px; background:yellow;'>"; html += "<div id=\"pyti_" + py_tihao + "\" class='main_tabletop pyti' piyueType='" + type + "' tihaovalue='" + py_tihao + "' score='" + score + "' style='" + style + ";background:none;font-size:11px; background:yellow;'>";
html += "<div style =\" float:left; width:auto;text-align:center;font-size:12px; min-width:150px; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + lineWhTx + "" + py_tihao + "<span style='float:right; margin-left:5px; background:#000;color:fff; padding-left:5px; padding-right:5px;' onclick=\"closepy_hi(this)\">x</span></div>"; html += "<div style =\" float:left; width:auto;text-align:center;font-size:12px; min-width:150px; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + lineWhTx + "" + py_tihao + "<span style='float:right; margin-left:5px; background:#000;color:fff; padding-left:5px; padding-right:5px;' onclick=\"closepy_hi(this)\">x</span></div>";
html += "<div style = 'width:100%;height:100%;background:yellow;border:1px solid red;' >"; html += "<div style = 'width:100%;height:100%;background:yellow;border:1px solid red;' >";
html += "</div >"; html += "</div >";
@ -732,7 +729,7 @@ function SetPyPostion(PostionData) {
} }
} }
////////////////设置主观题////////////////////// ////////////////设置主观题//////////////////////
@ -753,7 +750,7 @@ function SetHideAreaBind(data) {
} }
$(".main_papermain").append(html); $(".main_papermain").append(html);
$(".hidearea").draggable({ containment: ".main_papermain" }); $(".hidearea").draggable({ containment: ".main_papermain" });
$(".hidearea").resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 $(".hidearea").resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放
} }
///设置锚点 ///设置锚点
@ -780,8 +777,7 @@ function SetMaoPostion(postiondata) {
var list = postiondata.split('^'); var list = postiondata.split('^');
for (var i = 0; i < list.length; i++) for (var i = 0; i < list.length; i++) {
{
var obj = document.getElementById("point_" + i); var obj = document.getElementById("point_" + i);
//左边距,右边距,长,高 //左边距,右边距,长,高
if ($(obj).attr("class") == "maodian_hover") { if ($(obj).attr("class") == "maodian_hover") {
@ -795,7 +791,7 @@ function SetMaoPostion(postiondata) {
$(obj).attr("class", "maodian_hover"); $(obj).attr("class", "maodian_hover");
$(".main_papermain").append("<div class='main_tabletop' style='" + style + "' id='draggable_" + i + "'>" + $(obj).html() + "</div>"); $(".main_papermain").append("<div class='main_tabletop' style='" + style + "' id='draggable_" + i + "'>" + $(obj).html() + "</div>");
$("#draggable_" + i).draggable({ containment: ".main_papermain" }); $("#draggable_" + i).draggable({ containment: ".main_papermain" });
$("#draggable_" + i).resizable({ containment: ".main_papermain", handles: 'all' }); $("#draggable_" + i).resizable({ containment: ".main_papermain", handles: 'all' });
} }
} }
@ -826,7 +822,7 @@ function SetXuehaoPostion(postionData) {
html += "</table>"; html += "</table>";
$(".main_papermain").append("<div id=\"xuehaoTable\" listNum='" + num + "' class='main_tabletop' style='top:" + postionList[1] + "px; left:" + postionList[0] + "px;width:" + postionList[2] + "px; height:" + postionList[3] + "px'>" + html + "</div>"); $(".main_papermain").append("<div id=\"xuehaoTable\" listNum='" + num + "' class='main_tabletop' style='top:" + postionList[1] + "px; left:" + postionList[0] + "px;width:" + postionList[2] + "px; height:" + postionList[3] + "px'>" + html + "</div>");
$("#xuehaoTable").draggable({ containment: ".main_papermain" }); $("#xuehaoTable").draggable({ containment: ".main_papermain" });
$("#xuehaoTable").resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 $("#xuehaoTable").resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放
} }
//设置学号 //设置学号
@ -838,8 +834,7 @@ function SetKeguanTiPostion(PostionData) {
//左边距,右边距,长,高,题号开始,题号结束,横排还是竖排 //左边距,右边距,长,高,题号开始,题号结束,横排还是竖排
var listOption = PostionData.split('^') var listOption = PostionData.split('^')
for (var jt = 0; jt < listOption.length; jt++) for (var jt = 0; jt < listOption.length; jt++) {
{
var listpostion = listOption[jt].split(','); var listpostion = listOption[jt].split(',');
var tihao = listpostion[4].replace(".", "·").replace("(", "").replace(")", "").replace(")", "").replace("=", "").replace("@", "") + "-" + listpostion[5].replace(".", "·").replace("(", "").replace(")", "").replace(")", "").replace("=", "").replace("@", "");//题号 var tihao = listpostion[4].replace(".", "·").replace("(", "").replace(")", "").replace(")", "").replace("=", "").replace("@", "") + "-" + listpostion[5].replace(".", "·").replace("(", "").replace(")", "").replace(")", "").replace("=", "").replace("@", "");//题号
@ -877,7 +872,7 @@ function SetKeguanTiPostion(PostionData) {
if (listtype == 0)//横向 if (listtype == 0)//横向
{ {
for (var i = parseInt(startnum) ; i <= parseInt(endnum) ; i++) { for (var i = parseInt(startnum); i <= parseInt(endnum); i++) {
html += "<tr>"; html += "<tr>";
for (var j = 0; j < selectNum; j++) { for (var j = 0; j < selectNum; j++) {
@ -904,11 +899,11 @@ function SetKeguanTiPostion(PostionData) {
questionHtml = "判断"; questionHtml = "判断";
} }
$(".main_papermain").append("<div id=\"keguan_" + tihao + "\" questiontype=\"" + questiontype + "\" class='main_tabletop keguanti' tihaovalue='" + tihao + "' startnum='" + BigTihao + "" + startnum + "' endNum='" + BigTihao + "" + endnum + "' score='"+score+"' selectNum='" + selectNum + "' listtype='" + listtype + "' style='background:none; left:" + listpostion[0] + "px; top:" + listpostion[1] + "px;width:" + listpostion[2] + "px; height:" + listpostion[3] + "px'><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + tihao + "</div>" + html + "</div>"); $(".main_papermain").append("<div id=\"keguan_" + tihao + "\" questiontype=\"" + questiontype + "\" class='main_tabletop keguanti' tihaovalue='" + tihao + "' startnum='" + BigTihao + "" + startnum + "' endNum='" + BigTihao + "" + endnum + "' score='" + score + "' selectNum='" + selectNum + "' listtype='" + listtype + "' style='background:none; left:" + listpostion[0] + "px; top:" + listpostion[1] + "px;width:" + listpostion[2] + "px; height:" + listpostion[3] + "px'><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + tihao + "</div>" + html + "</div>");
$("#keguan_" + tihao).draggable({ containment: ".main_papermain" }); $("#keguan_" + tihao).draggable({ containment: ".main_papermain" });
$("#keguan_" + tihao).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 $("#keguan_" + tihao).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放
var listtypeText = listtype == 0 ? "横向" : "竖向"; var listtypeText = listtype == 0 ? "横向" : "竖向";
$("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + tihao + "' ><div class='sp'><div class='go'>" + questionHtml + "</div></div><div class='sf'>" + tihao + "</div> <div class='sm'>" + selectNum + "</div><div class='sx'>" + listtypeText + "</div><div class='ss' id='ss_" + tihao + "' idAtt='keguan_" + tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + tihao +"','客观题')\">" + score + "</div><div class='sd' onclick=\"DeleteKeguanti('" + tihao + "')\">x</div></li>"); $("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + tihao + "' ><div class='sp'><div class='go'>" + questionHtml + "</div></div><div class='sf'>" + tihao + "</div> <div class='sm'>" + selectNum + "</div><div class='sx'>" + listtypeText + "</div><div class='ss' id='ss_" + tihao + "' idAtt='keguan_" + tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + tihao + "','客观题')\">" + score + "</div><div class='sd' onclick=\"DeleteKeguanti('" + tihao + "')\">x</div></li>");
} }
} }
@ -916,15 +911,13 @@ function SetKeguanTiPostion(PostionData) {
/////////////////设置主观题////////////////////// /////////////////设置主观题//////////////////////
function SetZhuguanTiPostion(PostionData) { function SetZhuguanTiPostion(PostionData) {
if (PostionData == "" || PostionData == undefined) if (PostionData == "" || PostionData == undefined) {
{
return; return;
} }
//左边距,右边距,长,高,题号,小题数量 //左边距,右边距,长,高,题号,小题数量
var listdata = PostionData.split('^'); var listdata = PostionData.split('^');
for (var i = 0; i < listdata.length; i++) for (var i = 0; i < listdata.length; i++) {
{
var zhuguanList = listdata[i].split(','); var zhuguanList = listdata[i].split(',');
var zhuguan_tihao = zhuguanList[4].toUpperCase().replace(".", "·").replace("(", "").replace(")", "").replace(")", "").replace("=", "").replace("@", ""); var zhuguan_tihao = zhuguanList[4].toUpperCase().replace(".", "·").replace("(", "").replace(")", "").replace(")", "").replace("=", "").replace("@", "");
var score = zhuguanList[6] == undefined ? "" : zhuguanList[6]; var score = zhuguanList[6] == undefined ? "" : zhuguanList[6];
@ -945,10 +938,10 @@ function SetZhuguanTiPostion(PostionData) {
lineWhTx = "填空" lineWhTx = "填空"
} }
var zhuguan_xiaoti = zhuguanList[5]; var zhuguan_xiaoti = zhuguanList[5];
$(".main_papermain").append("<div id=\"keguan_" + zhuguan_tihao + "\" class='main_tabletop zhuguanti' questiontype_zg='" + questiontype_zg + "' tihaovalue='" + zhuguan_tihao + "' zhuguan_xiaoti='" + zhuguan_xiaoti + "' score='" + score + "' scoretype='" + scoretype + "' style='left:" + zhuguanList[0] + "px; top:" + zhuguanList[1] + "px;width:" + zhuguanList[2] + "px;height:" + zhuguanList[3] + "px; background:none; '><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + lineWhTx+":" + zhuguan_tihao + "</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>"); $(".main_papermain").append("<div id=\"keguan_" + zhuguan_tihao + "\" class='main_tabletop zhuguanti' questiontype_zg='" + questiontype_zg + "' tihaovalue='" + zhuguan_tihao + "' zhuguan_xiaoti='" + zhuguan_xiaoti + "' score='" + score + "' scoretype='" + scoretype + "' style='left:" + zhuguanList[0] + "px; top:" + zhuguanList[1] + "px;width:" + zhuguanList[2] + "px;height:" + zhuguanList[3] + "px; background:none; '><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + lineWhTx + ":" + zhuguan_tihao + "</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>");
$("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" });
$("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' });
$("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + zhuguan_tihao + "'><div class='sp'><div class='go'>主观题</div></div><div class='sf'>" + zhuguan_tihao + "</div><div class='sm'>" + zhuguan_xiaoti + "</div><div class='ss' id='ss_" + zhuguan_tihao +"' idAtt='keguan_" + zhuguan_tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + zhuguan_tihao + "','主观题')\">" + score + "</div><div class='ssd' id='ssd_" + zhuguan_tihao + "' onclick=\"UpdateBaseData(2,'" + scoretype + "','" + zhuguan_tihao + "','主观题')\">" + scoretypetext + "</div><div class='sd' onclick=\"DeleteKeguanti('" + zhuguan_tihao + "')\">x</div></li>"); $("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + zhuguan_tihao + "'><div class='sp'><div class='go'>主观题</div></div><div class='sf'>" + zhuguan_tihao + "</div><div class='sm'>" + zhuguan_xiaoti + "</div><div class='ss' id='ss_" + zhuguan_tihao + "' idAtt='keguan_" + zhuguan_tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + zhuguan_tihao + "','主观题')\">" + score + "</div><div class='ssd' id='ssd_" + zhuguan_tihao + "' onclick=\"UpdateBaseData(2,'" + scoretype + "','" + zhuguan_tihao + "','主观题')\">" + scoretypetext + "</div><div class='sd' onclick=\"DeleteKeguanti('" + zhuguan_tihao + "')\">x</div></li>");
} }
} }
////////////////设置主观题////////////////////// ////////////////设置主观题//////////////////////
@ -970,9 +963,9 @@ function SetWenziQuyuPostion(PostionData) {
} }
$(".main_papermain").append("<div id=\"keguan_缺考\" class='main_tabletop wenzimiaoshu' wenzimiaoshu='" + zhuguan_tihao + "' style='left:" + zhuguanList[0] + "px; top:" + zhuguanList[1] + "px;width:" + zhuguanList[2] + "px;height:" + zhuguanList[3] + "px; background:none; '><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + zhuguan_tihao + "</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>"); $(".main_papermain").append("<div id=\"keguan_缺考\" class='main_tabletop wenzimiaoshu' wenzimiaoshu='" + zhuguan_tihao + "' style='left:" + zhuguanList[0] + "px; top:" + zhuguanList[1] + "px;width:" + zhuguanList[2] + "px;height:" + zhuguanList[3] + "px; background:none; '><div style=\" float:left; width:auto; text-align:center; height:30px; position:absolute; margin-top:-30px;z-index:22; color:#fff; line-height:30px; background:#666;\">" + zhuguan_tihao + "</div><div style='width:100%;height:100%;background:#fff;border:1px solid red;'></div></div>");
$("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" });
$("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' });
$(".quelapsz").attr("class", "quelapsz_hover"); $(".quelapsz").attr("class", "quelapsz_hover");
} }
} }
@ -1040,7 +1033,7 @@ BaseDataBind();
function LockFunction(flag) { function LockFunction(flag) {
var islocked = $("#isLocked").val(); var islocked = $("#isLocked").val();
if (islocked == true || islocked=="True"||flag==1) { if (islocked == true || islocked == "True" || flag == 1) {
$("#ansyButton").attr("disabled", "disabled"); $("#ansyButton").attr("disabled", "disabled");
$("#ansyButton").attr("value", "模板已锁定"); $("#ansyButton").attr("value", "模板已锁定");
$(".sd").hide(); $(".sd").hide();
@ -1055,7 +1048,7 @@ if (hd_isHand == 0) {
$("#isHand_Py").hide(); $("#isHand_Py").hide();
} }
//批阅判定 //批阅判定
function GetZhuguantiScoreList(){ function GetZhuguantiScoreList() {
if ($("#hd_isHand").val() == "1") { if ($("#hd_isHand").val() == "1") {
var py_tihao = ""; var py_tihao = "";
var git = document.getElementById("py_tihao"); var git = document.getElementById("py_tihao");
@ -1087,9 +1080,9 @@ function GetZhuguantiScoreList(){
html += "<option value='" + tihaovalue + "'>" + "主观题" + tihaovalue + "</option>"; html += "<option value='" + tihaovalue + "'>" + "主观题" + tihaovalue + "</option>";
} }
// git.options[i] = new Option("主观题" + tihaovalue, tihaovalue); // git.options[i] = new Option("主观题" + tihaovalue, tihaovalue);
isallPY = false; isallPY = false;
} }
i++; i++;
}) })
if (isallPY) { if (isallPY) {
@ -1166,3 +1159,13 @@ String.prototype.trim = function (char, type) {
} }
return this.replace(/^\s+|\s+$/g, ''); return this.replace(/^\s+|\s+$/g, '');
}; };
//////////// 切换页数 ////////////////
function ChangePageNum(anotherTempID) {
if (confirm("当前页未保存,是否继续切换?")){
var currentURL = window.location.href;
var newUrl = currentURL.replace(/(TempID=)\d+/, "$1" + anotherTempID);
window.location.href = newUrl;
}
}