index1.php 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320
  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. testFlag = "<?php echo $this->testFlag;?>";
  11. customTplsIds = new Array();
  12. var i = 0;
  13. <?php foreach(Yii::app()->params["custom_tpls_ids"] as $tplId){?>
  14. customTplsIds[i] = "<?php echo $tplId;?>";
  15. i++;
  16. <?php }?>
  17. jQuery(document).ready(function(){
  18. // 打印答案解析
  19. $(".answerAnalysis").click(function(){
  20. var element = this;
  21. layer.msg('您确定下载答案解析嘛?', {
  22. time: 0,
  23. btn: ['确定', '取消'],
  24. yes: function(index){
  25. layer.close(index);
  26. var wpCode = jQuery(element).attr("examId");
  27. if (!wpCode) {
  28. layer.msg('周周练id有误!');return false;
  29. }
  30. jQuery.post(
  31. '<?php echo $this->createUrl('print/createtempelate');?>',
  32. {"eid":wpCode},
  33. function(data){
  34. var obj = JSON.parse(data);
  35. if (obj.success == 1) {
  36. /*alert(obj.message);
  37. alert(obj);*/
  38. evaluationClient.printDAJX(JSON.stringify(obj.object));
  39. } else {
  40. layer.msg(obj.message);
  41. }
  42. }
  43. );
  44. }
  45. });
  46. });
  47. jQuery(".needToSendLabelTask").click(function(){
  48. layer.msg("请先发送标注任务");
  49. });
  50. jQuery(".sendLabelTask").click(function(){
  51. var examId = jQuery(this).attr("examId");
  52. var examName = jQuery(this).attr("examName");
  53. var subjectId = jQuery(this).attr("subjectId");
  54. var createTime = jQuery(this).attr("createTime");
  55. layer.msg('您确定发送试题标注任务吗?', {
  56. time: 0,
  57. btn: ['确定', '取消'],
  58. yes: function(index){
  59. layer.close(index);
  60. jQuery.post(
  61. "<?php echo $this->createUrl("print/sendlabeltask");?>",
  62. {"examId": examId, "examName": examName, "createTime": createTime},
  63. function(data){
  64. data = JSON.parse(data);
  65. if(data.success == 1){
  66. layer.msg(data.message);
  67. setTimeout(function(){location.reload();}, 1300);
  68. }
  69. else{
  70. layer.msg(data.message);
  71. }
  72. }
  73. );
  74. }
  75. });
  76. });
  77. jQuery(".enterStudentsList1").click(function(){
  78. layer.msg("请先发送标注任务");
  79. });
  80. jQuery(".paperType").click(function(){
  81. if(testFlag != 1)
  82. return false;
  83. var examId = jQuery(this).attr("examId");
  84. var tpl_index = jQuery(this).attr("tpl_index");
  85. if(in_array(jQuery(this).attr("tpl_index"), customTplsIds)){
  86. if(in_array(jQuery(this).attr("tpl_index"), [10,1011,11])){
  87. var style = "width:200px;color:gray;";
  88. var state = "disabled";
  89. }else{
  90. var style = "width:200px;";
  91. var state = "enabled";
  92. }
  93. }
  94. else{
  95. var style = "width:200px;color:gray;";
  96. var state = "disabled";
  97. }
  98. html = ""+
  99. '<div style="padding:10px 30px">'+
  100. '<div style="margin:5px 0; float: left">选择纸张:</div>'+
  101. '<div style="float: left"><select id="paperSize" style="'+style+'" '+state+' >'+
  102. '<option value="A3" ';
  103. if(jQuery(this).attr("paper_size")=='A3'){ html=html+'selected';}
  104. html=html+'>A3</option>'+
  105. '<option value="A4" ';
  106. if(jQuery(this).attr("paper_size")=='A4'){ html=html+'selected';}
  107. html=html+'>A4</option>'+
  108. '<option value="8K" ';
  109. if(jQuery(this).attr("paper_size")=='8K'){ html=html+'selected';}
  110. html=html+'>8K</option>'+
  111. '<option value="16K" ';
  112. if(jQuery(this).attr("paper_size")=='16K'){ html=html+'selected';}
  113. html=html+'>16K</option>'+
  114. '</select></div>'+
  115. '<div style="padding-top:10px;clear: left"></div>'+
  116. '<div style="margin:5px 0; float: left">阅卷方式:</div>'+
  117. '<div style="float: left"><select id="mark_type" style="width:200px">'+
  118. '<option value="0" ';
  119. if(jQuery(this).attr("mark_type")=='0'){ html=html+'selected';}
  120. html=html+'>线下阅卷</option>'+
  121. '<option value="1" ';
  122. if(jQuery(this).attr("mark_type")=='1'){ html=html+'selected';}
  123. html=html+'>在线阅卷(题)</option> <option value="3" ';
  124. if(jQuery(this).attr("mark_type")=='3'){ html=html+'selected';}
  125. html=html+'>班级混合阅卷</option> <option value="4" ';
  126. if(jQuery(this).attr("mark_type")=='4'){ html=html+'selected';}
  127. html=html+'>班级单独阅卷</option> '+
  128. '</select></div>'+
  129. '<div class="row" style="margin:30px auto;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>'+
  130. '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>'+
  131. '</div>'+
  132. '</div>'+
  133. "";
  134. layer.open({
  135. type: 1,
  136. area: ['350px', '220px'],
  137. title: "更改试卷",
  138. content: html,
  139. success: function(index, layerObj){
  140. jQuery("#cancel").on("click", function(){
  141. layer.closeAll();
  142. });
  143. jQuery("#confirm").on("click", function(){
  144. var paperSize = jQuery("#paperSize").val();
  145. var mark_type = jQuery("#mark_type").val();
  146. jQuery.post(
  147. "<?php echo $this->createUrl("print/setpapersize");?>",
  148. {"examId": examId, "paperSize": paperSize,"mark_type":mark_type,"tpl_index":tpl_index},
  149. function(data){
  150. data = JSON.parse(data);
  151. layer.msg(data.message);
  152. if(data.success == 1){
  153. setTimeout(function(){location.reload();}, 1300);
  154. }
  155. }
  156. );
  157. layer.closeAll();
  158. });
  159. },
  160. end: function(){
  161. }
  162. });
  163. });
  164. // 根据年级筛选班级
  165. jQuery("#grade").change(function(){
  166. var grade = $(this).val();
  167. if (!grade) return false;
  168. jQuery.post(
  169. '<?php echo $this->createUrl("print/getGradeClass");?>',{"grade": grade},function(data){
  170. data = JSON.parse(data);
  171. if(data.success == 1){
  172. var classObj = $("#class");
  173. var html = "<option value=''>全部班级</option>";
  174. classObj.empty();
  175. $.each(data.message,function(i,n){
  176. html += "<option value='"+n.class_id+"'>" + n.class_name + "</option>";
  177. });
  178. classObj.append(html);
  179. }
  180. }
  181. );
  182. });
  183. });
  184. </script>
  185. <style>
  186. /*切换选择*/
  187. .tab-con{
  188. position: relative;
  189. height: 30px;
  190. width: 200px;
  191. background: #F2F2F2;
  192. border: 1px solid #01B677;
  193. border-radius: 15px;
  194. }
  195. .has-sel{
  196. background: #01B677;
  197. color: #fff;
  198. width: 50%;
  199. height: 30px;
  200. border-top-left-radius: 15px;
  201. border-bottom-left-radius: 15px;
  202. text-align: center;
  203. line-height: 30px;
  204. }
  205. .sel-opt{
  206. width: 50%;
  207. position: relative;
  208. color: #01B677;
  209. line-height: 30px;
  210. text-indent: 6px;
  211. cursor: pointer;
  212. }
  213. .sel-opt:after{
  214. content: '';
  215. border-left: 6px solid transparent;
  216. border-right: 6px solid transparent;
  217. border-top: 8px solid #01B677;
  218. position: absolute;
  219. right: 12px;
  220. top: 12px;
  221. }
  222. // .sel-opt select{
  223. // width: 100%;
  224. // height: 30px;
  225. // background: #F2F2F2;
  226. // color: #01B677;
  227. // text-indent: 6px;
  228. // font-size: inherit;
  229. // border-top-right-radius: 15px;
  230. // border-bottom-right-radius: 15px;
  231. // cursor: pointer;
  232. // }
  233. // .sel-opt select option{
  234. // position: relative;
  235. // }
  236. .points{
  237. position: absolute;
  238. top: -2px;
  239. right: 0;
  240. width: 10px;
  241. height: 10px;
  242. background: #F01516;
  243. border-radius: 50%;
  244. }
  245. .sel-cons{
  246. border: 1px solid #01B677;
  247. width: 50%;
  248. position: absolute;
  249. right: 0;
  250. top: 30px;
  251. text-indent: 10px;
  252. display: none;
  253. }
  254. .sc-lis{
  255. line-height: 30px;
  256. cursor: pointer;
  257. }
  258. .sc-lis span{
  259. position: relative;
  260. }
  261. .sc-lis .points{
  262. top: 2px;
  263. right: -16px;
  264. }
  265. .click-sc:focus {
  266. color: #fff;
  267. }
  268. .click-sc:hover {
  269. color: #fff;
  270. }
  271. .create-third{
  272. position: absolute;
  273. right: 6px;
  274. top: 10px;
  275. }
  276. </style>
  277. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
  278. <link rel="stylesheet" href="/fonts/shangchuan/iconfont.css" />
  279. <div class="main-content-inner">
  280. <ul class="clearfix main-content-inner-ul">
  281. <?php if((isset(Yii::app()->session['session_subject_id']) && Yii::app()->session['session_subject_id']==3) || (isset(Yii::app()->session['session_subject_id']) && Yii::app()->session['session_subject_id']==6)){?>
  282. <li class="pull-left">
  283. <button onclick='location.href="<?php echo $this->createUrl("print/index",array('type'=>'wp'));?>"' class="button button_normal button_group button_arrow " data-button="red">打印试卷</button>
  284. <img src="/images/line.jpg" style="height:45px;" />
  285. </li>
  286. <li class="pull-left">
  287. <!--<button onclick='ccc()' class="button button_normal button_group button_arrow <?php if($printType == 'wtb'){echo 'button_active';}?>" data-button="red">下载错题本</button>-->
  288. <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'wtb'));?>"' class="button button_normal button_group button_arrow " data-button="red">下载错题本</button>
  289. <img src="/images/line.jpg" style="height:45px;" />
  290. </li>
  291. <li class="pull-left">
  292. <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'isp'));?>"' class="button button_normal button_group button_arrow " data-button="red">下载个性化学习方案</button>
  293. <img src="/images/line.jpg" style="height:45px;" />
  294. </li>
  295. <li class="pull-left">
  296. <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'studytrend'));?>"' class="button button_normal button_group button_arrow " data-button="red">下载个性化学习宝</button>
  297. <img src="/images/line.jpg" style="height:45px;" />
  298. </li>
  299. <li class="pull-left">
  300. <button onclick='location.href="<?php echo $this->createUrl("print/student_product");?>"' class="button button_normal button_group button_arrow " data-button="red">阶段复习个性化学习宝</button>
  301. <img src="/images/line.jpg" style="height:45px;" />
  302. </li>
  303. <li class="pull-left">
  304. <button onclick='location.href="<?php echo $this->createUrl("third/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">第三方试卷</button>
  305. <img src="/images/line.jpg" style="height:45px;" />
  306. </li>
  307. <li class="pull-left">
  308. <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow <?php if($printType == ''){echo 'button_active';}?>" data-button="red">导出报告</button>
  309. <img src="/images/line.jpg" style="height:45px;" />
  310. </li>
  311. <li class="pull-left">
  312. <button onclick='location.href="<?php echo $this->createUrl("upload/index");?>"' class="button button_normal button_group button_arrow" data-button="red">上传试卷</button>
  313. <img src="/images/line.jpg" style="height:45px;" />
  314. </li>
  315. <?php if(isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)){
  316. ?>
  317. <li class="pull-left">
  318. <button onclick='location.href="<?php echo $this->createUrl("print/restore");?>"' class="button button_normal button_group button_arrow" data-button="red">还原考试</button>
  319. <img src="/images/line.jpg" style="height:45px;" />
  320. </li>
  321. <?php
  322. }?>
  323. <li class="pull-left">
  324. <button onclick='location.href="<?php echo $this->createUrl("record/importscore"); ?>"'
  325. class="button button_normal button_group button_arrow " data-button="red">导入成绩
  326. </button>
  327. <img src="/images/line.jpg" style="height:45px;"/>
  328. </li>
  329. <?php }else{ ?>
  330. <li class="pull-left">
  331. <button onclick='location.href="<?php echo $this->createUrl("print/index",array('type'=>'wp'));?>"' class="button button_normal button_group button_arrow " data-button="red">打印试卷</button>
  332. <img src="/images/line.jpg" style="height:45px;" />
  333. </li>
  334. <li class="pull-left">
  335. <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow " data-button="red">导出报告</button>
  336. <img src="/images/line.jpg" style="height:45px;" />
  337. </li>
  338. <li class="pull-left">
  339. <button onclick='location.href="<?php echo $this->createUrl("print/do_ruanyun_pdf");?>"' class="button button_normal button_group button_arrow" data-button="red">下载PDF</button>
  340. <img src="/images/line.jpg" style="height:45px;" />
  341. </li>
  342. <?php }?>
  343. <li class="pull-left">
  344. <button onclick='location.href="<?php echo $this->createUrl("cylet/index");?>"' class="button button_normal button_group button_arrow" data-button="red">全学科统考</button>
  345. <img src="/images/line.jpg" style="height:45px;" />
  346. </li>
  347. <li class="pull-left">
  348. <button onclick='location.href="<?php echo $this->createUrl("zhiliao/index");?>"' class="button button_normal button_group button_arrow" data-button="red">用户成绩推送设置</button>
  349. </li>
  350. </ul>
  351. <div class="page-content">
  352. <div class="row" style="margin:0px;">
  353. <div class="col-xs-12">
  354. <!-- PAGE CONTENT BEGINS -->
  355. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  356. <div class="row">
  357. <form method="get" id="form1" action="<?php echo $this->createUrl("third/index");?>">
  358. <div class="col-xs-12">
  359. <div class="dataTables_length margin-zy">
  360. <input type="hidden" name="type" value="<?php echo $printType;?>" />
  361. <input type="checkbox" name="display" style="margin: -1px 2px 0 0;display:inline-block;vertical-align: middle;width:15px;height:15px;" value="1" <?php if($display === '1') echo "checked";?>>显示隐藏试卷
  362. <select class="form-control" id="labelled" name="labelled">
  363. <option value="">标注状态</option>
  364. <option value="0" <?php if($labelled === '0') echo "selected";?> >未发送</option>
  365. <option value="2" <?php if($labelled == 2) echo "selected";?> >已发送</option>
  366. <option value="1" <?php if($labelled == 1) echo "selected";?>>已标注</option>
  367. </select>
  368. <input type="text" class="form-control input-sm" placeholder="请输入打印任务名称" name="name" value="<?php echo $printName;?>">
  369. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  370. <span style="font-size:13px;padding-left:2px;color:red;">
  371. <?php echo $printType == 'wp' ? "提示:超出考试日期1天的试卷不能发送标注" : "提示:生成的错题本、个性化学习宝仅保留7天";?>
  372. </span>
  373. </div>
  374. </div>
  375. </form>
  376. <button onclick='location.href="<?php echo $this->createUrl("third/thirdview");?>"' class="label-primary-s bth-s create-third" data-button="red">创建试卷</button>
  377. </div>
  378. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  379. <thead>
  380. <tr>
  381. <th>名称</th>
  382. <th>创建日期</th>
  383. <th>是否创建答题卡</th>
  384. <th>选择题量</th>
  385. <th>填空题量</th>
  386. <th>解答题量</th>
  387. <!-- <th>选做题量</th>-->
  388. <th >状态</th>
  389. <th >操作</th>
  390. </tr>
  391. </thead>
  392. <tbody>
  393. <?php if(!empty($printList)):foreach($printList as $cl):?>
  394. <tr>
  395. <td style="max-width:260px">
  396. <?php
  397. if($cl['is_new']==0)
  398. {
  399. echo "<span style='color: #ff0000;font-weight: bold;'>【New】</span>";
  400. }
  401. ?>
  402. <?php if( isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)){
  403. ?>
  404. <a href="<?php echo Yii::app()->createUrl('paper/index',array('eid'=>$cl['exam_id'],'is_third'=>1))?>"><?php echo $cl['exam_name'];?></a>
  405. <?php }else{
  406. ?>
  407. <a href="<?php echo Yii::app()->createUrl('paper/index',array('eid'=>$cl['exam_id'],'is_third'=>1,'tag'=>1))?>"><?php echo $cl['exam_name'];?></a>
  408. <?php
  409. }?>
  410. <!-- <a href="<?php /*echo Yii::app()->createUrl('paper/index',array('eid'=>$cl['exam_id']))*/?>"><?php /*echo $cl['print_name'];*/?></a>-->
  411. </td>
  412. <td><?php if(!empty($cl['create_time'])){ echo date('Y-m-d',$cl['create_time']);}?></td>
  413. <td><?php if(isset($exam_sheets[$cl['exam_group_id']]) && !empty($exam_sheets[$cl['exam_group_id']])){ echo '已创建';}else{echo "未创建";}?></td>
  414. <td><?php if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
  415. echo $sheet_rs[$cl['exam_group_id']]->ke_topic_num;
  416. }else{echo 0;}?></td>
  417. <td><?php if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
  418. echo $sheet_rs[$cl['exam_group_id']]->tian_topic_num;
  419. }else{echo 0;}?></td>
  420. <td><?php if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
  421. echo $sheet_rs[$cl['exam_group_id']]->zu_topic_num;
  422. }else{echo 0;}?></td>
  423. <!-- <td><?php /*if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
  424. echo $sheet_rs[$cl['exam_group_id']]->xuan_topic_num;
  425. }else{echo 0;}*/?></td>-->
  426. <td>
  427. <?php if($cl['is_answersheet']==1){if($cl["is_labelled"] == 1){
  428. echo "<span style='color:green;font-weight:normal;'>已标注</span>";
  429. }else if($cl["is_labelled"] == 2 ){
  430. echo "<span style='color:orange;font-weight:normal;'>已发送</span>";
  431. }
  432. if($cl["is_labelled"] == 0 && $cl['tw_status']==2){?>
  433. <span class="iconfont click-sc addbx sendLabelTask" examId="<?php echo $cl["exam_id"];?>" examName="<?php echo $cl["exam_name"];?>" subjectId="<?php echo $cl["subject_id"];?>" createTime="<?php echo $cl["examDate"];?>" aria-hidden="true" title="发送试题标注">&#xe71f;</span>
  434. <?php }}else{if($cl['tw_status']==2){echo "<span style='color:orange;font-weight:normal;'>解析成功</span>";}elseif($cl['tw_status']==3){echo "<span style='color:orange;font-weight:normal;cursor:pointer' onclick=showError('".$cl['wrong_reason']."')>解析失败</span>";}elseif($cl['word_path']){echo "<span style='color:orange;font-weight:normal;'>等待解析</span>";}else{echo "<span style='color:orange;font-weight:normal;'>上传试卷</span>";}}?>
  435. </td>
  436. <td style="width:265px;">
  437. <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生" onclick="javascript:location.href='<?php echo $this->createUrl('third/exam_list',array('exam_group_id'=>$cl['exam_group_id'],'branch'=>$cl['branch'],'grade'=>$class_grade[$cl['class_id']],'upload_status'=>$cl['upload_status']));?>'">&#xe668;</span>
  438. <a class="iconfont click-sc addbx create_sheet" aria-hidden="true" title="<?php if(isset($exam_sheets[$cl['exam_group_id']]) && !empty($exam_sheets[$cl['exam_group_id']])){ echo '修改答题卡';}else{echo "创建答题卡";}?>" exam_group_id="<?php echo $cl['exam_group_id']?>" sheet_id ="<?php if(isset($exam_sheets[$cl['exam_group_id']]) && !empty($exam_sheets[$cl['exam_group_id']])){ echo $exam_sheets[$cl['exam_group_id']];}else{echo 0;}?>">&#xe804;</a>
  439. <!-- <span class="iconfont click-sc addbx" aria-hidden="true" title="创建客观题答案" onclick="javascript:location.href='<?php /*echo $this->createUrl('third/exam_answer',array('exam_group_id'=>$cl['exam_group_id']));*/?>'">答</span>-->
  440. <span class="iconfont click-sc addbx" aria-hidden="true" title="扫描答题卡" onclick="createTemplate('<?php echo $cl['exam_group_id'];?>')">扫</span>
  441. <span class="iconfont click-sc addbx" aria-hidden="true" title="上传试卷" onclick="uploadTemplate('<?php echo $cl['exam_group_id'];?>','<?php echo $cl['exam_name'];?>')">&#xe640;</span>
  442. <?php if($cl['is_display'] == 1):?>
  443. <span class="iconfont click-sc click-tc addbx" aria-hidden="true" title="恢复试卷" onclick="oprateExam('<?php echo $cl['exam_group_id'];?>',0)">&#xe68f;</span>
  444. <?php else:?>
  445. <span class="iconfont click-sc click-delete addbx" aria-hidden="true" title="隐藏试卷" onclick="oprateExam('<?php echo $cl['exam_group_id'];?>',1)">&#xe68b;</span>
  446. <?php endif;?>
  447. </td>
  448. </tr>
  449. <?php endforeach;else:?>
  450. <tr><td colspan="8">暂无数据!</td></tr>
  451. <?php endif;?>
  452. </tbody>
  453. </table>
  454. <?php if(!empty($page_total)):?>
  455. <div class="row">
  456. <div class="col-xs-6">
  457. &nbsp;
  458. </div>
  459. <div class="col-xs-6">
  460. <div class="dataTables_paginate paging_simple_numbers">
  461. <?php
  462. $this->widget('CLinkPager', array(
  463. 'header' => '',
  464. 'firstPageLabel'=> '首页',
  465. 'lastPageLabel' => '末页',
  466. 'prevPageLabel' => '上一页',
  467. 'nextPageLabel' => '下一页',
  468. 'pages' => $pages,
  469. 'maxButtonCount'=> 5,
  470. ));
  471. echo '共:'.$page_total.'条';
  472. ?>
  473. </div>
  474. </div>
  475. </div>
  476. <?php endif;?>
  477. </div>
  478. <!--上传模板弹窗-->
  479. <!-- PAGE CONTENT ENDS -->
  480. </div>
  481. </div>
  482. </div>
  483. </div>
  484. <script src="/js/jquery.ajaxfileupload.js"></script>
  485. <script type="text/javascript">
  486. $(document).ready(function(){
  487. /*var str = '<div class="points"></div>';
  488. $(".sc-lis").each(function(){
  489. if($(this).find(".points").length>0){
  490. $(".sel-opt").append(str);
  491. }
  492. });*/
  493. $(".sel-opt,.sel-cons").mouseover(function(){
  494. $(".sel-cons").show();
  495. }).mouseout(function(){
  496. $(".sel-cons").hide();
  497. });
  498. $(".sc-lis").click(function(){
  499. var data = {
  500. subjectId : $(this).attr('val')
  501. };
  502. $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>",data,function(flags){
  503. if(flags)
  504. {
  505. location.reload();
  506. }else
  507. {
  508. alert('网络异常');
  509. }
  510. });
  511. $('.has-sel').text($(this).text());
  512. $(".sel-cons").hide();
  513. });
  514. $(".ruanyun").click(function(){
  515. var exam_id = $(this).attr('exam_id');
  516. layer.msg("确定发送吗?学生是否全部上传成绩", {
  517. time: 0,
  518. btn: ['确定', '取消'],
  519. yes: function(index){
  520. layer.close(index);
  521. $.ajax({
  522. url: "<?php echo $this->createUrl('print/send_ruanyun_pdf');?>",
  523. type: "POST",
  524. dataType: "json",
  525. data:{ examId: exam_id
  526. },
  527. success: function (data){
  528. if(data.status == 1){
  529. layer.msg('发送成功',{
  530. icon: 1
  531. }, function(){
  532. layer.closeAll();
  533. location.reload();
  534. });
  535. }else if(data.status == 2){
  536. layer.msg('发送失败,未上传成绩',{
  537. icon: 5
  538. }, function(){
  539. layer.closeAll();
  540. location.reload();
  541. });
  542. }else{
  543. layer.msg('发送失败',{
  544. icon: 5
  545. }, function(){
  546. layer.closeAll();
  547. location.reload();
  548. });
  549. }
  550. },
  551. error: function (data, status, e){ //服务器响应失败处理函数
  552. layer.msg('返回失败!',{
  553. icon: 1
  554. }, function(){
  555. layer.closeAll();
  556. });
  557. }
  558. });
  559. }
  560. });
  561. });
  562. $(".create_sheet").click(function(){
  563. var exam_group_id = $(this).attr("exam_group_id");
  564. var sheet_id = $(this).attr("sheet_id");
  565. if(exam_group_id>0){
  566. $.post("<?php echo Yii::app()->createUrl('third/set_new')?>",{exam_group_id:exam_group_id});
  567. $.post("<?php echo Yii::app()->createUrl('third/verify_exam_rs')?>",{exam_group_id:exam_group_id},function(rs){
  568. var m = JSON.parse(rs);
  569. if(m.status==1)
  570. {
  571. layer.msg('已上传成绩,无法修改!',{
  572. icon: 5
  573. }, function(){
  574. layer.closeAll();
  575. location.reload();
  576. });
  577. }
  578. if(m.status==3)
  579. {
  580. layer.msg('已发送标注,无法修改!',{
  581. icon: 5
  582. }, function(){
  583. layer.closeAll();
  584. location.reload();
  585. });
  586. }
  587. if(m.status==2)
  588. {
  589. layer.msg('非法考试!',{
  590. icon: 5
  591. }, function(){
  592. layer.closeAll();
  593. location.reload();
  594. });
  595. }
  596. if(m.status==0)
  597. {
  598. evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id);
  599. }
  600. });
  601. }
  602. });
  603. });
  604. function showError(str)
  605. {
  606. layer.msg(str,{
  607. icon: 5
  608. }, function(){
  609. layer.closeAll();
  610. location.reload();
  611. });
  612. }
  613. function objToJson(obj){
  614. var json = "{ ";
  615. for(var item in obj){
  616. json += "'"+item+"':'"+obj[item]+"',";
  617. }
  618. json += " }";
  619. return json;
  620. }
  621. function ccc(){
  622. layer.msg('敬请期待!', {
  623. time: 0,
  624. btn: ['确定', '取消'],
  625. yes: function(index){
  626. layer.close(index);
  627. return false;
  628. }
  629. });
  630. }
  631. function delExam(odj){
  632. if (!odj) return false;
  633. var classId = odj.getAttribute("w_class_id");
  634. var examId = odj.getAttribute("w_exam_id");
  635. if (!classId || !examId) return false;
  636. var msg = '您确定要删除此班的考试吗?';
  637. layer.msg(msg, {
  638. time: 0,
  639. btn: ['确定', '取消'],
  640. yes: function(index){
  641. layer.close(index);
  642. $.ajax({
  643. url: "<?php echo $this->createUrl('print/delexam');?>",
  644. type: "POST",
  645. dataType: "json",
  646. data: {
  647. examId: examId,
  648. classId:classId
  649. },
  650. success: function (data){
  651. if(data.status == 1){
  652. layer.msg('删除成功',{
  653. icon: 1
  654. }, function(){
  655. layer.closeAll();
  656. location.reload();
  657. });
  658. }else{
  659. layer.msg('删除失败',{
  660. icon: 5
  661. }, function(){
  662. layer.closeAll();
  663. location.reload();
  664. });
  665. }
  666. },
  667. error: function (data, status, e){ //服务器响应失败处理函数
  668. layer.msg('返回失败!',{
  669. icon: 1
  670. }, function(){
  671. layer.closeAll();
  672. });
  673. }
  674. });
  675. }
  676. });
  677. }
  678. // 确认上传成绩
  679. function uploadConfirm(classId, examId,className,is_uploaded_count,students_count) {
  680. //if (confirm('您确定已上传成绩了吗?')) {
  681. 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>";
  682. layer.msg(msg, {
  683. time: 0,
  684. btn: ['确定', '取消'],
  685. yes: function(index, layerObj){
  686. layer.close(index);
  687. $.ajax({
  688. url: "<?php echo $this->createUrl('print/uploadConfirm');?>",
  689. type: "POST",
  690. data: {
  691. classId: classId,
  692. examId: examId
  693. },
  694. beforeSend:function(){
  695. // 发送请求显示打印中
  696. layer.msg('确认中...', {time: 20000});
  697. },
  698. dataType: "JSON",
  699. success: function(data) {
  700. if (data.status == 1) {
  701. layer.msg('确认成功!');
  702. setTimeout(function(){location.reload();}, 1300);
  703. } else {
  704. layer.msg(data.error);
  705. }
  706. },
  707. complete:function(){
  708. },
  709. error:function(){
  710. }
  711. });
  712. }
  713. });
  714. //}
  715. }
  716. // 打印错题本
  717. function printBook(cid,eid,type){
  718. if (!cid || !eid || !type) {
  719. layer.msg("打印参数有误");return;
  720. }
  721. var message = '';
  722. var objUrl = '';
  723. if (type == 1) {
  724. message = "您确定要下载该班级纠错本吗?";
  725. objUrl = "<?php echo $this->createUrl('print/downloadwrongtopic');?>";
  726. divTitle = "下载错题本";
  727. improveName = "错题本";
  728. } else if (type == 2){
  729. message = "您确定要下载该班级个性化学习方案吗?";
  730. objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
  731. divTitle = "下载个性化学习方案";
  732. improveName = "个性化学习方案";
  733. }else if (type == 3){
  734. message = "您确定要下载该班级个性化学习宝吗?";
  735. objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
  736. divTitle = "下载个性化学习宝";
  737. improveName = "个性化学习宝";
  738. }
  739. else{
  740. layer.msg("打印参数有误");return;
  741. }
  742. html = ""+
  743. '<div style="padding:20px 30px 0px 30px">'+
  744. '<div style="padding:8px 0;">请复制下方链接下载'+improveName+'。</div>'+
  745. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  746. '<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>'+
  747. '</div>'+
  748. '</div>'+
  749. "";
  750. layer.msg(message, {
  751. time: 0,
  752. btn: ['确定', '取消'],
  753. yes: function(index){
  754. layer.close(index);
  755. msgIndex = layer.msg("下载中请稍后...", {"time": 3600000});
  756. // 更试卷打印时间
  757. $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: cid, eid: eid,type:type } );
  758. /*if(type == 1)
  759. location.href = objUrl+"/cid/"+cid+"/eid/"+eid;
  760. else
  761. location.href = objUrl+"/cid/"+cid+"/eid/"+eid+"/type/"+type;*/
  762. startTime = (new Date()).getTime();
  763. showTip = true;
  764. tipShowed = false;
  765. toPromptTime = 3000;
  766. window.interval = setInterval(function(){
  767. execTime = (new Date()).getTime() - startTime;
  768. if(execTime > toPromptTime && showTip && !tipShowed){
  769. // msgIndex = layer.msg("该文件较大,请耐心等待...", {"time": 3600000});
  770. // tipShowed = true;
  771. }
  772. }, 1000);
  773. jQuery.get(
  774. "<?php echo $this->createUrl("print/getImproveFile");?>",
  775. {"examId": eid, "classId": cid, "type": type},
  776. function(data){
  777. data = JSON.parse(data);
  778. if(data.success == 1||data.success == 2){
  779. layer.open({
  780. type: 1,
  781. area: ['550px', '220px'],
  782. title: divTitle,
  783. content: html,
  784. success: function(index, layerObj){
  785. clearInterval(window.interval);
  786. msgIndex = layer.msg(data.limitinfo, {"time": 3000});
  787. clearInterval(window.interval);
  788. layer.close(msgIndex);
  789. 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>');
  790. jQuery("#confirm, #cancel").on("click", function(){
  791. layer.close(layerObj);
  792. });
  793. jQuery("#copy").on("click", function(){
  794. jQuery("#url").select();
  795. });
  796. },
  797. end: function(){
  798. }
  799. });
  800. }
  801. else if(data.success == 0){
  802. clearInterval(window.interval);
  803. msgIndex = layer.msg(data.message, {"time": 3000});
  804. }
  805. }
  806. );
  807. }
  808. });
  809. }
  810. // 上传试卷模板
  811. function uploadTemplate(eid,name){
  812. if (!eid) {
  813. layer.msg('操作失败!');
  814. return false;
  815. }
  816. forCheckUrl = "<?php echo $this->createUrl('third/checkanswercard');?>";
  817. $.post(forCheckUrl,{eid:eid},function(data){
  818. var obj = JSON.parse(data);
  819. if(obj.success==1)
  820. {
  821. var html ='<div class="layer_notice" style="padding:5px;">';
  822. html +='<table class="table table-striped table-bordered table-hover ">';
  823. html +='<thead class="thin-border-bottom">';
  824. html +='<tr>';
  825. html +='<th>试卷名称</th>';
  826. html +='<th>操作</th>';
  827. html +='</tr>';
  828. html +='</thead>';
  829. html +='<tbody class="content_tbody">';
  830. html +='<td>'+name+'</td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
  831. html +='</tbody>';
  832. html +='</table>';
  833. html +='<span style="width:582px;display:inline-block;text-align:center;">';
  834. html +='<button class="btn btn-success btn-sm" onclick="uploadWord()"><i class="ace-icon fa fa-check bigger-110"></i>确定</button>';
  835. html +='</span>';
  836. html +='<input type="hidden" id="mpEGid" value="'+eid+'">';
  837. html +='</div>';
  838. layer.open({
  839. type: 1,
  840. skin: 'layui-layer-rim', //加上边框
  841. area: ['600px', '300px'], //宽高
  842. content: html
  843. });
  844. }else
  845. {
  846. layer.msg(obj.message,{
  847. icon: 5
  848. }, function(){
  849. layer.closeAll();
  850. location.reload();
  851. });
  852. //layer.msg(obj.message);
  853. }
  854. });
  855. }
  856. function uploadWord() {
  857. var paramEid = $('#mpEGid').val();
  858. if (!paramEid) {
  859. layer.msg('没找到考试ID!');
  860. return false;
  861. }
  862. var obj_file = $("#word_file").val();
  863. if (!obj_file) {
  864. layer.msg('请选择上传文件');
  865. return false;
  866. }
  867. var extStart = obj_file.lastIndexOf('.');
  868. var extName = obj_file.substring(extStart,obj_file.length).toLowerCase();
  869. if (extName != ".docx" && extName != ".dotx" && extName != ".dotm") {
  870. layer.msg('模板格式有误,请上传dotx格式word!');
  871. return false;
  872. }
  873. $.ajaxFileUpload({
  874. url: "<?php echo $this->createUrl('third/uploadTpl');?>", //用于文件上传的服务器端请求地址
  875. secureuri: false, //是否需要安全协议,一般设置为false
  876. fileElementId: 'word_file', //文件上传域的ID
  877. dataType: 'text', //返回值类型 一般设置为json
  878. data:{"eid":paramEid},
  879. success: function (data, status){
  880. var obj = JSON.parse(data);
  881. if (obj.success == 1) {
  882. layer.msg(obj.message,{
  883. icon: 1,
  884. }, function(){
  885. layer.closeAll();
  886. location.reload();
  887. });
  888. $("#alreadUpload").html('<span style="color:red;">已上传</span>');
  889. } else {
  890. layer.msg(obj.message,{
  891. icon: 1,
  892. }, function(){
  893. layer.closeAll();
  894. location.reload();
  895. });
  896. }
  897. },
  898. error: function (data, status, e){ //服务器响应失败处理函数
  899. layer.msg('返回失败!',{
  900. icon: 1,
  901. }, function(){
  902. layer.closeAll();
  903. location.reload();
  904. });
  905. }
  906. });
  907. return false;
  908. }
  909. // 搜索事件
  910. $("#search").click(function(){
  911. $("#form1").submit();
  912. });
  913. function print(cid,eid,tid,fg){
  914. if (!cid || !eid) return false;
  915. var msg = '';
  916. if (tid == 0) {
  917. if (fg == 1) {
  918. msg = '打印答题卡';
  919. } else {
  920. msg = '您确定要打印该试卷嘛?';
  921. }
  922. } else if (tid == 1) {
  923. msg = '您确定要打印该错题本嘛?';
  924. } else if (tid == 2) {
  925. msg = '您确定要打印该个性化学习宝吗?';
  926. }
  927. layer.msg(msg, {
  928. time: 0,
  929. btn: ['确定', '取消'],
  930. yes: function(index){
  931. layer.close(index);
  932. ajaxPrint(cid, eid, tid);
  933. }
  934. });
  935. }
  936. function ajaxPrint(cid, eid, tid) {
  937. $.ajax({
  938. url:"<?php echo $this->createUrl('print/ajaxupdate');?>",
  939. type:"post",
  940. data:{cid:cid,eid:eid,tid:tid},
  941. dataType: "json",
  942. beforeSend:function(){
  943. // 发送请求显示打印中
  944. layer.msg('打印中', {icon: 16,time: 20000});
  945. },
  946. success:function(obj){
  947. var index = layer.msg();
  948. layer.close(index);
  949. if (obj.success == 1) {
  950. if (tid == 0) {//console.log(JSON.stringify(obj.message));
  951. evaluationClient.printPaper(JSON.stringify(obj.message));
  952. //alert('提交打印试卷成功!');
  953. } else if (tid == 1) {
  954. evaluationClient.printCTB(JSON.stringify(obj.message));
  955. //alert('提交打印错题本成功!');
  956. } else if (tid == 2) {
  957. evaluationClient.printTFFA(JSON.stringify(obj.message));
  958. //alert('提交打印提分册成功!');
  959. } else {
  960. layer.msg('操作错误!');
  961. }
  962. location.reload();
  963. } else {//alert(obj.message);
  964. layer.msg(obj.message);
  965. }
  966. },
  967. complete:function(){
  968. //layer.msg('打印失败!');
  969. //var index = layer.msg();
  970. //layer.close(index);
  971. },
  972. error:function(){
  973. //var index = layer.msg();
  974. //layer.close(index);
  975. }
  976. });
  977. }
  978. // 生成试卷模板
  979. function createTemplate (exam_group_id){
  980. if (!exam_group_id) {
  981. layer.msg('未找到试卷ID');
  982. }
  983. var data={
  984. exam_group_id:exam_group_id
  985. }
  986. $.post("<?php echo Yii::app()->createUrl("third/paper")?>",data,function(rs){
  987. var m = JSON.parse(rs);
  988. if(m.status==1)
  989. {
  990. evaluationClient.loadThirdParty(exam_group_id);
  991. }else {
  992. layer.msg('尚未创建答题卡,请创建');
  993. }
  994. });
  995. }
  996. function wb_html(odj){
  997. if (!odj) return false;
  998. var classId = odj.getAttribute("w_class_id");
  999. var examId = odj.getAttribute("w_exam_id");
  1000. if (!classId || !examId) return false;
  1001. var msg = '您确定要生成该班级的错题本吗?';
  1002. layer.msg(msg, {
  1003. time: 0,
  1004. btn: ['确定', '取消'],
  1005. yes: function(index){
  1006. layer.close(index);
  1007. $.ajax({
  1008. url: "<?php echo $this->createUrl('client/wbhtml');?>",
  1009. type: "POST",
  1010. dataType: "json",
  1011. data: {
  1012. examId: examId,
  1013. classId:classId
  1014. },
  1015. success: function (data){
  1016. if(data > 0){
  1017. layer.msg('操作成功,重新生成错题本',{
  1018. icon: 1
  1019. }, function(){
  1020. layer.closeAll();
  1021. });
  1022. }else if(data==0){
  1023. layer.msg('操作失败,此班无错题本',{
  1024. icon: 1
  1025. }, function(){
  1026. layer.closeAll();
  1027. });
  1028. }
  1029. else{
  1030. layer.msg('操作失败,重新生成错题本',{
  1031. icon: 1
  1032. }, function(){
  1033. layer.closeAll();
  1034. });
  1035. }
  1036. },
  1037. error: function (data, status, e){ //服务器响应失败处理函数
  1038. layer.msg('返回失败!',{
  1039. icon: 1
  1040. }, function(){
  1041. layer.closeAll();
  1042. });
  1043. }
  1044. });
  1045. }
  1046. });
  1047. }
  1048. function isp2_html(odj){
  1049. if (!odj) return false;
  1050. var classId = odj.getAttribute("w_class_id");
  1051. var examId = odj.getAttribute("w_exam_id");
  1052. if (!classId || !examId) return false;
  1053. var msg = '您确定要生成该班级的二步提分方案吗?';
  1054. layer.msg(msg, {
  1055. time: 0,
  1056. btn: ['确定', '取消'],
  1057. yes: function(index){
  1058. layer.close(index);
  1059. $.ajax({
  1060. url: "<?php echo $this->createUrl('client/isp2html');?>",
  1061. type: "POST",
  1062. dataType: "json",
  1063. data: {
  1064. examId: examId,
  1065. classId:classId
  1066. },
  1067. success: function (data){
  1068. if(data > 0){
  1069. layer.msg('操作成功,重新生成提分方案',{
  1070. icon: 1
  1071. }, function(){
  1072. layer.closeAll();
  1073. });
  1074. }else if(data==0){
  1075. layer.msg('操作失败,此班无提分方案',{
  1076. icon: 1
  1077. }, function(){
  1078. layer.closeAll();
  1079. });
  1080. }
  1081. else{
  1082. layer.msg('操作失败,重新生成提分方案',{
  1083. icon: 1
  1084. }, function(){
  1085. layer.closeAll();
  1086. });
  1087. }
  1088. },
  1089. error: function (data, status, e){ //服务器响应失败处理函数
  1090. layer.msg('返回失败!',{
  1091. icon: 1
  1092. }, function(){
  1093. layer.closeAll();
  1094. });
  1095. }
  1096. });
  1097. }
  1098. });
  1099. }
  1100. function isp3_html(odj){
  1101. if (!odj) return false;
  1102. var classId = odj.getAttribute("w_class_id");
  1103. var examId = odj.getAttribute("w_exam_id");
  1104. if (!classId || !examId) return false;
  1105. var msg = '您确定要生成该班级的个性化学习宝吗?';
  1106. layer.msg(msg, {
  1107. time: 0,
  1108. btn: ['确定', '取消'],
  1109. yes: function(index){
  1110. layer.close(index);
  1111. $.ajax({
  1112. url: "<?php echo $this->createUrl('client/isp3html');?>",
  1113. type: "POST",
  1114. dataType: "json",
  1115. data: {
  1116. examId: examId,
  1117. classId:classId
  1118. },
  1119. success: function (data){
  1120. if(data > 0){
  1121. layer.msg('操作成功,重新生成提分方案',{
  1122. icon: 1
  1123. }, function(){
  1124. layer.closeAll();
  1125. });
  1126. }else if(data==0){
  1127. layer.msg('操作失败,此班无提分方案',{
  1128. icon: 1
  1129. }, function(){
  1130. layer.closeAll();
  1131. });
  1132. }
  1133. else{
  1134. layer.msg('操作失败,重新生成提分方案',{
  1135. icon: 1
  1136. }, function(){
  1137. layer.closeAll();
  1138. });
  1139. }
  1140. },
  1141. error: function (data, status, e){ //服务器响应失败处理函数
  1142. layer.msg('返回失败!',{
  1143. icon: 1
  1144. }, function(){
  1145. layer.closeAll();
  1146. });
  1147. }
  1148. });
  1149. }
  1150. });
  1151. }
  1152. // 隐藏试卷
  1153. function oprateExam(examGroupId,flag){
  1154. if (examGroupId) {
  1155. layer.msg('未找到周周练id',{
  1156. icon: 5
  1157. }, function(){
  1158. layer.closeAll();
  1159. });
  1160. }
  1161. var msg = '您确定要隐藏该试卷吗?';
  1162. if (flag == 0) {
  1163. msg = '您确定要恢复该试卷吗?';
  1164. }
  1165. layer.msg(msg, {
  1166. time: 0,
  1167. btn: ['确定', '取消'],
  1168. yes: function(index){
  1169. layer.close(index);
  1170. $.post('<?php echo $this->createUrl("third/oprateexam");?>',{exam_group_id:examGroupId,flag:flag},function(data){
  1171. var obj = JSON.parse(data);
  1172. if (obj.success == 1) {
  1173. location.reload();
  1174. } else {
  1175. layer.msg(obj.message,{
  1176. icon: 5
  1177. }, function(){
  1178. layer.closeAll();
  1179. });
  1180. // layer.msg(obj.message);
  1181. }
  1182. });
  1183. }
  1184. });
  1185. }
  1186. </script>