class_exam2.php 111 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474
  1. <script type="text/javascript">
  2. function in_array(search, array){
  3. for(var i in array){
  4. if(array[i]==search){
  5. return true;
  6. }
  7. }
  8. return false;
  9. }
  10. //客户端发送打印弹窗(客户端调用)
  11. function sendToPrint(){
  12. layer.msg('已成功发送至打印列表');
  13. }
  14. testFlag = "<?php echo $this->testFlag;?>";
  15. customTplsIds = new Array();
  16. var i = 0;
  17. <?php foreach(Yii::app()->params["custom_tpls_ids"] as $tplId){?>
  18. customTplsIds[i] = "<?php echo $tplId;?>";
  19. i++;
  20. <?php }?>
  21. jQuery(document).ready(function(){
  22. // 打印答案解析
  23. $(".answerAnalysis").click(function(){
  24. var element = this;
  25. var isEng = $(this).attr('isEng');
  26. layer.msg('您确定下载答案解析嘛?', {
  27. time: 0,
  28. btn: ['确定', '取消'],
  29. yes: function(index){
  30. layer.close(index);
  31. var wpCode = jQuery(element).attr("examId");
  32. if (!wpCode) {
  33. layer.msg('周周练id有误!');return false;
  34. }
  35. jQuery.post(
  36. '<?php echo $this->createUrl('print/createtempelate');?>',
  37. {"eid":wpCode},
  38. function(data){
  39. var obj = JSON.parse(data);
  40. if (obj.success == 1) {
  41. /*alert(obj.message);
  42. alert(obj);*/
  43. if(isEng == 1){
  44. evaluationClient.PrintSubjectDAJX(JSON.stringify(obj.object));
  45. }else{
  46. evaluationClient.newprintDAJX(JSON.stringify(obj.object));
  47. }
  48. } else {
  49. layer.msg(obj.message);
  50. }
  51. }
  52. );
  53. }
  54. });
  55. });
  56. // 根据年级筛选班级
  57. });
  58. </script>
  59. <style>
  60. .loading-pop{position: fixed;left: 0;top: 0;bottom: 0;right: 0;background: rgba(0,0,0,0.5);z-index: 200;}
  61. .loading-pop-msg{color: #fff;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);font-size: 22px;letter-spacing: 4px;}
  62. /*切换选择*/
  63. .tab-con{
  64. position: relative;
  65. height: 30px;
  66. width: 200px;
  67. background: #F2F2F2;
  68. border: 1px solid #619aff;
  69. border-radius: 15px;
  70. }
  71. .has-sel{
  72. background: #2977ff;
  73. color: #fff;
  74. width: 50%;
  75. height: 30px;
  76. border-top-left-radius: 15px;
  77. border-bottom-left-radius: 15px;
  78. text-align: center;
  79. line-height: 30px;
  80. }
  81. .sel-opt{
  82. width: 50%;
  83. position: relative;
  84. color: #2977ff;
  85. line-height: 30px;
  86. text-indent: 6px;
  87. cursor: pointer;
  88. }
  89. .sel-opt:after{
  90. content: '';
  91. border-left: 6px solid transparent;
  92. border-right: 6px solid transparent;
  93. border-top: 8px solid #2977ff;
  94. position: absolute;
  95. right: 12px;
  96. top: 12px;
  97. }
  98. // .sel-opt select{
  99. // width: 100%;
  100. // height: 30px;
  101. // background: #F2F2F2;
  102. // color: #01B677;
  103. // text-indent: 6px;
  104. // font-size: inherit;
  105. // border-top-right-radius: 15px;
  106. // border-bottom-right-radius: 15px;
  107. // cursor: pointer;
  108. // }
  109. // .sel-opt select option{
  110. // position: relative;
  111. // }
  112. .points{
  113. position: absolute;
  114. top: -2px;
  115. right: 0;
  116. width: 10px;
  117. height: 10px;
  118. background: #F01516;
  119. border-radius: 50%;
  120. }
  121. .sel-cons{
  122. border: 1px solid #2977ff;
  123. width: 50%;
  124. position: absolute;
  125. right: 0;
  126. top: 30px;
  127. text-indent: 10px;
  128. display: none;
  129. }
  130. .sc-lis{
  131. line-height: 30px;
  132. cursor: pointer;
  133. }
  134. .sc-lis span{
  135. position: relative;
  136. }
  137. .sc-lis .points{
  138. top: 2px;
  139. right: -16px;
  140. }
  141. .h_list span {font-size: 14px;}
  142. .add_class_input {width: 20px;height: 20px;vertical-align: -4px;}
  143. .class_right li{margin-bottom: 2px;}
  144. .dialog-information-inquiry{
  145. display: none;
  146. width: 400px;
  147. margin: 0 auto;
  148. border: 1px solid #f1f1f1;
  149. /*box-shadow:4px 4px 10px #7c7c7c;*/
  150. }
  151. .dialog-information-inquiry .title{
  152. padding: 0 16px;
  153. height: 30px;
  154. line-height: 30px;
  155. background-color: #2977ff;
  156. }
  157. .dialog-information-inquiry .title .title-text{
  158. font-size: 18px;
  159. color: #fff;
  160. font-weight: 650px;
  161. }
  162. .dialog-information-inquiry .title .title-tag{
  163. display: inline-block;
  164. margin-right: 20px;
  165. margin-top: 10px;
  166. padding: 6px 12px;
  167. height: 16px;
  168. line-height: 16px;
  169. color: #fff;
  170. border: 1px solid #F8F8FA;
  171. border-radius: 4px;
  172. background-color: #2977ff;
  173. cursor: pointer;
  174. }
  175. .dialog-information-inquiry .dialog-btn-close{
  176. display: inline-block;
  177. color: #fff;
  178. cursor: pointer;
  179. }
  180. .dialog-information-inquiry .dialog-msg{
  181. margin: 20px 0;
  182. text-align: center;
  183. line-height: 20px;
  184. font-size: 16px;
  185. }
  186. .dialog-information-inquiry .btn-box{
  187. margin-bottom: 28px;
  188. text-align: center;
  189. }
  190. .dialog-information-inquiry .btn-yes{
  191. display: inline-block;
  192. /* padding: 6px 12px; */
  193. width:90px;
  194. height: 30px;
  195. line-height: 30px;
  196. border-radius: 4px;
  197. color: #fff;
  198. cursor: pointer;
  199. background-color: #2977ff;
  200. }
  201. .show_classes{display: inline-block;padding:2px 10px 5px 5px;}
  202. </style>
  203. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
  204. <link rel="stylesheet" href="/fonts/zip/iconfont.css" />
  205. <link rel="stylesheet" href="/css/alert.css"/>
  206. <link rel="stylesheet" href="/css/assist/successPage.css"/>
  207. <link type="text/css" rel="stylesheet" href="/js/select/select2.min.css" />
  208. <script src="/js/select/select2.min.js"></script>
  209. <div class="main-content-inner">
  210. <!-- 导航栏开始-->
  211. <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
  212. <!-- 导航栏结束-->
  213. <div class="page-content">
  214. <div class="row" style="margin:0px;">
  215. <div class="col-xs-12">
  216. <!-- PAGE CONTENT BEGINS -->
  217. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  218. <div class="row">
  219. <form method="get" id="form1" action="<?php echo $this->createUrl("print/class_exam");?>" style="padding-left: 0;">
  220. <div class="clearfix"style="padding-left: 12px;">
  221. <div class="hgc_headOPerator fl" style="background: transparent;padding-left: 0;">
  222. <div class="menuBtn" id="hgc_scanUploadBtn">
  223. <img src="/images/assist/icon_hgc_menu.svg" />
  224. <span class="btnText">考试详情管理</span>
  225. </div>
  226. </div>
  227. <div class="hgc_siderBar" id="hgc_siderBar">
  228. <div class="menuBtn" id="hgc_hideMenuBtn">
  229. <img src="/images/assist/icon_hgc_menu.svg" />
  230. <span class="btnText">扫描上传管理</span>
  231. </div>
  232. <ul class="menuList">
  233. <li>
  234. <a>考试详情管理</a>
  235. </li>
  236. <li>
  237. <a href="<?php echo $this->createUrl('print/getTaskDetail',array('exam_group_id'=>$exam_group_data->exam_group_id,'grade'=>$grade,'branch'=>$branch))?>">扫描上传管理</a>
  238. </li>
  239. <!-- <li>
  240. <a>阅卷监控管理</a>
  241. </li>-->
  242. <li class="back" id="hgc_menuBack">
  243. <a href="<?php echo $this->createUrl('print/index')?>"> <img src="/images/assist/icon_hgc_back.svg" alt=""> 返回</a>
  244. </li>
  245. </ul>
  246. </div>
  247. <script>
  248. var scanMenuBtn = document.getElementById('hgc_scanUploadBtn');
  249. var scanMenu = document.getElementById('hgc_siderBar')
  250. var scanMenuBack = document.getElementById('hgc_menuBack')
  251. var scanMenuHideBtn = document.getElementById('hgc_hideMenuBtn')
  252. scanMenuBtn.addEventListener('click',function(){
  253. var originMeunText = scanMenuBtn.lastElementChild.innerText;
  254. scanMenu.style.top = $(scanMenuBtn).offset().top - $(window).scrollTop()+'px'
  255. scanMenu.className = 'hgc_siderBar active'
  256. scanMenuHideBtn.lastElementChild.innerText = originMeunText
  257. })
  258. scanMenuBack.addEventListener('click',function(){
  259. scanMenu.className = 'hgc_siderBar'
  260. })
  261. scanMenuHideBtn.addEventListener('click',function(){
  262. scanMenu.className = 'hgc_siderBar'
  263. })
  264. </script>
  265. <div class="dataTables_length margin-zy fl" style="margin-top: 15px;">
  266. <input type="text" class="form-control input-sm" placeholder="请输入班级名称" name="class_name" value="<?php echo $class_name;?>">
  267. <input type="hidden" name="exam_group_id" value="<?php echo $exam_group_data->exam_group_id?>">
  268. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  269. </div>
  270. <div style="float: right;margin-right: 30px;margin-top:12px; padding-bottom: 10px;" class="h_list">
  271. <?php
  272. if ($subject && $exam_group_data['is_scan_changed'] == 0 && $exam_group_data['homework'] == 0 && (Yii::app()->session['session_subject_id']!=8 || $exam_group_data['qxk_paper_id']>0)) {
  273. ?>
  274. <?php if(!$printList[0]['online_card']):?>
  275. <span class="click-sc addbx" aria-hidden="true" title="在线答题卡" onclick="createCardOnlineThree('<?php echo $exam_group_id; ?>','<?php echo $noOnline ?>')">在线答题卡</span>
  276. <?php else:?>
  277. <a class="click-sc addbx" aria-hidden="true" title="在线答题卡" href="<?php echo $this->createUrl('online/answersheetList',array('examGroupId'=>$exam_group_id))?>?isThird=0&examGroupId=<?php echo $exam_group_id;?>">在线答题卡</a>
  278. <?php endif;?>
  279. <?php
  280. }
  281. ?>
  282. <?php if($print['paper_tpl_type'] == 1){?>
  283. <span class="click-sc addbx" aria-hidden="true" title="生成模板" onclick="createTemplate('<?php echo $exam_id;?>',1)">生成模板</span>
  284. <span class=" click-sc addbx" aria-hidden="true" title="上传模板" onclick="uploadTemplate('<?php echo $exam_id?>','<?php echo $exam_name;?>', 1)">上传模板</span>
  285. <span class="click-sc addbx answerAnalysis" examId="<?php echo $exam_id;?>" aria-hidden="true" title="下载答案解析">下载答案解析</span>
  286. <?php };?>
  287. <?php if($qxk_paper_id){
  288. echo '<span class=" click-sc addbx downloadAllSubjectPaper" aria-hidden="true" title="下载试卷及答案" >下载试卷及答案</span>';
  289. }else{
  290. if($print['paper_tpl_type'] == 2){?>
  291. <span class=" click-sc addbx" aria-hidden="true" title="下载试卷" onclick="createTemplate('<?php echo $exam_id;?>',2)">下载试卷</span>
  292. <?php
  293. if(isset(Yii::app()->session['testFlag']) && (Yii::app()->session['testFlag']==1)){
  294. ?>
  295. <span class=" click-sc addbx" aria-hidden="true" title="下载答题卡" onclick="createTemplate('<?php echo $exam_id;?>',3)">下载答题卡</span>
  296. <?php
  297. }
  298. ?>
  299. <?php if(!$print['is_custom_tpl']){?><span class=" click-sc addbx" aria-hidden="true" title="上传答题卡" onclick="uploadTemplate('<?php echo $exam_id;?>','<?php echo $exam_name ?>', 2)">上传答题卡</span><?php }?>
  300. <span class=" click-sc addbx answerAnalysis" examId="<?php echo $exam_id;?>" aria-hidden="true" title="下载答案解析">下载答案解析</span>
  301. <?php };?>
  302. <?php if($print['paper_tpl_type'] == 3){
  303. ?>
  304. <span class=" click-sc addbx" aria-hidden="true" title="下载题卡合一" onclick="createTemplate('<?php echo $exam_id;?>',4)">下载题卡合一</span>
  305. <span class=" click-sc addbx answerAnalysis" examId="<?php echo $exam_id;?>" aria-hidden="true" title="下载答案解析">下载答案解析</span>
  306. <?php
  307. }?>
  308. <?php if($print['paper_tpl_type'] == 4) {
  309. ?>
  310. <span class="click-sc addbx" aria-hidden="true" title="下载试卷" onclick="createTemplate('<?php echo $exam_id; ?>',2)">下载试卷</span>
  311. <span class=" click-sc addbx" aria-hidden="true" title="下载题卡分离" onclick="createTemplate('<?php echo $exam_id; ?>',4)">下载题卡分离</span>
  312. <span class=" click-sc addbx answerAnalysis" examId="<?php echo $exam_id;?>" aria-hidden="true" title="下载答案解析">下载答案解析</span>
  313. <?php
  314. }
  315. if($print['paper_tpl_type'] == 5){?>
  316. <span class=" click-sc addbx" aria-hidden="true" title="下载试卷" onclick="createTemplate('<?php echo $exam_id;?>',11)">下载试卷</span>
  317. <span class=" click-sc addbx" aria-hidden="true" title="下载答题卡" onclick="createTemplate('<?php echo $exam_id;?>',12)">下载答题卡</span>
  318. <span class=" click-sc addbx answerAnalysis" isEng = '1' examId="<?php echo $exam_id;?>" aria-hidden="true" title="下载答案解析">下载答案解析</span>
  319. <?php }
  320. }
  321. ?>
  322. <?php if($exam_group_data->mark_type > 0 && $exam_group_data->mark_status==2 && $exam_group_data->upload_status==2 && $exam_group_data->import_score_type==0 && ($exam_group_data['homework']==0 || !$is_all_select))
  323. {
  324. ?>
  325. <span class="click-sc addbx" aria-hidden="true" title="恢复考试状态" onclick="renewExamStat('<?php echo $exam_id; ?>')">恢复考试状态</span>
  326. <?php
  327. }?>
  328. <span class=" click-sc addbx" id="addClass" <?php if(!$enable_add_class){echo 'style="background-color:gray;border-color:gray" enable=0';}else{echo 'enable=1';}?> grade="<?php echo $grade;?>" branch="<?php echo $branch; ?>" eid="<?php echo $exam_group_id;?>" aria-hidden="true" title="添加班级">添加班级</span>
  329. <!--<span class=" click-sc addbx click-delete answerAnalysis" id="delPaperStudentAll" aria-hidden="true" title="删除全部未考试学生">删除全部未考试学生</span>-->
  330. <span class=" click-sc addbx " id="viewNoUploadPaperStudentAll" exam_group_id="<?php echo $exam_group_id?>" aria-hidden="true" title="查看未上传考生">查看未上传考生</span>
  331. <span class=" click-sc addbx " id="transfer" exam_group_id="<?php echo $exam_group_id?>" aria-hidden="true" title="转移学生成绩">转移学生成绩</span>
  332. <span class=" click-sc addbx " <?php if($restore==1 || $exam_uploaded==0){echo 'style="background-color:gray;border-color:gray" '; }else{ echo 'id="restore"';}?> exam_name="<?php echo $exam_name?>" exam_group_id="<?php echo $exam_group_id?>" exam_date="<?php echo $exam_date?>" aria-hidden="true" title="申请还原考试">申请还原考试</span>
  333. <?php if(in_array(Yii::app()->session['session_subject_id'],array_merge(Yii::app()->params['mathSubjectId'],array(12)))): ?>
  334. <span class=" click-sc addbx topicPushBatch" exam_name="<?php echo $exam_name?>" exam_group_id="<?php echo $exam_group_id?>" aria-hidden="true" title="指定题目">指定题目</span>
  335. <?php endif;?>
  336. </div>
  337. </div>
  338. </form>
  339. </div>
  340. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  341. <thead>
  342. <tr>
  343. <th>
  344. <input type="checkbox" class="ace selectAll">
  345. 名称</th>
  346. <th>班级</th>
  347. <th>班级类型</th>
  348. <th>是否打印(word)</th>
  349. <?php
  350. if($online_card==1 && $is_qrcode_online==1){
  351. ?>
  352. <th>在线答题卡生成进度</th>
  353. <?php }?>
  354. <th>是否打印(在线答题卡)</th>
  355. <th >成绩已上传/总数</th>
  356. <th >答卷图片已上传/总数</th>
  357. <th >原卷已上传/总数</th>
  358. <th >操作</th>
  359. </tr>
  360. </thead>
  361. <tbody>
  362. <?php if(!empty($printList)):foreach($printList as $cl):?>
  363. <tr>
  364. <td style="max-width:260px">
  365. <input type="checkbox" class="ace myselect" value="<?php echo $cl['exam_id'];?>">
  366. <?php
  367. $imgSrc = "";if($exam_group_data->mark_type > 0){$imgTitle="线上阅卷";$imgSrc.="/images/online/";}else{$imgTitle="线下阅卷";$imgSrc.="/images/offline/";}$imgSrc.="{$cl["paper_size"]}.png";$cursor = "pointer";echo "<img class='paperType' style='cursor:pointer;width:22px;height:22px;margin-right:5px;' title='{$imgTitle}' src='{$imgSrc}'/>";?>
  368. <?php echo $cl['print_name'];?>
  369. </td>
  370. <td style="max-width:100px"><?php if(isset($class_data[$cl['class_id']])){echo $class_data[$cl['class_id']];}?></td>
  371. <td style="max-width:100px"><?php if(isset($class_types[$cl['class_id']])){echo $class_types[$cl['class_id']];}?></td>
  372. <td><?php if(isset($exam_print[$cl['exam_id']]) && !empty($exam_print[$cl['exam_id']])){echo '已打印';}else{echo '未打印';}?></td>
  373. <?php
  374. if($online_card==1 && $is_qrcode_online==1){
  375. ?>
  376. <td>
  377. <?php if(isset($cl['card_created'])){echo $cl['card_created'];}else{ echo 0;}?>/<?php if(isset($exam_student[$cl['exam_id']])){echo count($exam_student[$cl['exam_id']]);}else{ echo 0;}?>
  378. </td>
  379. <?php }?>
  380. <td><?php if(isset($exam_online_print[$cl['exam_id']]) && !empty($exam_online_print[$cl['exam_id']])){echo '已打印';}else{echo '未打印';}?></td>
  381. <td>
  382. <?php if(isset($exam_up_student[$cl['exam_id']])){echo count($exam_up_student[$cl['exam_id']]);}else{ echo 0;}?>/<?php if(isset($exam_student[$cl['exam_id']])){echo count($exam_student[$cl['exam_id']]);}else{ echo 0;}?>
  383. </td>
  384. <td>
  385. <?php if(isset($student_answer_img_num[$cl['exam_id']])){echo $student_answer_img_num[$cl['exam_id']];}else{ echo 0;}?>/<?php if(isset($exam_student[$cl['exam_id']])){echo count($exam_student[$cl['exam_id']]);}else{ echo 0;}?>
  386. </td>
  387. <td>
  388. <?php if(isset($student_img_up_num[$cl['exam_id']])){echo count($student_img_up_num[$cl['exam_id']]);}else{ echo 0;}?>/<?php if(isset($exam_student[$cl['exam_id']])){echo count($exam_student[$cl['exam_id']]);}else{ echo 0;}?>
  389. </td>
  390. <td style="width:265px;">
  391. <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生" onclick="javascript:location.href='<?php echo $this->createUrl('print/change',array('cid'=>$cl['class_id'],'eid'=>$cl['exam_id'],'tid'=>$cl['type']));?>'">&#xe668;</span>
  392. <?php if(!$print['is_custom_tpl'] && $print['paper_tpl_type'] != 3){ ?><span class="iconfont click-sc addbx" aria-hidden="true" title="<?php if($print['paper_tpl_type'] == 2){echo '打印答题卡';}else{echo '打印试卷';}?>" onclick="<?php if($print["paper_tpl_type"] == 2 && !$print["answer_card_uploaded"]){?>layer.msg('请先上传答题卡模板');<?php }else{?>print('<?php echo $cl['class_id'];?>','<?php echo $cl['exam_id'];?>','0',<?php echo $print['is_tpl'];?>);<?php }?>">&#xe6bb;</span>
  393. <!-- <span class="iconfont icon-zip click-sc addbx print_pack" w_class_id="--><?php //echo $cl['class_id'];?><!--" w_exam_id="--><?php //echo $cl['exam_id']; ?><!--" title="打包打印" ></span>-->
  394. <?php }?>
  395. <?php
  396. if($cl['online_card']==1 && $cl['is_qrcode_online']==1){
  397. ?>
  398. <span class="iconfont click-sc addbx downloadOnlinePdf" style="padding:5px 0;" class_id="<?php echo $cl['class_id']?>" exam_id="<?php echo $cl['exam_id']; ?>" aria-hidden="true" ><img src="/images/online/pdf.svg"></span>
  399. <?php
  400. }
  401. ?>
  402. <span class="iconfont addbx click-delete delClass" <?php if($cl['upload_status']==0 && $page_total>1){ echo 'style="background-color: red;" w_enable=1';}else{echo 'style="background-color: gray;border-color:gray;" w_enable=0';}?> w_class_id="<?php echo $cl['class_id'];?>" w_exam_id="<?php echo $cl['exam_id']; ?>" title="删除" onclick="delExam(this)">删</span>
  403. <?php if($exam_group_data->mark_type ==4 && $cl['status']==1 && $exam_group_data->import_score_type==0 && ($exam_group_data['homework']==0 || !$is_all_select))
  404. {
  405. ?>
  406. <span class="click-sc addbx" aria-hidden="true" title="恢复考试状态" onclick="renewExamStatClass('<?php echo $cl['exam_id']; ?>')">恢</span>
  407. <?php
  408. }?>
  409. <?php
  410. if(Yii::app()->session['session_subject_id']==8 && $is_all_select==1 && $exam_group_data['mark_type']==4){
  411. ?>
  412. <span class="click-sc addbx sendExamStomp" aria-hidden="true" title="上传完成" examGroupId="<?php echo $exam_group_data['exam_group_id']; ?>" examId="<?php echo $cl['exam_id']; ?>" >上传完成</span>
  413. <?php
  414. }
  415. ?>
  416. <?php
  417. if(in_array(Yii::app()->session['session_subject_id'],array(3,6,51,12)) && $is_all_select==1 && $exam_group_data['mark_type']==4){
  418. ?>
  419. <span class="click-sc addbx sendExamStomp" aria-hidden="true" title="上传完成" examGroupId="<?php echo $exam_group_data['exam_group_id']; ?>" examId="<?php echo $cl['exam_id']; ?>" >上传完成</span>
  420. <?php
  421. }
  422. ?>
  423. <?php
  424. if($exam_group_data['homework']==1 && $is_all_select==1 && $exam_group_data['mark_type']==4){
  425. ?>
  426. <span class="click-sc addbx sendExamStompHomework" aria-hidden="true" title="完成作业" examGroupId="<?php echo $exam_group_data['exam_group_id']; ?>" examId="<?php echo $cl['exam_id']; ?>" >完成作业</span>
  427. <?php
  428. }
  429. ?>
  430. <?php if(in_array(Yii::app()->session['session_subject_id'],array_merge(Yii::app()->params['mathSubjectId'],array(12)))): ?>
  431. <?php if(isset($topic_push_setting[(string)$cl['exam_id']])):?>
  432. <span class="iconfont addbx topicPush" aria-hidden="true" title="指定题目" examGroupId="<?php echo $exam_group_data['exam_group_id']; ?>" examId="<?php echo $cl['exam_id']; ?>" ><img src="/images/topic_push_2.png" ></span>
  433. <?php else:?>
  434. <span class="iconfont addbx topicPush" aria-hidden="true" title="指定题目" examGroupId="<?php echo $exam_group_data['exam_group_id']; ?>" examId="<?php echo $cl['exam_id']; ?>" ><img src="/images/topic_push_1.png" ></span>
  435. <?php endif;?>
  436. <?php endif;?>
  437. </td>
  438. </tr>
  439. <?php endforeach;else:?>
  440. <tr><td colspan="5">暂无数据!</td></tr>
  441. <?php endif;?>
  442. </tbody>
  443. </table>
  444. <?php if(!empty($page_total)):?>
  445. <div class="row">
  446. <div class="col-xs-6">
  447. &nbsp;
  448. </div>
  449. <div class="col-xs-6">
  450. <div class="dataTables_paginate paging_simple_numbers">
  451. <?php
  452. $this->widget('CLinkPager', array(
  453. 'header' => '',
  454. 'firstPageLabel'=> '首页',
  455. 'lastPageLabel' => '末页',
  456. 'prevPageLabel' => '上一页',
  457. 'nextPageLabel' => '下一页',
  458. 'pages' => $pages,
  459. 'maxButtonCount'=> 5,
  460. ));
  461. echo '共:'.$page_total.'条';
  462. ?>
  463. </div>
  464. </div>
  465. </div>
  466. <?php endif;?>
  467. </div>
  468. <!--上传模板弹窗-->
  469. <!-- PAGE CONTENT ENDS -->
  470. </div>
  471. </div>
  472. </div>
  473. </div>
  474. <div class="loading-pop" style="display:none;">
  475. <div class="loading-pop-msg">正在打包,请稍候···</div>
  476. </div>
  477. <!-- 弹窗 -->
  478. <div class="confirmbox-mask" style="display: none;" id="fieldModal">
  479. <div class="class-modal" style="padding: 0px;">
  480. <div class="class-modal-head" style="background-color: #2977ff;color: white;height: 30px;font-size: 16px;font-weight: initial;"><span style="float: left;padding: 5px;">添加考试班级</span><span class=" add-class-close" style="float: right;padding: 5px;cursor: pointer;">X</span></div>
  481. <form id="examSelect">
  482. <div class="class-modal-body">
  483. <p class="title">
  484. <input type="hidden" id="grade_id" name="grade_id" value="0">
  485. <span style="float: left;" id="grade">
  486. </span>
  487. <span style="margin-left: 20px;">
  488. <select class="form-control" id="branch" name="branch" style="width: auto;display: inline-block">
  489. <option value="0">全部</option>
  490. <option value="1">文科</option>
  491. <option value="2">理科</option>
  492. </select>
  493. <span style="margin-left: 20px;">
  494. <input type="checkbox" id="global_check_all" class="add_class_input">&nbsp;全选 &nbsp;&nbsp;<span style="color: red;">(共选中<i id="allCheckCount">0</i>个)</span>
  495. </span>
  496. </span>
  497. <span style="float: right;color: red;margin-right: 20px;">已自动过滤考试中的班级</span>
  498. </p>
  499. <div class="class_area" id="class_area">
  500. <div class="class_left">
  501. <p><span style="font-weight: bold">A层班级</span> (已选: <i id="aCheckCount">0</i>)</p>
  502. </div>
  503. <ul class="class_right area_1">
  504. </ul>
  505. <div class="clear"></div>
  506. <div class="class_left">
  507. <p><span style="font-weight: bold">B层班级</span> (已选: <i id="bCheckCount">0</i>)</p>
  508. </div>
  509. <ul class="class_right area_2">
  510. </ul>
  511. <div class="clear"></div>
  512. <div class="class_left">
  513. <p><span style="font-weight: bold">C层班级</span> (已选: <i id="cCheckCount">0</i>)</p>
  514. </div>
  515. <ul class="class_right area_3">
  516. </ul>
  517. </div>
  518. </div>
  519. <p class="class_btn" style="text-align: center;">
  520. <input type="hidden" name="exam_gruop_id" value="0">
  521. <button type="button" class="setting_sumbit" style="margin-right: 10px;">确定</button>
  522. <button type="button" class="cancel-btn">取消</button>
  523. </p>
  524. </form>
  525. </div>
  526. </div>
  527. <!--题目设置弹窗-->
  528. <style>
  529. .topic_list,.topic_class{width:100%;display: block;clear:both}
  530. .topic_list li{padding:0 10px;height:30px;border:1px solid #ccc;background: #fff;margin:5px;text-align: center;line-height: 30px;cursor: pointer}
  531. /*.topic_list li.active{background:#aaa}*/
  532. .topic_list li.active{background:#2977ff;color:#FFFFFF}
  533. .topic_class li{margin:0 10px 5px 10px;padding:0;float:left}
  534. .topic-modal-body{margin-top:15px;max-height: 400px;overflow: auto}
  535. .topic_right{float:left;margin-bottom:15px;}
  536. .topic_right li{float:left;}
  537. </style>
  538. <div class="confirmbox-mask" style="display:none;" id="fieldModalTopic">
  539. <div class="class-modal" style="padding: 0px;">
  540. <div class="class-modal-head" style="background-color: #2977ff;color: white;height: 30px;font-size: 16px;font-weight: initial;"><span style="float: left;padding: 5px;">指定题目</span><span class="topic-push-close" style="float: right;padding: 5px;cursor: pointer;">X</span></div>
  541. <form id="examSelect">
  542. <div class="topic-modal-body">
  543. <div class="class_area" id="class_area">
  544. <div class="">
  545. <p><span style="font-weight: bold">适用班级</span> </p>
  546. </div>
  547. <ul class="topic_class">
  548. <li><span>班级1</span></li>
  549. <li><span>班级1</span></li>
  550. <li><span>班级1</span></li>
  551. <li><span>班级1</span></li>
  552. </ul>
  553. <div class="clear"></div>
  554. <div class="paper_topic_show">
  555. <div class="">
  556. <p><span style="font-weight: bold">试题结构</span> </p>
  557. </div>
  558. <div class="">
  559. <p><span style="font-weight: bold">单选题</span> </p>
  560. </div>
  561. <ul class="class_right topic_list">
  562. <li><span>1</span></li>
  563. <li><span>1</span></li>
  564. <li class="active"><span >1</span></li>
  565. </ul>
  566. <div class="">
  567. <p><span style="font-weight: bold">单选题</span> </p>
  568. </div>
  569. <ul class="class_right topic_list">
  570. <li><span>1</span></li>
  571. <li><span>1</span></li>
  572. <li class="active"><span >1</span></li>
  573. </ul>
  574. <div class="">
  575. <p><span style="font-weight: bold">单选题</span> </p>
  576. </div>
  577. <ul class="class_right topic_list">
  578. <li><span>1</span></li>
  579. <li><span>1</span></li>
  580. <li class="active"><span >1</span></li>
  581. </ul>
  582. <div class="">
  583. <p><span style="font-weight: bold">单选题</span> </p>
  584. </div>
  585. <ul class="class_right topic_list">
  586. <li><span>1</span></li>
  587. <li><span>1</span></li>
  588. <li class="active"><span >1</span></li>
  589. </ul>
  590. </div>
  591. <div class="clear"></div>
  592. </div>
  593. </div>
  594. <p>
  595. <span class="red">注意:</span><br>
  596. 1.如果答题卡试题结构更改,或者答题卡类型变化,指定题目数据将自动清空,请谨慎操作!<br>
  597. 2.对于选做题,一组选做题请全部选择,或者全部不选。
  598. </p>
  599. <p class="class_btn" style="text-align: center;">
  600. <input type="hidden" name="examTopicGroupId" value="0">
  601. <input type="hidden" name="examTopicExamIds" value="">
  602. <button type="button" class="topic_setting_sumbit" style="margin-right: 10px;">确定</button>
  603. <button type="button" class="topic-push-close">取消</button>
  604. </p>
  605. </form>
  606. </div>
  607. </div>
  608. <!--题目设置弹窗end-->
  609. <!-- 未上传考生列表弹窗 -->
  610. <div class="confirmbox-mask" style="display: none;" id="fieldModalStudent">
  611. <div class="class-modal" style="padding: 0;height:580px;width:800px;">
  612. <div class="class-modal-head" style="background-color: #2977ff;color: white;height: 30px;font-size: 16px;font-weight: initial;"><span style="float: left;padding: 5px;">统计</span><span class="student-list-close" style="float: right;padding: 5px;cursor: pointer;">X</span></div>
  613. <form id="examSelect">
  614. <div class="" style="height:520px;padding:10px;">
  615. <p class="title">
  616. <input type="hidden" id="exam_group_id" name="exam_group_id" value="<?php echo $exam_group_data['exam_group_id']; ?>">
  617. <span style="float: left;" id="grade">
  618. </span>
  619. <span style="margin-left: 20px;">
  620. 班级
  621. <select class="form-control" id="classes" name="class" style="width: auto;display: inline-block">
  622. <option value="0">全部</option>
  623. </select>
  624. 类型
  625. <select class="form-control" id="studentType" name="studentType" style="width: auto;display: inline-block">
  626. <option value="-1">全部</option>
  627. <option value="0" selected>未上传考生</option>
  628. <option value="1">缺考</option>
  629. </select>
  630. </span>
  631. <span style="float: right;color: red;margin-right: 20px;">
  632. <button class="delClassStudent">删除未上传</button>
  633. <button class="delBatchStudent">批量删除未上传</button>
  634. <button class="downLoadBatchStudent">下载全部</button>
  635. </span>
  636. </p>
  637. <div class="class_area" id="class_area">
  638. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer student-list" style="font-size:12px">
  639. <thead>
  640. <tr>
  641. <th width="1%" nowrap="nowrap"> <input type="checkbox" name="select-all" class="selectAll" value="1" />全选</th>
  642. <th>序号</th>
  643. <th>姓名</th>
  644. <th>系统准考证号</th>
  645. <th>学校准考证号</th>
  646. <th>班级</th>
  647. <th>状态</th>
  648. <th>操作</th>
  649. </tr>
  650. </thead>
  651. <tbody>
  652. <tr><td colspan="8">暂无数据</td></tr>
  653. </tbody>
  654. </table>
  655. <div class="row">
  656. <div class="col-xs-6">
  657. <div class="dataTables_paginate paging_simple_numbers student_list_page">
  658. </div>
  659. </div>
  660. </div>
  661. </div>
  662. </div>
  663. </form>
  664. </div>
  665. </div>
  666. <!-- 转移成绩弹窗 -->
  667. <div class="confirmbox-mask" style="display: none;" id="transferWindow">
  668. <div class="class-modal" style="padding: 0;height:320px;width:410px;">
  669. <div class="class-modal-head" style="background-color: #2977ff;color: white;height: 30px;font-size: 16px;font-weight: initial;"><span style="float: left;padding: 5px;">转移学生成绩</span><span class="transfer-close" style="float: right;padding: 5px;cursor: pointer;">X</span></div>
  670. <form id="examSelect">
  671. <div style="clear: both">
  672. <span>说明:该功能适用于学生涂错考号需要调换成绩的情况,只能将已上传成绩的学生成绩转移给未上传的学生,且相关班级未完成阅卷</span>
  673. </div>
  674. <div>
  675. <table>
  676. <tr>
  677. <td>
  678. 请选择需要转移的学生<br>
  679. <select id="uploadedStudent" name="uploadedStudent" style="width:130px">
  680. </select>
  681. </td>
  682. <td><img src="/images/arrows.png"></td>
  683. <td>
  684. 转移给<br>
  685. <select id="noUploadedStudent" name="noUploadStudent" style="width:130px">
  686. </select>
  687. </td>
  688. </tr>
  689. </table>
  690. </div>
  691. <p class="class_btn" style="text-align: center;margin-top:50px;">
  692. <button type="button" class="transferSubmit" style="margin-right: 10px;">确定</button>
  693. <button type="button" class="transfer-cancel-btn">取消</button>
  694. </p>
  695. </form>
  696. </div>
  697. </div>
  698. <!-- 在线答题卡旧版提示弹窗 -->
  699. <div class="dialog-information-inquiry">
  700. <div class="title clearfix">
  701. <span class="title-text fl">提示</span>
  702. <span class="dialog-btn-close fr">X</span>
  703. </div>
  704. <div class="content-box clearfix">
  705. <p class="dialog-msg">在线答题卡版本已更新,不支持查看历史数据,如有问题,请联系技术支持</p>
  706. <div class="btn-box">
  707. <span class="btn-yes dialog-btn-close">知道了</span>
  708. </div>
  709. </div>
  710. </div>
  711. <!-- 删除未上传班级弹窗-->
  712. <div id="studentUploadClass" style="display: none;">
  713. <div class="content-box clearfix " style="padding:10px;">
  714. <div class="uploadedClass"><span style="font-weight: bold">已上传班级:</span>
  715. <span class="show_uploaded">
  716. </span>
  717. </div>
  718. <div class="noUploaded"><span style="font-weight: bold">未上传班级:</span>
  719. <span class="show_nouploaded">
  720. </span>
  721. </div>
  722. <p class="red">选择班级后,将对班级内未上传的学生进行删除</p>
  723. </div>
  724. </div>
  725. <!-- 全学科下载试卷答案解析 -->
  726. <div class="confirmbox-mask" style="display: none;" id="downloadPaper">
  727. <div class="class-modal" style="padding: 0;height:220px;width:500px;">
  728. <div class="class-modal-head" style="background-color: #2977ff;color: white;height: 30px;font-size: 16px;font-weight: initial;"><span style="float: left;padding: 5px;">下载试卷</span><span class="download-paper-close" style="float: right;padding: 5px;cursor: pointer;">X</span></div>
  729. <form id="downloadPaperForm">
  730. <div class="">
  731. <p class="title">
  732. </p>
  733. <p class="title" style="margin-top:20px;margin-bottom: 30px;">
  734. <span >
  735. 试卷纸张:
  736. <input type="radio" name="paperSheet" checked value="0">A4(竖版)
  737. <input type="radio" name="paperSheet" value="1">A3(分两栏)
  738. <input type="radio" name="paperSheet" value="2">A4(横版)
  739. </span>
  740. </p>
  741. <p class="title" style="margin-bottom: 30px;">
  742. <span >
  743. 使用类型:
  744. <input type="radio" name="downloadType" value="0">教师用卷
  745. <input type="radio" name="downloadType" checked value="1">学生用卷
  746. <input type="radio" name="downloadType" value="2">普通用卷
  747. </span>
  748. </p>
  749. <p class="title" style="margin-bottom: 30px;">
  750. <span >
  751. 打开方式:
  752. <input type="radio" name="wordType" value="1">Microsoft Word
  753. <input type="radio" name="wordType" checked value="0">金山Wps(公式无法编辑)
  754. </span>
  755. </p>
  756. </div>
  757. <p class="class_btn" style="text-align: center;">
  758. <input type="hidden" name="examGroupId" value="<?php echo $exam_group_data['exam_group_id']?>">
  759. <!--<button type="button" onclick="PaperPrintTools()" style="margin-right: 10px;">打印</button>-->
  760. <button type="button" class="downloadpaper_sumbit" style="margin-right: 10px;">下载</button>
  761. <button type="button" class="download-paper-btn">取消</button>
  762. </p>
  763. </form>
  764. </div>
  765. </div>
  766. <?php require_once '_print.php'?>
  767. <script src="/js/jquery.ajaxfileupload.js"></script>
  768. <script src="/js/jquery.cookie.js"></script>
  769. <script src="/js/print/ajax.js"></script>
  770. <script type="text/javascript">
  771. var quanxueke='<?php echo $qxk_paper_id?>';
  772. var isNewVersion=2;
  773. console.log(isNewVersion)
  774. $(document).ready(function(){
  775. var gradeArr=[];
  776. gradeArr[1]='高一';
  777. gradeArr[2]='高二';
  778. gradeArr[3]='高三';
  779. $('#addClass').click(function(){
  780. var eid=$(this).attr('eid');
  781. var grade=$(this).attr('grade');
  782. var enable=$(this).attr('enable');
  783. if(enable == 0){
  784. return false;
  785. }
  786. $('.area_1').html('');
  787. $('.area_2').html('');
  788. $('.area_3').html('');
  789. $('.checkAll').prop('checked',false);
  790. $('#grade').html(gradeArr[grade]);
  791. $('#grade_id').val(grade);
  792. $.ajax({
  793. url:'<?php echo $this->createUrl('print/loadclass')?>',
  794. type:'POST',
  795. dataType:'json',
  796. data:{'branch':0,'eid':eid,'grade':grade},
  797. success:function(res){
  798. if(res.status==1){
  799. class_data=res.classData;
  800. $('input[name=exam_gruop_id]').val(eid);
  801. if(class_data[1]!=undefined){
  802. area_1_html='';
  803. for(var i=0;i<class_data[1].length;i++){
  804. if(class_data[1][i]['is_used']==1){
  805. area_1_html+="<li style='color: gray;' class='ellipsis' title='"+class_data[1][i]['class_name']+"'><input onclick='syncCount()' name='a_check_class' type='checkbox' class='add_class_input choose_class' disabled='disabled' checked value='"+class_data[1][i]['class_id']+"'>"+handleLongName(class_data[1][i]['class_name'],6)+"</li>";
  806. }else{
  807. area_1_html+="<li class='ellipsis' title='"+class_data[1][i]['class_name']+"'><input name='a_check_class' onclick='syncCount()' type='checkbox' class='add_class_input choose_class' title='"+class_data[1][i]['class_name']+"' value='"+class_data[1][i]['class_id']+"'>"+handleLongName(class_data[1][i]['class_name'],6)+"</li>";
  808. }
  809. }
  810. $('.area_1').html(area_1_html);
  811. }
  812. if(class_data[2]!=undefined){
  813. area_2_html='';
  814. for(var i=0;i<class_data[2].length;i++){
  815. if(class_data[2][i]['is_used']==1){
  816. area_2_html+="<li style='color: gray;' class='ellipsis' title='"+class_data[2][i]['class_name']+"'><input onclick='syncCount()' name='b_check_class' type='checkbox' class='add_class_input choose_class' disabled='disabled' checked value='"+class_data[2][i]['class_id']+"'>"+handleLongName(class_data[2][i]['class_name'],6)+"</li>";
  817. }else{
  818. area_2_html+="<li class='ellipsis' title='"+class_data[2][i]['class_name']+"'><input onclick='syncCount()' name='b_check_class' type='checkbox' class='add_class_input choose_class' value='"+class_data[2][i]['class_id']+"'>"+handleLongName(class_data[2][i]['class_name'],6)+"</li>";
  819. }
  820. }
  821. $('.area_2').html(area_2_html);
  822. }
  823. if(class_data[3]!=undefined){
  824. area_3_html='';
  825. for(var i=0;i<class_data[3].length;i++){
  826. if(class_data[3][i]['is_used']==1){
  827. area_3_html+="<li style='color: gray;' class='ellipsis' title='"+class_data[3][i]['class_name']+"'><input onclick='syncCount()' name='c_check_class' type='checkbox' class='add_class_input choose_class' disabled='disabled' title='"+class_data[3][i]['class_name']+"' checked value='"+class_data[3][i]['class_id']+"'>"+handleLongName(class_data[3][i]['class_name'],6)+"</li>";
  828. }else{
  829. area_3_html+="<li class='ellipsis' title='"+class_data[3][i]['class_name']+"'><input onclick='syncCount()' name='c_check_class' type='checkbox' class='add_class_input choose_class' title='"+class_data[3][i]['class_name']+"' value='"+class_data[3][i]['class_id']+"'>"+handleLongName(class_data[3][i]['class_name'],6)+"</li>";
  830. }
  831. }
  832. $('.area_3').html(area_3_html);
  833. }
  834. syncCount();
  835. $('#fieldModal').show();
  836. }
  837. }
  838. });
  839. });
  840. $('#branch').change(function () {
  841. var branch=$(this).val();
  842. var eid=$('input[name=exam_gruop_id]').val();
  843. var grade=$('#grade_id').val();
  844. $('.area_1').html('');
  845. $('.area_2').html('');
  846. $('.area_3').html('');
  847. $('.checkAll').prop('checked',false);
  848. $.ajax({
  849. url:'<?php echo $this->createUrl('print/loadclass')?>',
  850. type:'POST',
  851. dataType:'json',
  852. data:{'branch':branch,'eid':eid,'grade':grade},
  853. success:function(res){
  854. if(res.status==1){
  855. class_data=res.classData;
  856. $('input[name=exam_gruop_id]').val(eid);
  857. if(class_data[1]!=undefined){
  858. area_1_html='';
  859. for(var i=0;i<class_data[1].length;i++){
  860. if(class_data[1][i]['is_used']==1){
  861. area_1_html+="<li style='color: gray;' class='ellipsis' title='"+class_data[1][i]['class_name']+"'><input onclick='syncCount()' name='a_check_class' type='checkbox' class='add_class_input choose_class' disabled='disabled' checked value='"+class_data[1][i]['class_id']+"'>"+handleLongName(class_data[1][i]['class_name'],6)+"</li>";
  862. }else{
  863. area_1_html+="<li class='ellipsis' title='"+class_data[1][i]['class_name']+"'><input name='a_check_class' onclick='syncCount()' type='checkbox' class='add_class_input choose_class' title='"+class_data[1][i]['class_name']+"' value='"+class_data[1][i]['class_id']+"'>"+handleLongName(class_data[1][i]['class_name'],6)+"</li>";
  864. }
  865. }
  866. $('.area_1').html(area_1_html);
  867. }
  868. if(class_data[2]!=undefined){
  869. area_2_html='';
  870. for(var i=0;i<class_data[2].length;i++){
  871. if(class_data[2][i]['is_used']==1){
  872. area_2_html+="<li style='color: gray;' class='ellipsis' title='"+class_data[2][i]['class_name']+"'><input onclick='syncCount()' name='b_check_class' type='checkbox' class='add_class_input choose_class' disabled='disabled' checked value='"+class_data[2][i]['class_id']+"'>"+handleLongName(class_data[2][i]['class_name'],6)+"</li>";
  873. }else{
  874. area_2_html+="<li class='ellipsis' title='"+class_data[2][i]['class_name']+"'><input onclick='syncCount()' name='b_check_class' type='checkbox' class='add_class_input choose_class' value='"+class_data[2][i]['class_id']+"'>"+handleLongName(class_data[2][i]['class_name'],6)+"</li>";
  875. }
  876. }
  877. $('.area_2').html(area_2_html);
  878. }
  879. if(class_data[3]!=undefined){
  880. area_3_html='';
  881. for(var i=0;i<class_data[3].length;i++){
  882. if(class_data[3][i]['is_used']==1){
  883. area_3_html+="<li style='color: gray;' class='ellipsis' title='"+class_data[3][i]['class_name']+"'><input onclick='syncCount()' name='c_check_class' type='checkbox' class='add_class_input choose_class' disabled='disabled' title='"+class_data[3][i]['class_name']+"' checked value='"+class_data[3][i]['class_id']+"'>"+handleLongName(class_data[3][i]['class_name'],6)+"</li>";
  884. }else{
  885. area_3_html+="<li class='ellipsis' title='"+class_data[3][i]['class_name']+"'><input onclick='syncCount()' name='c_check_class' type='checkbox' class='add_class_input choose_class' title='"+class_data[3][i]['class_name']+"' value='"+class_data[3][i]['class_id']+"'>"+handleLongName(class_data[3][i]['class_name'],6)+"</li>";
  886. }
  887. }
  888. $('.area_3').html(area_3_html);
  889. }
  890. syncCount();
  891. $('#fieldModal').show();
  892. }
  893. }
  894. });
  895. });
  896. $('.add-class-close,.cancel-btn').click(function () {
  897. $('#fieldModal').hide();
  898. });
  899. $('.download-paper-close,.download-paper-btn').click(function () {
  900. $('#downloadPaper').hide();
  901. });
  902. $('.downloadAllSubjectPaper').click(function(){
  903. $('#downloadPaper').show();
  904. });
  905. $('#global_check_all').change(function(){
  906. var hasChecked = $(this).prop('checked');
  907. var allChecks = $('#class_area').find('input[type="checkbox"]');
  908. allChecks.each(function (index,el) {
  909. if($(el).prop('disabled'))return;
  910. $(el).prop('checked',hasChecked);
  911. });
  912. syncCount();
  913. });
  914. //保存班级加减操作
  915. $('.setting_sumbit').click(function(){
  916. var class_id=[];
  917. // console.log($('.choose_class').length);
  918. for(var i=0;i<$('.choose_class').length;i++){
  919. var checkItem = $('.choose_class').eq(i);
  920. if(checkItem.is(':checked') && !checkItem.prop('disabled')){
  921. class_id.push($('.choose_class').eq(i).val());
  922. }
  923. }
  924. var eid=$('input[name=exam_gruop_id]').val();
  925. console.log(class_id);
  926. if(class_id.length==0){
  927. layer.msg('请选择考试班级');
  928. return false;
  929. }else{
  930. $(this).attr('disabled',true);
  931. layer.msg('操作中请稍候。。。。。。',{time:0})
  932. $.ajax({
  933. url:'<?php echo $this->createUrl('print/addexamclass')?>',
  934. type:'POST',
  935. dataType:'json',
  936. data:{'eid':eid,'classId':class_id,'is_third':0},
  937. success:function(res){
  938. layer.closeAll();
  939. if(res.status==1){
  940. layer.msg('修改成功');
  941. $('#fieldModal').hide();
  942. window.location.reload();
  943. }else{
  944. layer.msg(res.msg);
  945. }
  946. }
  947. });
  948. }
  949. });
  950. $(".sel-opt,.sel-cons").mouseover(function(){
  951. $(".sel-cons").show();
  952. }).mouseout(function(){
  953. $(".sel-cons").hide();
  954. });
  955. $(".sc-lis").click(function(){
  956. var data = {
  957. subjectId : $(this).attr('val')
  958. };
  959. $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>",data,function(flags){
  960. if(flags)
  961. {
  962. location.reload();
  963. }else
  964. {
  965. alert('网络异常');
  966. }
  967. });
  968. $('.has-sel').text($(this).text());
  969. $(".sel-cons").hide();
  970. });
  971. $(".ruanyun").click(function(){
  972. var exam_id = $(this).attr('exam_id');
  973. layer.msg("确定发送吗?学生是否全部上传成绩", {
  974. time: 0,
  975. btn: ['确定', '取消'],
  976. yes: function(index){
  977. layer.close(index);
  978. $.ajax({
  979. url: "<?php echo $this->createUrl('print/send_ruanyun_pdf');?>",
  980. type: "POST",
  981. dataType: "json",
  982. data:{ examId: exam_id
  983. },
  984. success: function (data){
  985. if(data.status == 1){
  986. layer.msg('发送成功',{
  987. icon: 1
  988. }, function(){
  989. layer.closeAll();
  990. location.reload();
  991. });
  992. }else if(data.status == 2){
  993. layer.msg('发送失败,未上传成绩',{
  994. icon: 5
  995. }, function(){
  996. layer.closeAll();
  997. location.reload();
  998. });
  999. }else{
  1000. layer.msg('发送失败',{
  1001. icon: 5
  1002. }, function(){
  1003. layer.closeAll();
  1004. location.reload();
  1005. });
  1006. }
  1007. },
  1008. error: function (data, status, e){ //服务器响应失败处理函数
  1009. layer.msg('返回失败!',{
  1010. icon: 5
  1011. }, function(){
  1012. layer.closeAll();
  1013. });
  1014. }
  1015. });
  1016. }
  1017. });
  1018. });
  1019. $(".print_pack").click(function(){
  1020. $(".loading-pop").show();
  1021. var data = {
  1022. exam_id:$(this).attr("w_exam_id")
  1023. };
  1024. $.post("<?php echo Yii::app()->createUrl('print/print_pack')?>",data,function(flags){
  1025. var m = JSON.parse(flags);
  1026. if(m.status==1)
  1027. {
  1028. html = ""+
  1029. '<div style="padding:20px 30px 0px 30px">'+
  1030. '<div style="padding:8px 0;">请复制下方链接打印包。</div>'+
  1031. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  1032. '<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>'+
  1033. '</div>'+
  1034. '</div>'+
  1035. "";
  1036. layer.open({
  1037. type: 1,
  1038. area: ['550px', '220px'],
  1039. title: '打印包',
  1040. content: html,
  1041. success: function(index, layerObj){
  1042. $(".loading-pop").hide();
  1043. 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>');
  1044. jQuery("#confirm, #cancel").on("click", function(){
  1045. layer.close(layerObj);
  1046. });
  1047. jQuery("#copy").on("click", function(){
  1048. jQuery("#url").select();
  1049. });
  1050. },
  1051. end: function(){
  1052. }
  1053. });
  1054. return;
  1055. }else
  1056. {
  1057. layer.msg(m.result);
  1058. $(".loading-pop").hide();return;
  1059. }
  1060. setTimeout(function() {
  1061. $(".loading-pop").hide();
  1062. }, 2000);
  1063. });
  1064. });
  1065. $("#delPaperStudentAll").click(function(){
  1066. // 判断是否有选中
  1067. var studentsIds;
  1068. layer.msg('确定删除全部未考试的学生吗?', {
  1069. time: 0,
  1070. btn: ['确定', '取消'],
  1071. yes: function(index){
  1072. layer.close(index);
  1073. var data={
  1074. "exam_group_id":"<?php echo $exam_group_id ?>",
  1075. };
  1076. jQuery.post(
  1077. "<?php echo $this->createUrl("print/delExamStudentAll?");?>",data,function(data){
  1078. var m =JSON.parse(data);
  1079. if(m.status==1)
  1080. {
  1081. var icon = 6;
  1082. layer.alert("删除成功", {icon: icon}, function(){
  1083. location.replace(location.href);
  1084. });
  1085. }else if(m.status==2){
  1086. var icon = 5;
  1087. layer.alert("无未上传成绩的学生", {icon: icon}, function(){
  1088. location.replace(location.href);
  1089. });
  1090. }else{
  1091. var icon = 5;
  1092. layer.alert("删除失败", {icon: icon}, function(){
  1093. location.replace(location.href);
  1094. });
  1095. }
  1096. });
  1097. }
  1098. });
  1099. });
  1100. //下载全学科试卷解析
  1101. $('.downloadpaper_sumbit').click(function(){
  1102. layer.msg('生成中,请稍候。。。。。。',{time:0});
  1103. $.ajax({
  1104. url:'<?php echo $this->createUrl('print/downloadPaper')?>',
  1105. type:'POST',
  1106. data:$('#downloadPaperForm').serialize(),
  1107. dataType:'json',
  1108. success:function(res){
  1109. if(res.status==1){
  1110. layer.closeAll();
  1111. window.location.href=res.data;
  1112. // html = ""+
  1113. // '<div style="padding:20px 30px 0px 30px">'+
  1114. // '<div style="padding:8px 0;">请复制下方链接打印包。</div>'+
  1115. // '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  1116. // '<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>'+
  1117. // '</div>'+
  1118. // '</div>'+
  1119. // "";
  1120. //
  1121. // layer.open({
  1122. // type: 1,
  1123. // area: ['550px', '220px'],
  1124. // title: '打印包',
  1125. // content: html,
  1126. // success: function(index, layerObj){
  1127. //
  1128. // $(".loading-pop").hide();
  1129. // jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+res.data+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  1130. //
  1131. // jQuery("#confirm, #cancel").on("click", function(){
  1132. // layer.close(layerObj);
  1133. // });
  1134. //
  1135. // jQuery("#copy").on("click", function(){
  1136. // jQuery("#url").select();
  1137. // });
  1138. // },
  1139. // end: function(){
  1140. //
  1141. // }
  1142. // });
  1143. }
  1144. }
  1145. });
  1146. });
  1147. $('.topicPush').click(function(){
  1148. var examId=$(this).attr('examId');
  1149. var examGroupId=$(this).attr('examGroupId');
  1150. //加载数据
  1151. layer.msg('正在加载数据,请稍候......',{time:0})
  1152. LoadExamPushTopic(examId,examGroupId);
  1153. });
  1154. //批量设置试题推送
  1155. $('.topicPushBatch').click(function(){
  1156. // 判断是否有选中
  1157. examGroupId=$(this).attr('exam_group_id')
  1158. examIds=[];
  1159. $(".myselect").each(function(m,n){
  1160. if ($(this).prop('checked')) {
  1161. examIds.push($(this).val());
  1162. }
  1163. });
  1164. if(examIds.length==0){
  1165. layer.msg('请至少选择一个班级');
  1166. return false;
  1167. }
  1168. console.log(examIds);
  1169. LoadExamPushTopic(examIds,examGroupId);
  1170. });
  1171. function LoadExamPushTopic(examId,examGroupId){
  1172. $.ajax({
  1173. url: '<?php echo $this->createUrl('print/loadExamPushTopic')?>',
  1174. type: 'POST',
  1175. dataType: 'json',
  1176. data: {'examIds': examId,'examGroupId':examGroupId},
  1177. success: function (res) {
  1178. layer.closeAll()
  1179. if(res.status==1){
  1180. apiData=res.data;
  1181. if(apiData['qxk_paper_id']>0){
  1182. html='';
  1183. html+=' <div class="">\n' +
  1184. ' <p><span style="font-weight: bold">试题结构</span> </p>\n' +
  1185. ' </div>';
  1186. html+='<ul class="topic_right topic_list">';
  1187. $.each(apiData['paper_topic'],function(i,v){
  1188. if($.inArray(v,apiData['topic_setting'])!=-1){
  1189. html+='<li class="topic active"><span topic_id="'+v+'">'+i+'</span></li>';
  1190. }else{
  1191. html+='<li class="topic"><span topic_id="'+v+'">'+i+'</span></li>';
  1192. }
  1193. })
  1194. html+='</ul>';
  1195. $('#fieldModalTopic').find('.paper_topic_show').html(html);
  1196. }else{
  1197. html='';
  1198. html+=' <div class="">\n' +
  1199. ' <p><span style="font-weight: bold">试题结构</span> </p>\n' +
  1200. ' </div>';
  1201. html+='<div class="">';
  1202. topicNo=['一','二','三','四','五','六','七','八','九','十'];
  1203. var no=0;
  1204. $.each(apiData['paper_topic'],function(i,v){
  1205. topicname=topicNo[no]+'、单选题';
  1206. if(i==2 || i==11){
  1207. topicname=topicNo[no]+'、多选题';
  1208. }else if(i==5){
  1209. topicname=topicNo[no]+'、填空题';
  1210. }else if(i==7){
  1211. topicname=topicNo[no]+'、解答题';
  1212. }else if(i==17){
  1213. topicname=topicNo[no]+'、选做题';
  1214. }
  1215. no++;
  1216. html+='<p><span style="font-weight: bold">'+topicname+'</span> </p>';
  1217. html+='</div>';
  1218. html+='<ul class="topic_right topic_list">';
  1219. $.each(v,function (ii,vv) {
  1220. if($.inArray(vv['topic_id'],apiData['topic_setting'])!=-1){
  1221. html+='<li class="topic active"><span topic_id="'+vv['topic_id']+'">'+vv['order']+'</span></li>';
  1222. }else{
  1223. html+='<li class="topic"><span topic_id="'+vv['topic_id']+'">'+vv['order']+'</span></li>';
  1224. }
  1225. })
  1226. html+='</ul>';
  1227. })
  1228. $('#fieldModalTopic').find('.paper_topic_show').html(html);
  1229. }
  1230. classHtml='';
  1231. $.each(apiData['classes'],function(i,v){
  1232. classHtml+='<li><span>'+v+'</span></li>';
  1233. })
  1234. $('#fieldModalTopic').find('.topic_class').html(classHtml);
  1235. $('#fieldModalTopic').show();
  1236. $('input[name=examTopicGroupId]').val(examGroupId);
  1237. $('input[name=examTopicExamIds]').val(examId);
  1238. $('.topic_setting_sumbit').attr('disabled',false);
  1239. }
  1240. }
  1241. });
  1242. }
  1243. $('.topic-push-close').click(function(){
  1244. $('#fieldModalTopic').hide();
  1245. });
  1246. $('#fieldModalTopic').on('click','.topic',function(){
  1247. if($(this).hasClass('active')){
  1248. $(this).removeClass('active')
  1249. }else{
  1250. $(this).addClass('active')
  1251. }
  1252. })
  1253. //保存推送试题设置
  1254. $('.topic_setting_sumbit').click(function(){
  1255. var examIds=$('input[name=examTopicExamIds]').val();
  1256. var examGroupId=$('input[name=examTopicGroupId]').val();
  1257. $(this).attr('disabled',true);
  1258. var topics=[];
  1259. topicEle=$('#fieldModalTopic').find('.topic');
  1260. topicEle.each(function(i,v){
  1261. // console.log(topicEle.eq(i).find('span').attr('topic_id'))
  1262. if($(v).hasClass('active')){
  1263. console.log($(v).find('span').attr('topic_id'))
  1264. topics.push($(v).find('span').attr('topic_id'))
  1265. }
  1266. })
  1267. // if(topics.length==0){
  1268. // layer.msg('未设置题目');
  1269. // $(this).attr('disabled',false);
  1270. // return false;
  1271. // }
  1272. layer.msg('正在保存,请稍候......',{time:0})
  1273. $.ajax({
  1274. url:'<?php echo $this->createUrl('print/saveExamPushTopicSetting')?>',
  1275. type:'POST',
  1276. dataType:'json',
  1277. data:{'examGroupId':examGroupId,'examIds':examIds,'topics':topics},
  1278. success:function(res){
  1279. if(res.status==1){
  1280. layer.msg('保存成功!',{
  1281. icon: 1
  1282. }, function(){
  1283. layer.closeAll();
  1284. window.location.reload()
  1285. });
  1286. }else{
  1287. msg='保存失败'
  1288. if(res.msg!=undefined){
  1289. msg=res.msg;
  1290. }
  1291. layer.msg(msg,{
  1292. icon: 1
  1293. }, function(){
  1294. layer.closeAll();
  1295. });
  1296. }
  1297. }
  1298. });
  1299. });
  1300. });
  1301. function objToJson(obj){
  1302. var json = "{ ";
  1303. for(var item in obj){
  1304. json += "'"+item+"':'"+obj[item]+"',";
  1305. }
  1306. json += " }";
  1307. return json;
  1308. }
  1309. function ccc(){
  1310. layer.msg('敬请期待!', {
  1311. time: 0,
  1312. btn: ['确定', '取消'],
  1313. yes: function(index){
  1314. layer.close(index);
  1315. return false;
  1316. }
  1317. });
  1318. }
  1319. function renewExamStat(exam_id) {
  1320. if(!exam_id)
  1321. {
  1322. layer.msg('参数不正确!')
  1323. }
  1324. var msg = '您确定恢复本次考试状态吗?';
  1325. layer.msg(msg, {
  1326. time: 0,
  1327. btn: ['确定', '取消'],
  1328. yes: function(index){
  1329. layer.close(index);
  1330. $.ajax({
  1331. url: "<?php echo $this->createUrl('paper/recover');?>",
  1332. type: "POST",
  1333. dataType: "json",
  1334. data: {
  1335. exam_id: exam_id,
  1336. },
  1337. success: function (data){
  1338. var m = data;
  1339. if(m.status == 1){
  1340. layer.msg('恢复成功,可以继续上传试卷',{
  1341. icon: 1
  1342. }, function(){
  1343. layer.closeAll();
  1344. location.reload();
  1345. });
  1346. }else{
  1347. layer.msg('恢复失败,'+m.msg,{
  1348. icon: 5
  1349. }, function(){
  1350. layer.closeAll();
  1351. location.reload();
  1352. });
  1353. }
  1354. },
  1355. error: function (data, status, e){ //服务器响应失败处理函数
  1356. layer.msg('返回失败!',{
  1357. icon: 5
  1358. }, function(){
  1359. layer.closeAll();
  1360. });
  1361. }
  1362. });
  1363. }
  1364. });
  1365. }
  1366. function renewExamStatClass(exam_id) {
  1367. if(!exam_id)
  1368. {
  1369. layer.msg('参数不正确!')
  1370. }
  1371. var msg = '您确定恢复本次考试状态吗?';
  1372. layer.msg(msg, {
  1373. time: 0,
  1374. btn: ['确定', '取消'],
  1375. yes: function(index){
  1376. layer.close(index);
  1377. $.ajax({
  1378. url: "<?php echo $this->createUrl('paper/recover_one_class');?>",
  1379. type: "POST",
  1380. dataType: "json",
  1381. data: {
  1382. exam_id: exam_id,
  1383. },
  1384. success: function (data){
  1385. var m = data;
  1386. if(m.status == 1){
  1387. layer.msg('恢复成功,可以继续上传试卷',{
  1388. icon: 1
  1389. }, function(){
  1390. layer.closeAll();
  1391. location.reload();
  1392. });
  1393. }else{
  1394. layer.msg('恢复失败,'+m.msg,{
  1395. icon: 5
  1396. }, function(){
  1397. layer.closeAll();
  1398. location.reload();
  1399. });
  1400. }
  1401. },
  1402. error: function (data, status, e){ //服务器响应失败处理函数
  1403. layer.msg('返回失败!',{
  1404. icon: 5
  1405. }, function(){
  1406. layer.closeAll();
  1407. });
  1408. }
  1409. });
  1410. }
  1411. });
  1412. }
  1413. function delExam(odj){
  1414. if (!odj) return false;
  1415. var classId = odj.getAttribute("w_class_id");
  1416. var examId = odj.getAttribute("w_exam_id");
  1417. var enable = odj.getAttribute("w_enable");
  1418. var totalCount = <?php echo $page_total;?>;
  1419. if(totalCount <=1){
  1420. return;
  1421. }
  1422. if(enable == 0){
  1423. return;
  1424. }
  1425. if (!classId || !examId) return false;
  1426. var msg = '您确定要删除此班的考试吗?';
  1427. layer.msg(msg, {
  1428. time: 0,
  1429. btn: ['确定', '取消'],
  1430. yes: function(index){
  1431. layer.close(index);
  1432. $.ajax({
  1433. url: "<?php echo $this->createUrl('print/delexam');?>",
  1434. type: "POST",
  1435. dataType: "json",
  1436. data: {
  1437. examId: examId,
  1438. classId:classId,
  1439. is_third:0
  1440. },
  1441. success: function (data){
  1442. if(data.status == 1){
  1443. layer.msg('删除成功',{
  1444. icon: 1
  1445. }, function(){
  1446. layer.closeAll();
  1447. location.reload();
  1448. });
  1449. }else{
  1450. layer.msg('删除失败',{
  1451. icon: 5
  1452. }, function(){
  1453. layer.closeAll();
  1454. location.reload();
  1455. });
  1456. }
  1457. },
  1458. error: function (data, status, e){ //服务器响应失败处理函数
  1459. layer.msg('返回失败!',{
  1460. icon: 5
  1461. }, function(){
  1462. layer.closeAll();
  1463. });
  1464. }
  1465. });
  1466. }
  1467. });
  1468. }
  1469. // 确认上传成绩
  1470. function uploadConfirm(classId, examId,className,is_uploaded_count,students_count) {
  1471. //if (confirm('您确定已上传成绩了吗?')) {
  1472. msg = "<div style='text-align:left;'>("+className+")已上传(<span style=' font-size:20px;color:#15ae68 ;font-weight: bold'>"+is_uploaded_count+"</span>)份试卷,还有(<span style='font-size:20px;color: red;font-weight: bold'>"+(students_count-is_uploaded_count)+"</span>)份试卷未上传!是否确认本班级试卷都已上传?<br/><br/><span style='color: red'>请注意!试卷上传确认后将不能再次上传本班的试卷!!!</span></div>";
  1473. layer.msg(msg, {
  1474. time: 0,
  1475. btn: ['确定', '取消'],
  1476. yes: function(index, layerObj){
  1477. layer.close(index);
  1478. $.ajax({
  1479. url: "<?php echo $this->createUrl('print/uploadConfirm');?>",
  1480. type: "POST",
  1481. data: {
  1482. classId: classId,
  1483. examId: examId
  1484. },
  1485. beforeSend:function(){
  1486. // 发送请求显示打印中
  1487. layer.msg('确认中...', {time: 20000});
  1488. },
  1489. dataType: "JSON",
  1490. success: function(data) {
  1491. if (data.status == 1) {
  1492. layer.msg('确认成功!');
  1493. setTimeout(function(){location.reload();}, 1300);
  1494. } else {
  1495. layer.msg(data.error);
  1496. }
  1497. },
  1498. complete:function(){
  1499. },
  1500. error:function(){
  1501. }
  1502. });
  1503. }
  1504. });
  1505. //}
  1506. }
  1507. // 打印错题本
  1508. function printBook(cid,eid,type){
  1509. if (!cid || !eid || !type) {
  1510. layer.msg("打印参数有误");return;
  1511. }
  1512. var message = '';
  1513. var objUrl = '';
  1514. if (type == 1) {
  1515. message = "您确定要下载该班级纠错本吗?";
  1516. objUrl = "<?php echo $this->createUrl('print/downloadwrongtopic');?>";
  1517. divTitle = "下载错题本";
  1518. improveName = "错题本";
  1519. } else if (type == 2){
  1520. message = "您确定要下载该班级个性化学习方案吗?";
  1521. objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
  1522. divTitle = "下载个性化学习方案";
  1523. improveName = "个性化学习方案";
  1524. }else if (type == 3){
  1525. message = "您确定要下载该班级个性化学习宝吗?";
  1526. objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
  1527. divTitle = "下载个性化学习宝";
  1528. improveName = "个性化学习宝";
  1529. }
  1530. else{
  1531. layer.msg("打印参数有误");return;
  1532. }
  1533. html = ""+
  1534. '<div style="padding:20px 30px 0px 30px">'+
  1535. '<div style="padding:8px 0;">请复制下方链接下载'+improveName+'。</div>'+
  1536. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  1537. '<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>'+
  1538. '</div>'+
  1539. '</div>'+
  1540. "";
  1541. layer.msg(message, {
  1542. time: 0,
  1543. btn: ['确定', '取消'],
  1544. yes: function(index){
  1545. layer.close(index);
  1546. msgIndex = layer.msg("下载中请稍后...", {"time": 3600000});
  1547. // 更试卷打印时间
  1548. $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: cid, eid: eid,type:type } );
  1549. /*if(type == 1)
  1550. location.href = objUrl+"/cid/"+cid+"/eid/"+eid;
  1551. else
  1552. location.href = objUrl+"/cid/"+cid+"/eid/"+eid+"/type/"+type;*/
  1553. startTime = (new Date()).getTime();
  1554. showTip = true;
  1555. tipShowed = false;
  1556. toPromptTime = 3000;
  1557. window.interval = setInterval(function(){
  1558. execTime = (new Date()).getTime() - startTime; if(execTime > toPromptTime && showTip && !tipShowed){
  1559. // msgIndex = layer.msg("该文件较大,请耐心等待...", {"time": 3600000});
  1560. // tipShowed = true;
  1561. }
  1562. }, 1000);
  1563. jQuery.get(
  1564. "<?php echo $this->createUrl("print/getImproveFile");?>",
  1565. {"examId": eid, "classId": cid, "type": type},
  1566. function(data){
  1567. data = JSON.parse(data);
  1568. if(data.success == 1||data.success == 2){
  1569. layer.open({
  1570. type: 1,
  1571. area: ['550px', '220px'],
  1572. title: divTitle,
  1573. content: html,
  1574. success: function(index, layerObj){
  1575. clearInterval(window.interval);
  1576. msgIndex = layer.msg(data.limitinfo, {"time": 3000});
  1577. clearInterval(window.interval);
  1578. layer.close(msgIndex);
  1579. jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+data.downloadPath+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  1580. jQuery("#confirm, #cancel").on("click", function(){
  1581. layer.close(layerObj);
  1582. });
  1583. jQuery("#copy").on("click", function(){
  1584. jQuery("#url").select();
  1585. });
  1586. },
  1587. end: function(){
  1588. }
  1589. });
  1590. }
  1591. else if(data.success == 0){
  1592. clearInterval(window.interval);
  1593. msgIndex = layer.msg(data.message, {"time": 3000});
  1594. }
  1595. }
  1596. );
  1597. }
  1598. });
  1599. }
  1600. // 上传试卷模板
  1601. function uploadTemplate(eid,name, type){
  1602. if (!eid) {
  1603. layer.msg('考试信息不存在!');
  1604. return false;
  1605. }
  1606. if(type == 1)
  1607. forCheckUrl = "<?php echo $this->createUrl('print/verifyTpl');?>";
  1608. else
  1609. forCheckUrl = "<?php echo $this->createUrl('print/checkanswercard');?>";
  1610. $.post(forCheckUrl,{eid:eid},function(data){
  1611. var obj = JSON.parse(data);
  1612. var html ='<div class="layer_notice" style="padding:5px;">';
  1613. html +='<table class="table table-striped table-bordered table-hover ">';
  1614. html +='<thead class="thin-border-bottom">';
  1615. html +='<tr>';
  1616. html +='<th>试卷名称</th>';
  1617. html +='<th>是否上传</th>';
  1618. html +='<th>操作</th>';
  1619. html +='</tr>';
  1620. html +='</thead>';
  1621. html +='<tbody class="content_tbody">';
  1622. if (obj.success == 1) {
  1623. html +='<td>'+name+'</td><td><span style="color:red;">已上传</span></td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
  1624. } else {
  1625. html +='<td>'+name+'</td><td id="alreadUpload">未上传</td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
  1626. }
  1627. html +='</tbody>';
  1628. html +='</table>';
  1629. html +='<span style="width:582px;display:inline-block;text-align:center;">';
  1630. html +='<button class="btn btn-success btn-sm" onclick="uploadWord('+type+')"><i class="ace-icon fa fa-check bigger-110"></i>确定</button>';
  1631. html +='</span>';
  1632. html +='<input type="hidden" id="mpEid" value="'+eid+'">';
  1633. html +='</div>';
  1634. layer.open({
  1635. type: 1,
  1636. skin: 'layui-layer-rim', //加上边框
  1637. area: ['600px', '300px'], //宽高
  1638. content: html
  1639. });
  1640. });
  1641. }
  1642. function uploadWord(type) {
  1643. var paramEid = $('#mpEid').val();
  1644. if (!paramEid) {
  1645. layer.msg('考试信息不存在!');
  1646. return false;
  1647. }
  1648. var obj_file = $("#word_file").val();
  1649. if (!obj_file) {
  1650. layer.msg('请选择上传文件');
  1651. return false;
  1652. }
  1653. var extStart = obj_file.lastIndexOf('.');
  1654. var extName = obj_file.substring(extStart,obj_file.length).toLowerCase();
  1655. if (extName != ".dotx" && extName != ".dotm") {
  1656. layer.msg('模板格式有误,请上传dotx格式word!');
  1657. return false;
  1658. }
  1659. $.ajaxFileUpload({
  1660. url: "<?php echo $this->createUrl('print/uploadTpl');?>", //用于文件上传的服务器端请求地址
  1661. secureuri: false, //是否需要安全协议,一般设置为false
  1662. fileElementId: 'word_file', //文件上传域的ID
  1663. dataType: 'text', //返回值类型 一般设置为json
  1664. data:{"eid":paramEid, "type": type},
  1665. success: function (data, status){
  1666. var obj = JSON.parse(data);
  1667. if (obj.success == 1) {
  1668. layer.msg(obj.message,{
  1669. icon: 1,
  1670. }, function(){
  1671. layer.closeAll();
  1672. });
  1673. $("#alreadUpload").html('<span style="color:red;">已上传</span>');
  1674. location.reload();
  1675. } else {
  1676. layer.msg(obj.message,{
  1677. icon: 5,
  1678. }, function(){
  1679. layer.closeAll();
  1680. });
  1681. }
  1682. },
  1683. error: function (data, status, e){ //服务器响应失败处理函数
  1684. layer.msg('返回失败!',{
  1685. icon: 5,
  1686. }, function(){
  1687. layer.closeAll();
  1688. });
  1689. }
  1690. });
  1691. return false;
  1692. }
  1693. // 搜索事件
  1694. $("#search").click(function(){
  1695. $("#form1").submit();
  1696. });
  1697. function print(cid,eid,tid,fg){
  1698. if (!cid || !eid) return false;
  1699. var msg = '';
  1700. if (fg == 1) {
  1701. msg = '打印答题卡';
  1702. } else {
  1703. msg = '您确定要打印该试卷嘛?';
  1704. }
  1705. layer.msg(msg, {
  1706. time: 0,
  1707. btn: ['确定', '取消'],
  1708. yes: function(index){
  1709. layer.close(index);
  1710. ajaxPrint(cid, eid, tid);
  1711. }
  1712. });
  1713. }
  1714. function ajaxPrint(cid, eid, tid) {
  1715. $.ajax({
  1716. url:"<?php echo $this->createUrl('print/ajaxupdate');?>",
  1717. type:"post",
  1718. data:{cid:cid,eid:eid,tid:tid},
  1719. dataType: "json",
  1720. beforeSend:function(){
  1721. // 发送请求显示打印中
  1722. layer.msg('打印中', {icon: 16,time: 20000});
  1723. },
  1724. success:function(obj){
  1725. var index = layer.msg();
  1726. layer.close(index);
  1727. if (obj.success == 1) {
  1728. if (tid == 0) {//console.log(JSON.stringify(obj.message));
  1729. evaluationClient.newprintPaper(JSON.stringify(obj.message));
  1730. //alert('提交打印试卷成功!');
  1731. } else if (tid == 1) {
  1732. evaluationClient.printCTB(JSON.stringify(obj.message));
  1733. //alert('提交打印错题本成功!');
  1734. } else if (tid == 2) {
  1735. evaluationClient.printTFFA(JSON.stringify(obj.message));
  1736. //alert('提交打印提分册成功!');
  1737. } else {
  1738. layer.msg('操作错误!');
  1739. }
  1740. location.reload();
  1741. } else {//alert(obj.message);
  1742. layer.msg(obj.message);
  1743. }
  1744. },
  1745. complete:function(){
  1746. //layer.msg('打印失败!');
  1747. //var index = layer.msg();
  1748. //layer.close(index);
  1749. },
  1750. error:function(){
  1751. //var index = layer.msg();
  1752. //layer.close(index);
  1753. }
  1754. });
  1755. }
  1756. function notice(){
  1757. console.log('222');
  1758. msg = "<div style='text-align:left;'>知心提醒:<br/>  目前【在线答题卡v1.0】处于公测阶段,请亲爱的学管们视情况使用!<br/>  如遇扫描异常,可切换至第三方考试,去制作模板并扫描!<br/>  注:含 四选二 的选做题考试,暂不支持转第三方,因此该类考试需要谨慎使用【在线答题卡】!</div>";
  1759. layer.msg(msg, {
  1760. time: 0,
  1761. btn: ['知道了'],
  1762. yes: function(index){
  1763. layer.close(index);
  1764. }
  1765. });
  1766. }
  1767. // 生成试卷模板
  1768. function createTemplate (eid,flag){
  1769. if (!eid) {
  1770. layer.msg('未找到考试信息');
  1771. }
  1772. var msg = '';
  1773. if (flag == 2) {
  1774. msg = '您确定要下载试卷嘛?';
  1775. } else if(flag == 1){
  1776. msg = '您确定要生成模板嘛?';
  1777. }
  1778. if (flag == 12) {
  1779. msg = '您确定要下载答题卡嘛?';
  1780. } else if(flag == 11){
  1781. msg = '您确定要下载试卷嘛?';
  1782. }
  1783. else if(flag == 3){
  1784. msg = "<div style='text-align:left;'>编辑答题卡注意事项:<br/>1、试卷的名字最多支持2行,字体的大小和字体种类保持原有格式不变<br/>2、选择题和填空题的答题区域中里面的内容和识别点不许更改<br/>3、整套试卷中所有的识别点不许更改<br/><br/>点击确定下载</div>";
  1785. }else if(flag == 4){
  1786. msg = "<div style='text-align:left;'>编辑题卡合一注意事项:<br/>1、试卷的名字最多支持2行,字体的大小和字体种类保持原有格式不变<br/>2、选择题和填空题的答题区域中里面的内容和识别点不许更改<br/>3、整套试卷中所有的识别点不许更改<br/><br/>点击确定下载</div>";
  1787. }else{
  1788. layer.msg("参数错误");
  1789. }
  1790. layer.msg(msg, {
  1791. time: 0,
  1792. btn: ['确定', '取消'],
  1793. yes: function(index){
  1794. layer.close(index);
  1795. $.post('<?php echo $this->createUrl('print/createtempelate');?>',{"eid":eid,"flag":flag},function(data){
  1796. var obj = JSON.parse(data);
  1797. if (obj.success == 1) {
  1798. if (flag == 2) {
  1799. evaluationClient.newCreatePaperTiGan(JSON.stringify(obj.object));
  1800. } else if(flag == 1){
  1801. evaluationClient.newcreatePaper(JSON.stringify(obj.object));
  1802. }
  1803. else if(flag == 3){
  1804. evaluationClient.newCreatePaperDaTiKa(JSON.stringify(obj.object));
  1805. }else if(flag == 4){
  1806. evaluationClient.newCreatePaperDaTiKa(JSON.stringify(obj.object));
  1807. }else if(flag == 11){
  1808. evaluationClient.CreateSubjectPaperTiGan(JSON.stringify(obj.object));
  1809. }else if(flag == 12){
  1810. evaluationClient.CreateSubjectWordTiKa(JSON.stringify(obj.object));
  1811. }else{
  1812. layer.msg("参数错误");
  1813. }
  1814. } else {
  1815. layer.msg(obj.message);
  1816. }
  1817. });
  1818. }
  1819. });
  1820. }
  1821. function wb_html(odj){
  1822. if (!odj) return false;
  1823. var classId = odj.getAttribute("w_class_id");
  1824. var examId = odj.getAttribute("w_exam_id");
  1825. if (!classId || !examId) return false;
  1826. var msg = '您确定要生成该班级的错题本吗?';
  1827. layer.msg(msg, {
  1828. time: 0,
  1829. btn: ['确定', '取消'],
  1830. yes: function(index){
  1831. layer.close(index);
  1832. $.ajax({
  1833. url: "<?php echo $this->createUrl('client/wbhtml');?>",
  1834. type: "POST",
  1835. dataType: "json",
  1836. data: {
  1837. examId: examId,
  1838. classId:classId
  1839. },
  1840. success: function (data){
  1841. if(data > 0){
  1842. layer.msg('操作成功,重新生成错题本',{
  1843. icon: 1
  1844. }, function(){
  1845. layer.closeAll();
  1846. });
  1847. }else if(data==0){
  1848. layer.msg('操作失败,此班无错题本',{
  1849. icon: 5
  1850. }, function(){
  1851. layer.closeAll();
  1852. });
  1853. }
  1854. else{
  1855. layer.msg('操作失败,重新生成错题本',{
  1856. icon: 5
  1857. }, function(){
  1858. layer.closeAll();
  1859. });
  1860. }
  1861. },
  1862. error: function (data, status, e){ //服务器响应失败处理函数
  1863. layer.msg('返回失败!',{
  1864. icon: 5
  1865. }, function(){
  1866. layer.closeAll();
  1867. });
  1868. }
  1869. });
  1870. }
  1871. });
  1872. }
  1873. function isp2_html(odj){
  1874. if (!odj) return false;
  1875. var classId = odj.getAttribute("w_class_id");
  1876. var examId = odj.getAttribute("w_exam_id");
  1877. if (!classId || !examId) return false;
  1878. var msg = '您确定要生成该班级的二步提分方案吗?';
  1879. layer.msg(msg, {
  1880. time: 0,
  1881. btn: ['确定', '取消'],
  1882. yes: function(index){
  1883. layer.close(index);
  1884. $.ajax({
  1885. url: "<?php echo $this->createUrl('client/isp2html');?>",
  1886. type: "POST",
  1887. dataType: "json",
  1888. data: {
  1889. examId: examId,
  1890. classId:classId
  1891. },
  1892. success: function (data){
  1893. if(data > 0){
  1894. layer.msg('操作成功,重新生成提分方案',{
  1895. icon: 1
  1896. }, function(){
  1897. layer.closeAll();
  1898. });
  1899. }else if(data==0){
  1900. layer.msg('操作失败,此班无提分方案',{
  1901. icon: 5
  1902. }, function(){
  1903. layer.closeAll();
  1904. });
  1905. }
  1906. else{
  1907. layer.msg('操作失败,重新生成提分方案',{
  1908. icon: 5
  1909. }, function(){
  1910. layer.closeAll();
  1911. });
  1912. }
  1913. },
  1914. error: function (data, status, e){ //服务器响应失败处理函数
  1915. layer.msg('返回失败!',{
  1916. icon: 5
  1917. }, function(){
  1918. layer.closeAll();
  1919. });
  1920. }
  1921. });
  1922. }
  1923. });
  1924. }
  1925. function isp3_html(odj){
  1926. if (!odj) return false;
  1927. var classId = odj.getAttribute("w_class_id");
  1928. var examId = odj.getAttribute("w_exam_id");
  1929. if (!classId || !examId) return false;
  1930. var msg = '您确定要生成该班级的个性化学习宝吗?';
  1931. layer.msg(msg, {
  1932. time: 0,
  1933. btn: ['确定', '取消'],
  1934. yes: function(index){
  1935. layer.close(index);
  1936. $.ajax({
  1937. url: "<?php echo $this->createUrl('client/isp3html');?>",
  1938. type: "POST",
  1939. dataType: "json",
  1940. data: {
  1941. examId: examId,
  1942. classId:classId
  1943. },
  1944. success: function (data){
  1945. if(data > 0){
  1946. layer.msg('操作成功,重新生成提分方案',{
  1947. icon: 1
  1948. }, function(){
  1949. layer.closeAll();
  1950. });
  1951. }else if(data==0){
  1952. layer.msg('操作失败,此班无提分方案',{
  1953. icon: 5
  1954. }, function(){
  1955. layer.closeAll();
  1956. });
  1957. }
  1958. else{
  1959. layer.msg('操作失败,重新生成提分方案',{
  1960. icon: 5
  1961. }, function(){
  1962. layer.closeAll();
  1963. });
  1964. }
  1965. },
  1966. error: function (data, status, e){ //服务器响应失败处理函数
  1967. layer.msg('返回失败!',{
  1968. icon: 5
  1969. }, function(){
  1970. layer.closeAll();
  1971. });
  1972. }
  1973. });
  1974. }
  1975. });
  1976. }
  1977. // 隐藏试卷
  1978. function oprateExam(examId,flag){
  1979. if (examId) {
  1980. layer.msg('未找到周周练id');
  1981. }
  1982. var msg = '您确定要隐藏该试卷吗?';
  1983. if (flag == 0) {
  1984. msg = '您确定要恢复该试卷吗?';
  1985. }
  1986. layer.msg(msg, {
  1987. time: 0,
  1988. btn: ['确定', '取消'],
  1989. yes: function(index){
  1990. layer.close(index);
  1991. $.post('<?php echo $this->createUrl("print/oprateexam");?>',{examId:examId,flag:flag},function(data){
  1992. var obj = JSON.parse(data);
  1993. if (obj.success == 1) {
  1994. location.reload();
  1995. } else {
  1996. layer.msg(obj.message);
  1997. }
  1998. });
  1999. }
  2000. });
  2001. }
  2002. // 统计数量
  2003. function syncCount()
  2004. {
  2005. var a = $("input[name='a_check_class']:checked").length;
  2006. var b = $("input[name='b_check_class']:checked").length;
  2007. var c = $("input[name='c_check_class']:checked").length;
  2008. $('#aCheckCount').html(a);
  2009. $('#bCheckCount').html(b);
  2010. $('#cCheckCount').html(c);
  2011. $('#allCheckCount').html((a+b+c));
  2012. }
  2013. function handleLongName(str,length) {
  2014. var str_len = str.length;
  2015. if(str_len > length){
  2016. return str.substring(0,length-1) + '...';
  2017. }else {
  2018. return str;
  2019. }
  2020. }
  2021. $('.sendExamStomp').click(function(){
  2022. examGroupId=$(this).attr('examGroupId');
  2023. examId=$(this).attr('examId');
  2024. if(examGroupId=='' || examId==''){
  2025. return false;
  2026. }
  2027. if ($(this).hasClass('disabled') == false) {
  2028. $(this).addClass('disabled');
  2029. $.ajax({
  2030. url: '<?php echo $this->createUrl('print/sendExamStomp')?>',
  2031. type: 'POST',
  2032. dataType: 'json',
  2033. data: {examGroupId: examGroupId, examId: examId},
  2034. success: function (res) {
  2035. if (res.status == 1) {
  2036. layer.msg('操作成功');
  2037. } else {
  2038. layer.msg('操作失败');
  2039. }
  2040. }
  2041. })
  2042. }
  2043. });
  2044. $('.sendExamStompHomework').click(function(){
  2045. examGroupId=$(this).attr('examGroupId');
  2046. examId=$(this).attr('examId');
  2047. if(examGroupId=='' || examId==''){
  2048. return false;
  2049. }
  2050. if ($(this).hasClass('disabled') == false) {
  2051. $(this).addClass('disabled');
  2052. $.ajax({
  2053. url: '<?php echo $this->createUrl('print/sendExamStompHomework')?>',
  2054. type: 'POST',
  2055. dataType: 'json',
  2056. data: {examGroupId: examGroupId, examId: examId},
  2057. success: function (res) {
  2058. if (res.status == 1) {
  2059. layer.msg('操作成功');
  2060. } else {
  2061. layer.msg('操作失败');
  2062. }
  2063. }
  2064. })
  2065. }
  2066. });
  2067. $('.sendExamProduct').click(function(){
  2068. examGroupId=$(this).attr('examGroupId');
  2069. examId=$(this).attr('examId');
  2070. if(examGroupId=='' || examId==''){
  2071. return false;
  2072. }
  2073. if ($(this).hasClass('disabled') == false) {
  2074. $(this).addClass('disabled');
  2075. $.ajax({
  2076. url: '<?php echo $this->createUrl('print/sendProductHtml')?>',
  2077. type: 'POST',
  2078. dataType: 'json',
  2079. data: {examGroupId: examGroupId, examId: examId},
  2080. success: function (res) {
  2081. if (res.status == 1) {
  2082. layer.msg('操作成功');
  2083. } else {
  2084. layer.msg('操作失败');
  2085. }
  2086. }
  2087. })
  2088. }
  2089. });
  2090. function createCardOnline(examGroupId,noOnline){
  2091. let url = 'http://xbcard.testing.xiaoben.com'
  2092. if(window.location.href.includes('dev.xueping.com')){
  2093. url = 'http://card.dev.xueping.com'
  2094. }else if(window.location.href.includes('schcur.com')){
  2095. url = 'http://xbcard.schcur.com'
  2096. }
  2097. new_answer_sheet_subject='<?php echo $new_answer_sheet_subject;?>'
  2098. $.ajax({
  2099. url:'<?php echo $this->createUrl('print/GetOnlineToken')?>',
  2100. type:'POST',
  2101. dataType:'json',
  2102. success:function(res){
  2103. if(res.status==1 && res.data!=undefined){
  2104. let token=res.data;
  2105. $.cookie('cardToken',null,{ path: '/',domain: url.substring(url.indexOf('card.')+4)});
  2106. $.cookie("cardToken", token, { path: '/', expires: 1 ,domain: url.substring(url.indexOf('card.')+4)});
  2107. if(quanxueke!=undefined && quanxueke>0){
  2108. if(new_answer_sheet_subject=='1'){
  2109. window.location.href=`${url}/subjects13.html?examGroupId=${examGroupId}&cardType=1`;
  2110. }else{
  2111. window.location.href=`${url}/mixSubjects.html?examGroupId=${examGroupId}&cardType=1`;
  2112. }
  2113. }else{
  2114. window.location.href=`${url}?examGroupId=${examGroupId}&cardType=1`;
  2115. }
  2116. }else{
  2117. if(res.msg!=undefined){
  2118. layer.msg(res.msg)
  2119. }else{
  2120. layer.msg('token读取失败');
  2121. }
  2122. }
  2123. }
  2124. });
  2125. // document.cookie=`token=${token}; path=/ ;domain=.testing.xueping.com`
  2126. }
  2127. var exam_group_id_card= '<?php echo $exam_group_id; ?>';
  2128. var isNewCard = 0;
  2129. var isGetCardType = false;
  2130. $.post('/index.php/print/getPaperWithTopicsDetails',
  2131. { examGroupId:exam_group_id_card },
  2132. function (res) {
  2133. res = JSON.parse(res)
  2134. if (res.success) {
  2135. isGetCardType = true
  2136. if(res.position){
  2137. if(JSON.parse(res.position).bigTopicArr){
  2138. isNewCard = 1
  2139. }
  2140. }
  2141. }
  2142. }
  2143. )
  2144. function createCardOnlineThree(examGroupId,noOnline){
  2145. //是否是新版在线答题卡
  2146. if(isGetCardType){
  2147. if(isNewCard!=0){
  2148. layer.open({
  2149. title: false,
  2150. closeBtn: 0,
  2151. type: 1,
  2152. area: ['400px', '170px'],
  2153. offset: '100px',
  2154. content: $(".dialog-information-inquiry")
  2155. });
  2156. }else{
  2157. createCardOnline(examGroupId,noOnline)
  2158. }
  2159. } else {
  2160. setTimeout(()=>{
  2161. if(isNewCard!=0){
  2162. layer.open({
  2163. title: false,
  2164. closeBtn: 0,
  2165. type: 1,
  2166. area: ['400px', '170px'],
  2167. offset: '100px',
  2168. content: $(".dialog-information-inquiry")
  2169. });
  2170. }else{
  2171. createCardOnline(examGroupId,noOnline)
  2172. }
  2173. },1000)
  2174. }
  2175. }
  2176. //关闭弹窗
  2177. $(".dialog-btn-close").on("click", function() {
  2178. layer.close(layer.index);
  2179. });
  2180. $(".downloadOnlinePdf").click(function(){
  2181. debugger
  2182. var exam_id=$(this).attr('exam_id');
  2183. var class_id=$(this).attr('class_id');
  2184. var data={'exam_id':exam_id};
  2185. $.post("<?php echo Yii::app()->createUrl('print/printPdfOnline')?>",data,function(flags){
  2186. var m = JSON.parse(flags);
  2187. if(m.success==1)
  2188. {
  2189. // 更试卷打印时间
  2190. $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: class_id, eid: exam_id,type:0 } );
  2191. if(isNewVersion==1){
  2192. $param='{"exam_id":"'+exam_id+'","student_id":""}';
  2193. evaluationClient.NewPrintPDF($param);
  2194. }else if(isNewVersion==2){
  2195. let $param={"typeId":14,"params":{"examIds":[exam_id],"classIds":[class_id],"studentIds":[]}}
  2196. evaluationClient.BulkPrintPDF(JSON.stringify($param))
  2197. }else{
  2198. evaluationClient.PrintPDF(flags);
  2199. }
  2200. }else
  2201. {
  2202. if(m.msg!=undefined){
  2203. layer.msg(m.msg);
  2204. }else{
  2205. layer.msg('打印失败');
  2206. }
  2207. }
  2208. });
  2209. });
  2210. //还原考试申请
  2211. $('#restore').click(function(){
  2212. var examName=$(this).attr('exam_name'),
  2213. examId=$(this).attr('exam_group_id'),
  2214. examDate=$(this).attr('exam_date');
  2215. msg="<b>你确定要初始化该场考试?</b><br>考试名称:"+examName+" <br>考试日期:"+examDate+"<br>"+
  2216. "<sapn style='color:red'>还原考试后,考试数据将被还原到刚创建的时候,请谨慎操作!</sapn>";
  2217. layer.msg(msg, {
  2218. time: 0,
  2219. icon:0,
  2220. btn: ['确定', '取消'],
  2221. yes: function(index){
  2222. layer.close(index);
  2223. layer.msg('正在发送申请,请稍候。。。。。',{time:0});
  2224. $.post('<?php echo $this->createUrl("print/restoreApply");?>',{examId:examId},function(data){
  2225. var obj = JSON.parse(data);
  2226. layer.closeAll();
  2227. if (obj.status == 1) {
  2228. layer.msg('操作成功!',{
  2229. icon: 1
  2230. }, function(){
  2231. layer.closeAll();
  2232. window.location.reload()
  2233. });
  2234. } else {
  2235. layer.msg(obj.msg);
  2236. }
  2237. });
  2238. }
  2239. });
  2240. });
  2241. </script>