exam_list.php 91 KB

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