change.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. <style>
  2. /*切换选择*/
  3. .tab-con{
  4. position: relative;
  5. height: 30px;
  6. width: 200px;
  7. background: #F2F2F2;
  8. border: 1px solid #01B677;
  9. border-radius: 15px;
  10. }
  11. .has-sel{
  12. background: #01B677;
  13. color: #fff;
  14. width: 50%;
  15. height: 30px;
  16. border-top-left-radius: 15px;
  17. border-bottom-left-radius: 15px;
  18. text-align: center;
  19. line-height: 30px;
  20. }
  21. .sel-opt{
  22. width: 50%;
  23. position: relative;
  24. color: #01B677;
  25. line-height: 30px;
  26. text-indent: 6px;
  27. cursor: pointer;
  28. }
  29. .sel-opt:after{
  30. content: '';
  31. border-left: 6px solid transparent;
  32. border-right: 6px solid transparent;
  33. border-top: 8px solid #01B677;
  34. position: absolute;
  35. right: 12px;
  36. top: 12px;
  37. }
  38. // .sel-opt select{
  39. // width: 100%;
  40. // height: 30px;
  41. // background: #F2F2F2;
  42. // color: #01B677;
  43. // text-indent: 6px;
  44. // font-size: inherit;
  45. // border-top-right-radius: 15px;
  46. // border-bottom-right-radius: 15px;
  47. // cursor: pointer;
  48. // }
  49. // .sel-opt select option{
  50. // position: relative;
  51. // }
  52. .points{
  53. position: absolute;
  54. top: -2px;
  55. right: 0;
  56. width: 10px;
  57. height: 10px;
  58. background: #F01516;
  59. border-radius: 50%;
  60. }
  61. .sel-cons{
  62. border: 1px solid #01B677;
  63. width: 50%;
  64. position: absolute;
  65. right: 0;
  66. top: 30px;
  67. text-indent: 10px;
  68. display: none;
  69. }
  70. .sc-lis{
  71. line-height: 30px;
  72. cursor: pointer;
  73. }
  74. .sc-lis span{
  75. position: relative;
  76. }
  77. .sc-lis .points{
  78. top: 2px;
  79. right: -16px;
  80. }
  81. .loading-pop{position: fixed;left: 0;top: 0;bottom: 0;right: 0;background: rgba(0,0,0,0.5);z-index: 200;}
  82. .loading-pop-msg{color: #fff;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);font-size: 22px;letter-spacing: 4px;}
  83. </style>
  84. <div class="main-content-inner">
  85. <ul class="clearfix main-content-inner-ul">
  86. <?php if((isset(Yii::app()->session['session_subject_id']) && Yii::app()->session['session_subject_id']==3) || (isset(Yii::app()->session['session_subject_id']) && Yii::app()->session['session_subject_id']==6)){?>
  87. <li class="pull-left">
  88. <button onclick='location.href="<?php echo $this->createUrl("print/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">打印试卷</button>
  89. <img src="/images/line.jpg" style="height:45px;" />
  90. </li>
  91. <li class="pull-left">
  92. <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'wtb'));?>"' class="button button_normal button_group button_arrow " data-button="red">下载错题本</button>
  93. <img src="/images/line.jpg" style="height:45px;" />
  94. </li>
  95. <li class="pull-left">
  96. <!--<button onclick='ccc()' class="button button_normal button_group button_arrow <?php if($printType == 'isp'){echo 'button_active';}?>" data-button="red">下载个性化学习方案</button>-->
  97. <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'isp'));?>"' class="button button_normal button_group button_arrow " data-button="red">下载个性化学习方案</button>
  98. <img src="/images/line.jpg" style="height:45px;" />
  99. </li>
  100. <li class="pull-left">
  101. <!--<button onclick='ccc()' class="button button_normal button_group button_arrow <?php if($printType == 'studytrend'){echo 'button_active';}?>" data-button="red">下载个性化学习宝</button>-->
  102. <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'studytrend'));?>"' class="button button_normal button_group button_arrow " data-button="red">下载个性化学习宝</button>
  103. <img src="/images/line.jpg" style="height:45px;" />
  104. </li>
  105. <!--<li class="pull-left">
  106. <button onclick='location.href="<?php echo $this->createUrl("vacationhomework/classes?type=vh");?>"' class="button button_normal button_group button_arrow <?php if($printType == 'vh'){echo 'button_active';}?>" data-button="red">下载暑假作业</button>
  107. <img src="/images/line.jpg" style="height:45px;" />
  108. </li>-->
  109. <li class="pull-left">
  110. <button onclick='location.href="<?php echo $this->createUrl("print/student_product",array('type'=>'section'));?>"' class="button button_normal button_group button_arrow" data-button="red">阶段复习个性化学习宝</button>
  111. <img src="/images/line.jpg" style="height:45px;" />
  112. </li>
  113. <li class="pull-left">
  114. <button onclick='location.href="<?php echo $this->createUrl("third/index");?>"' class="button button_normal button_group button_arrow" data-button="red">第三方试卷</button>
  115. <img src="/images/line.jpg" style="height:45px;" />
  116. </li>
  117. <li class="pull-left">
  118. <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow " data-button="red">导出报告</button>
  119. <img src="/images/line.jpg" style="height:45px;" />
  120. </li>
  121. <li class="pull-left">
  122. <button onclick='location.href="<?php echo $this->createUrl("upload/index");?>"' class="button button_normal button_group button_arrow" data-button="red">上传试卷</button>
  123. <img src="/images/line.jpg" style="height:45px;" />
  124. </li>
  125. <li class="pull-left">
  126. <button onclick='location.href="<?php echo $this->createUrl("record/importscore"); ?>"'
  127. class="button button_normal button_group button_arrow " data-button="red">导入成绩
  128. </button>
  129. <img src="/images/line.jpg" style="height:45px;"/>
  130. </li>
  131. <?php }else{ ?>
  132. <li class="pull-left">
  133. <button onclick='location.href="<?php echo $this->createUrl("print/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">打印试卷</button>
  134. <img src="/images/line.jpg" style="height:45px;" />
  135. </li>
  136. <li class="pull-left">
  137. <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow <?php if($printType == ''){echo 'button_active';}?>" data-button="red">导出报告</button>
  138. <img src="/images/line.jpg" style="height:45px;" />
  139. </li>
  140. <li class="pull-left">
  141. <button onclick='location.href="<?php echo $this->createUrl("print/do_ruanyun_pdf");?>"' class="button button_normal button_group button_arrow" data-button="red">下载PDF</button>
  142. <img src="/images/line.jpg" style="height:45px;" />
  143. </li>
  144. <?php }?>
  145. <!--<div class="tab-con clearfix pull-right" style="margin:8px 11px 0 0">
  146. <div class="has-sel fl"><?php /*echo isset(Yii::app()->params["subjectId"][Yii::app()->session['session_subject_id']])?Yii::app()->params["subjectId"][Yii::app()->session['session_subject_id']]:'数学'*/?></div>
  147. <div class="sel-opt fl">
  148. 切换学科
  149. <?php /*if($subject){*/?>
  150. <div class="points"></div>
  151. <?php /*}*/?>
  152. </div>
  153. <div class="sel-cons" style="z-index:6;background-color: #fff;">
  154. <div class="sc-lis" val="3"><span>数学<?php /*if($subject && isset($subject[3]) && !empty($subject[3])){*/?><div class="points"></div><?php /*}*/?></span></div>
  155. <div class="sc-lis" val="12"><span>物理<?php /*if($subject && isset($subject[12]) && !empty($subject[12])){*/?><div class="points"></div><?php /*}*/?></span></div>
  156. <div class="sc-lis" val="13"><span>化学<?php /*if($subject && isset($subject[13]) && !empty($subject[13])){*/?><div class="points"></div><?php /*}*/?></span></div>
  157. <div class="sc-lis" val="14"><span>生物<?php /*if($subject && isset($subject[14]) && !empty($subject[14])){*/?><div class="points"></div><?php /*}*/?></span></div>
  158. </div>
  159. </div>-->
  160. <li class="pull-left">
  161. <button onclick='location.href="<?php echo $this->createUrl("cylet/index");?>"' class="button button_normal button_group button_arrow" data-button="red">全学科统考</button>
  162. </li>
  163. </ul>
  164. <div class="page-content">
  165. <div class="row" style="margin:0px">
  166. <div class="col-xs-12">
  167. <!-- PAGE CONTENT BEGINS -->
  168. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  169. <div class="row">
  170. <div class="col-xs-4">
  171. <form method="get" id="form1" action="<?php echo $this->createUrl("print/change");?>">
  172. <div class="dataTables_length" style="margin: 6px 0px;">
  173. <div class="dataTables_length">
  174. <label><input type="text" class="form-control input-sm" placeholder="请输入学生姓名" name="sname" value="<?php echo $sname;?>"></label>
  175. <!--<button class="btn btn-minier btn-primary" id="search">搜索</button>-->
  176. <button style="padding:4px 12px;"class="label-primary-s bth-s">搜索</button>
  177. </div>
  178. </div>
  179. <input type="hidden" name="cid" class="clid" value="<?php echo $class_id;?>" />
  180. <input type="hidden" name="eid" class="emid" value="<?php echo $exam_id;?>" />
  181. <input type="hidden" name="tid" value="<?php echo $type_id;?>" />
  182. </form>
  183. </div>
  184. <div class="col-xs-8">
  185. <div class="dataTables_filter" id="dynamic-table_filter" style="padding-top:15px;text-align: right;">
  186. <?php if(isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)){?>
  187. <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="updatePaperStatus" style="display: none">
  188. <i style="font-style: normal;" ></i>是否使用学校准考证
  189. </a>
  190. <?php }?>
  191. <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="addPaperStudent">
  192. <i style="font-style: normal;" ></i>添加考试学生
  193. </a>
  194. <a href="javascript:void(0);" class="btn click-delete btn-sm" id="delPaperStudent">
  195. <i style="font-style: normal;" ></i>选择删除考试学生
  196. </a>
  197. <a href="javascript:void(0);" class="btn click-delete btn-sm" id="delPaperStudentAll">
  198. <i style="font-style: normal;" ></i>删除全部未考试学生
  199. </a>
  200. <?php if(!$isCustomTpl){?><a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="selectPrint">
  201. <i style="font-style: normal;" class="fa fa-print"></i>
  202. <?php if ($tplTwo == 1){echo '打印答题卡';}else{echo '打印试卷';}?>
  203. </a>
  204. <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="selectPrintPack">
  205. <i style="font-style: normal;" class="fa fa-print"></i>
  206. 打包打印
  207. </a>
  208. <!--<a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="printAnswer">
  209. <i style="font-style: normal;" class="fa fa-print"></i>下载答案解析
  210. </a>--><?php }?>
  211. </div>
  212. </div>
  213. </div>
  214. <div class="row">
  215. <div class="col-xs-12" style="font-weight:bold;padding:0px 15px">
  216. <?php echo $className;?> <?php echo $paperName;?>(使用<?php if($examInfo->school_card_status==0){echo '系统准考证号,长度为8位';}else{echo '学校准考证号,长度为'.$examInfo->school_card_length.'位';}?>)
  217. </div>
  218. </div>
  219. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  220. <thead>
  221. <tr>
  222. <th class="center">
  223. <!--<label class="pos-rel">
  224. <input type="checkbox" class="selectAll">
  225. <span class="lbl"></span>
  226. </label>-->
  227. <input type="checkbox" class="ace selectAll">
  228. </th>
  229. <th>学生名称</th>
  230. <th>学生编号</th>
  231. <th>系统准考证号</th>
  232. <th>学校准考证号</th>
  233. <th>试卷是否已上传</th>
  234. <th>成绩是否已生成</th>
  235. </tr>
  236. </thead>
  237. <tbody>
  238. <?php if(!empty($result)):foreach($result as $rt):?>
  239. <tr>
  240. <td class="center">
  241. <!--<label class="pos-rel">
  242. <input type="checkbox" class="ace myselect" value="<?php echo $rt['studentCode'];?>" stnm="<?php echo $rt['studentName'];?>">
  243. <span class="lbl"></span>
  244. </label>-->
  245. <input type="checkbox" class="ace myselect" value="<?php echo $rt['studentCode'];?>" stnm="<?php echo $rt['studentName'];?>">
  246. </td>
  247. <td><?php echo $rt['studentName'];?></td>
  248. <td><?php echo $rt['studentCode'];?></td>
  249. <td><?php echo $rt['student_card'];?></td>
  250. <td><?php echo $rt['school_student_card'];?></td>
  251. <td><?php echo $rt['is_feedback'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
  252. <td><?php echo $rt['is_complete'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
  253. </tr>
  254. <?php endforeach;else:?>
  255. <tr><td colspan="7">暂无数据!</td></tr>
  256. <?php endif;?>
  257. </tbody>
  258. </table>
  259. <input type="hidden" name="paperId" id="paperId" value="<?php echo $paper_id;?>" />
  260. <input type="hidden" name="wpCode" id="wpCode" value="<?php echo $exam_id;?>" />
  261. <input type="hidden" name="schoolId" id="schoolId" value="<?php echo Yii::app()->session['school_id'];?>" />
  262. <input type="hidden" name="wpType" id="wpType" value="<?php echo $wp_type;?>" />
  263. <input type="hidden" name="className" id="className" value="<?php echo $className;?>" />
  264. <input type="hidden" name="paperName" id="paperName" value="<?php echo $paperName;?>" />
  265. </div>
  266. <!-- PAGE CONTENT ENDS -->
  267. </div>
  268. </div>
  269. </div>
  270. </div>
  271. <div class="loading-pop" style="display:none;">
  272. <div class="loading-pop-msg">正在打包,请稍候···</div>
  273. </div>
  274. <script type="text/javascript">
  275. $(document).ready(function(){
  276. /*var str = '<div class="points"></div>';
  277. $(".sc-lis").each(function(){
  278. if($(this).find(".points").length>0){
  279. $(".sel-opt").append(str);
  280. }
  281. });*/
  282. $(".sel-opt,.sel-cons").mouseover(function(){
  283. $(".sel-cons").show();
  284. }).mouseout(function(){
  285. $(".sel-cons").hide();
  286. });
  287. $(".sc-lis").click(function(){
  288. var data = {
  289. subjectId : $(this).attr('val')
  290. };
  291. $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>",data,function(flags){
  292. if(flags)
  293. {
  294. location.reload();
  295. }else
  296. {
  297. alert('网络异常');
  298. }
  299. });
  300. $('.has-sel').text($(this).text());
  301. $(".sel-cons").hide();
  302. });
  303. })
  304. function ccc(){
  305. layer.msg('敬请期待!', {
  306. time: 0,
  307. btn: ['确定', '取消'],
  308. yes: function(index){
  309. layer.close(index);
  310. return false;
  311. }
  312. });
  313. }
  314. $(function(){
  315. var school_card_status =<?php echo $examInfo->school_card_status;?>;
  316. // 全选\反选
  317. $(".selectAll").click(function(){
  318. if ($(this).prop("checked")) {
  319. $(".myselect").prop("checked",true);
  320. } else {
  321. $(".myselect").prop("checked",false);
  322. }
  323. });
  324. $("body").delegate("#stu_select_all","click",function(){
  325. $(this).closest("table").find("tbody .myselect").prop("checked",$(this).prop("checked"))
  326. })
  327. $("#addPaperStudent").click(function(){
  328. var studentsIds;
  329. var html1="";
  330. var html = ""+'<table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px"><thead><tr><th><input type="checkbox" class="stu selectAll" id="stu_select_all"></th><th>学生名称</th><th>学生编号</th></tr></thead><tbody>';
  331. <?php if($no_paper_student){
  332. foreach($no_paper_student as $v)
  333. {
  334. ?>
  335. html1=html1+'<tr><td><input type="checkbox" class="stu myselect" value="<?php echo $v['student_id']?>"></td><td><?php echo $v['realname']?></td><td><?php echo $v['student_id']?></td></tr>'
  336. <?php } }else{?>
  337. html1='<tr><td colspan="3">没有新的学生</td></tr>';
  338. <?php }?>
  339. html=html+html1;
  340. html=html+'</tbody></table>'+'<div class="row" style="margin:15px auto; text-align: center;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>'+
  341. '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>';
  342. layer.open({
  343. type: 1,
  344. area: ['450px', '280px'],
  345. title: "为本次考试添加本班学生",
  346. content: html,
  347. success: function(index, layerObj){
  348. jQuery("#cancel").on("click", function(){
  349. layer.closeAll();
  350. });
  351. jQuery("#confirm").on("click", function(){
  352. if (!$("input[class='stu myselect']").is(':checked'))
  353. {
  354. layer.msg('请至少选择一个学生!');return false;
  355. }
  356. jQuery("input[class='stu myselect']").each(function()
  357. {
  358. if(jQuery(this).is(":checked") && typeof(jQuery(this).val())!= "undefined")
  359. {
  360. studentsIds += ","+jQuery(this).val();
  361. }
  362. });
  363. if(studentsIds)
  364. {
  365. studentsIds = studentsIds.replace("undefined,",'');
  366. }
  367. var data={
  368. "studentsIds":studentsIds,
  369. "exam_id":"<?php echo $exam_id ?>",
  370. "paper_id":"<?php echo $paper_id ?>",
  371. "class_id":"<?php echo $class_id?>",
  372. };
  373. jQuery.post(
  374. "<?php echo $this->createUrl("print/addPaperStudent");?>",
  375. data,
  376. function(data){
  377. var m =JSON.parse(data);
  378. if(m.status==1)
  379. {
  380. var icon = 6;
  381. layer.alert("添加成功", {icon: icon}, function(){
  382. location.replace(location.href);
  383. });
  384. }else if(m.status==2){
  385. var icon = 5;
  386. layer.alert("添加失败,学生已在本次考试中", {icon: icon}, function(){
  387. location.replace(location.href);
  388. });
  389. }else if(m.status==3){
  390. var icon = 5;
  391. layer.alert("添加失败,学生:"+m.result+"已参加其它考试", {icon: icon}, function(){
  392. location.replace(location.href);
  393. });
  394. }else{
  395. var icon = 5;
  396. layer.alert("添加失败", {icon: icon}, function(){
  397. location.replace(location.href);
  398. });
  399. }
  400. }
  401. );
  402. layer.closeAll();
  403. });
  404. },
  405. end: function(){
  406. }
  407. });
  408. });
  409. $("#updatePaperStatus").click(function(){
  410. var studentsIds;
  411. var html1="";
  412. var html = ""+'<table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px"><thead><tr><th>当前考试准考证的长度</th><th><?php if($examInfo->school_card_length){echo $examInfo->school_card_length;}else{ if(Yii::app()->session['school_id']>999){echo 9;}else{ echo 8;}}?></th></tr><tr><th>状态</th><th><input type="radio" class="ace1" name="school_card_status" value="0" <?php if($examInfo->school_card_status==0){echo 'checked';}?>>系统准考证号<input type="radio" class="ace1" name="school_card_status" value="1" <?php if($examInfo->school_card_status==1){echo 'checked';}?>>学校准考证号</th></tr></thead><tbody>';
  413. html=html+html1;
  414. html=html+'</tbody></table>'+'<div class="row" style="margin:0px auto; text-align: center;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>'+
  415. '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>';
  416. layer.open({
  417. type: 1,
  418. area: ['450px', '190px'],
  419. title: "是否使用学校准考证",
  420. content: html,
  421. success: function(index, layerObj){
  422. jQuery("#cancel").on("click", function(){
  423. layer.closeAll();
  424. });
  425. jQuery(".ace1").on("click", function(){
  426. school_card_status = jQuery(this).attr('value');
  427. });
  428. jQuery("#confirm").on("click", function(){
  429. var data={
  430. exam_id:"<?php echo $exam_id ?>",
  431. school_card_status:school_card_status
  432. };
  433. jQuery.post(
  434. "<?php echo $this->createUrl("print/setExamStudentCard");?>",
  435. data,
  436. function(data){
  437. var m =JSON.parse(data);
  438. if(m.status==1)
  439. {
  440. var icon = 6;
  441. layer.alert("添加成功", {icon: icon}, function(){
  442. location.replace(location.href);
  443. });
  444. }else if(m.status==2){
  445. var icon = 5;
  446. layer.alert("添加失败,学生已在本次考试中", {icon: icon}, function(){
  447. location.replace(location.href);
  448. });
  449. }else if(m.status==3){
  450. var icon = 5;
  451. layer.alert("添加失败,学生:"+m.result+"已参加其它考试", {icon: icon}, function(){
  452. location.replace(location.href);
  453. });
  454. }else{
  455. var icon = 5;
  456. layer.alert("添加失败", {icon: icon}, function(){
  457. location.replace(location.href);
  458. });
  459. }
  460. }
  461. );
  462. layer.closeAll();
  463. });
  464. },
  465. end: function(){
  466. }
  467. });
  468. });
  469. $("#delPaperStudent").click(function(){
  470. // 判断是否有选中
  471. var studentsIds;
  472. layer.msg('确定删除选中的学生吗?', {
  473. time: 0,
  474. btn: ['确定', '取消'],
  475. yes: function(index){
  476. layer.close(index);
  477. if (!$("input[class='ace myselect']").is(':checked'))
  478. {
  479. layer.msg('请至少选择一个学生!');return false;
  480. }
  481. jQuery("input[class='ace myselect']").each(function()
  482. {
  483. if(jQuery(this).is(":checked") && typeof(jQuery(this).val())!= "undefined")
  484. {
  485. studentsIds += ","+jQuery(this).val();
  486. }
  487. });
  488. if(studentsIds)
  489. {
  490. studentsIds = studentsIds.replace("undefined,",'');
  491. }
  492. var data={
  493. "studentsIds":studentsIds,
  494. "exam_id":"<?php echo $exam_id ?>",
  495. "paper_id":"<?php echo $paper_id ?>",
  496. "class_id":"<?php echo $class_id?>",
  497. };
  498. jQuery.post(
  499. "<?php echo $this->createUrl("print/delPaperStudent?");?>",data,function(data){
  500. var m =JSON.parse(data);
  501. if(m.status==1)
  502. {
  503. var icon = 6;
  504. layer.alert("删除成功", {icon: icon}, function(){
  505. location.replace(location.href);
  506. });
  507. }else if(m.status==2){
  508. var icon = 5;
  509. layer.alert("不能删除已上传成绩的学生", {icon: icon}, function(){
  510. location.replace(location.href);
  511. });
  512. }else{
  513. var icon = 5;
  514. layer.alert("删除失败", {icon: icon}, function(){
  515. location.replace(location.href);
  516. });
  517. }
  518. });
  519. }
  520. });
  521. });
  522. $("#delPaperStudentAll").click(function(){
  523. // 判断是否有选中
  524. var studentsIds;
  525. layer.msg('确定删除全部未考试的学生吗?', {
  526. time: 0,
  527. btn: ['确定', '取消'],
  528. yes: function(index){
  529. layer.close(index);
  530. var data={
  531. "exam_id":"<?php echo $exam_id ?>",
  532. "paper_id":"<?php echo $paper_id ?>",
  533. "class_id":"<?php echo $class_id?>",
  534. };
  535. jQuery.post(
  536. "<?php echo $this->createUrl("print/delPaperStudentAll?");?>",data,function(data){
  537. var m =JSON.parse(data);
  538. if(m.status==1)
  539. {
  540. var icon = 6;
  541. layer.alert("删除成功", {icon: icon}, function(){
  542. location.replace(location.href);
  543. });
  544. }else if(m.status==2){
  545. var icon = 5;
  546. layer.alert("不能删除已上传成绩的学生", {icon: icon}, function(){
  547. location.replace(location.href);
  548. });
  549. }else{
  550. var icon = 5;
  551. layer.alert("删除失败", {icon: icon}, function(){
  552. location.replace(location.href);
  553. });
  554. }
  555. });
  556. }
  557. });
  558. });
  559. // 打印答案解析
  560. $("#printAnswer").click(function(){
  561. layer.msg('您确定下载答案解析嘛?', {
  562. time: 0,
  563. btn: ['确定', '取消'],
  564. yes: function(index){
  565. layer.close(index);
  566. var wpCode = $("#wpCode").val();
  567. if (!wpCode) {
  568. layer.msg('周周练id有误!');return false;
  569. }
  570. jQuery.post(
  571. '<?php echo $this->createUrl('print/createtempelate');?>',
  572. {"eid":wpCode},
  573. function(data){
  574. var obj = JSON.parse(data);
  575. if (obj.success == 1) {
  576. //alert(obj.message);
  577. //alert(obj);
  578. evaluationClient.printDAJX(JSON.stringify(obj.object));
  579. } else {
  580. layer.msg(obj.message);
  581. }
  582. }
  583. );
  584. }
  585. });
  586. });
  587. $("#selectPrint").click(function(){
  588. var tpl = "<?php echo $tpl;?>";
  589. var paperType = "<?php echo $paperType;?>";
  590. document.paperData = <?php echo $paperData;?>;
  591. if (tpl == "2") {
  592. layer.msg('请先上传试题模板!');return false;
  593. }
  594. var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
  595. if(paperType == 2 && answerCardUploaded == 0){
  596. layer.msg('请先上传答题卡模板!');return false;
  597. }
  598. // 判断是否有选中
  599. if (!$("input[class='ace myselect']").is(':checked')) {
  600. layer.msg('请至少选择一个学生!');return false;
  601. }
  602. layer.msg('您确定打印嘛?', {
  603. time: 0,
  604. btn: ['确定', '取消'],
  605. yes: function(index){
  606. layer.close(index);
  607. var result = [];
  608. var paperId = $("#paperId").val();
  609. var wpCode = $("#wpCode").val();
  610. var schoolId = $("#schoolId").val();
  611. var wpType = $("#wpType").val();
  612. var paperName = $("#paperName").val();
  613. var className = $("#className").val();
  614. var markType = <?php echo $markType;?>;
  615. if (!paperId || !wpCode || !schoolId || !wpType || !paperName || !className) {
  616. layer.msg('打印信息错误!');return false;
  617. }
  618. $(".myselect").each(function(m,n){
  619. if ($(this).prop('checked')) {
  620. if ($(this).val() && $(this).attr("stnm")) {
  621. result.push('{'+'"clazzName":"'+className+'","paperId":"'+paperId+'","paperName":"'+paperName+'","selectQTNub":'+document.paperData.object.topicsCount.singleChoice+',"completionNub":'+document.paperData.object.topicsCount.blankFilling+',"questionSNub":'+document.paperData.object.topicsCount.shortAnswer+',"schoolId":"'+schoolId+'","studentCode":"'+$(this).val()+'","studentName":"'+$(this).attr("stnm")+'","wpCode":"'+wpCode+'","wpType":"'+wpType+'","markType":"'+markType+'"}');
  622. }
  623. }
  624. });
  625. // 更试卷打印时间
  626. $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
  627. evaluationClient.printPaper("["+result+"]");
  628. }
  629. });
  630. });
  631. $("#selectPrintPack").click(function(){
  632. var tpl = "<?php echo $tpl;?>";
  633. var paperType = "<?php echo $paperType;?>";
  634. document.paperData = <?php echo $paperData;?>;
  635. if (tpl == "2") {
  636. layer.msg('请先上传试题模板!');return false;
  637. }
  638. var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
  639. if(paperType == 2 && answerCardUploaded == 0){
  640. layer.msg('请先上传答题卡模板!');return false;
  641. }
  642. // 判断是否有选中
  643. if (!$("input[class='ace myselect']").is(':checked')) {
  644. layer.msg('请至少选择一个学生!');return false;
  645. }
  646. $(".loading-pop").show();
  647. var student_ids = '';
  648. $(".myselect").each(function(m,n){
  649. if ($(this).prop('checked')) {
  650. if ($(this).val() && $(this).attr("stnm")) {
  651. student_ids = student_ids +$(this).val()+',';
  652. }
  653. }
  654. });
  655. var data = {
  656. exam_id:"<?php echo $exam_id ?>",
  657. student_id:student_ids
  658. };
  659. $.post("<?php echo Yii::app()->createUrl('print/print_pack')?>",data,function(flags){
  660. var m = JSON.parse(flags);
  661. if(m.status==1)
  662. {
  663. var html = ""+
  664. '<div style="padding:20px 30px 0px 30px">'+
  665. '<div style="padding:8px 0;">请复制下方链接打印包。</div>'+
  666. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  667. '<div class="row" style="margin:30px auto 0px auto;text-align:center"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;background:gray;border-color:gray;">关闭</button>'+
  668. '</div>'+
  669. '</div>'+
  670. "";
  671. layer.open({
  672. type: 1,
  673. area: ['550px', '220px'],
  674. title: '打印包',
  675. content: html,
  676. success: function(index, layerObj){
  677. $(".loading-pop").hide();
  678. jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+m.result+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  679. jQuery("#confirm, #cancel").on("click", function(){
  680. layer.close(layerObj);
  681. });
  682. jQuery("#copy").on("click", function(){
  683. jQuery("#url").select();
  684. });
  685. },
  686. end: function(){
  687. }
  688. });
  689. return;
  690. }else
  691. {
  692. layer.msg(m.result);
  693. $(".loading-pop").hide();return;
  694. }
  695. });
  696. });
  697. })
  698. </script>