index.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. <style>
  2. body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { margin:0; padding:0; }
  3. body { background:#fff; color:#555; font-size:14px; font-family:'Microsoft YaHei'; }
  4. td,th,caption { font-size:14px; }
  5. h1, h2, h3, h4, h5, h6 { font-weight:normal; font-size:100%; }
  6. address, caption, cite, code, dfn, em, strong, th, var { font-style:normal; font-weight:normal;}
  7. a { color:#555; text-decoration:none; }
  8. // a:hover { text-decoration:underline; }
  9. img { border:none; }
  10. i{font-style: normal;}
  11. s{text-decoration: none;}
  12. ol,ul,li { list-style:none; }
  13. input, textarea, select, button { font:14px Verdana,Helvetica,Arial,sans-serif; }
  14. table { border-collapse:collapse; }
  15. html {overflow-y: scroll;}
  16. /* css common */
  17. .clearfix:after {content: "."; display: block; height:0; clear:both; visibility: hidden;}
  18. .clearfix { *zoom:1; }
  19. body{background-color: #fff;}
  20. .ellipsis{display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  21. .optimize-click-btn{background-color: #e5e5e5;}
  22. .optimize-click-btn:hover,.optimize-btn:hover{background-color: #2fa596!important;color: #fff!important;text-decoration: none;}
  23. /* .optimize-click-btn:active{background-color: #2fa596!important;} */
  24. .optimize-click-btn.active{background-color: #50d2c2!important;color: #fff!important}
  25. .optimize-btn{background-color: #50d2c2;}
  26. .fw{font-weight: bold;}
  27. .fl{float: left;}
  28. .fr{float: right;}
  29. .tac{text-align: center;}
  30. .flex{
  31. display: -webkit-flex;
  32. display: -moz-flex;
  33. display: -ms-flex;
  34. display: -o-flex;
  35. display: flex;
  36. }
  37. .pro-explain-con{margin: 10px 20px;}
  38. .explain-menu{width: 50px;}
  39. .explain-msg{-webkit-flex: 1;
  40. -moz-flex: 1;
  41. -ms-flex: 1;
  42. -o-flex: 1;
  43. flex: 1;line-height: 20px;}
  44. .product-model-con{margin: 10px 20px;}
  45. .pmc-top{margin: 16px 0 20px;}
  46. .pmc-title{font-size: 18px;font-weight: bold;line-height: 40px;}
  47. .pmc-opt-btns{cursor: pointer;width: 100px;height: 40px;line-height: 40px;border-radius: 6px;background: #2977ff;color: #fff;}
  48. .pmc-opt-btns:hover{background: #2977ff;}
  49. .pmc-main{flex-wrap: wrap;border-bottom: 1px solid;}
  50. .pmc-list{margin-bottom: 20px; margin-right: 20px;}
  51. .class-name{width: 106px;height: 60px;line-height: 60px;background: #f2f2f2;color: blue;text-decoration: underline;}
  52. .class-name a {line-height: 60px;background: #f2f2f2;color: blue;text-decoration: underline;}
  53. .upload-detail{margin-left: 10px;}
  54. .born-product{cursor: pointer;margin-top: 10px;line-height: 30px;width: 123px;color: #fff;background: #2977ff;border-radius: 6px;}
  55. .born-product:hover{background: #2977ff;}
  56. .born-product.gray-bg{background: #ccc;color: #000;}
  57. .backlog-reset{text-align: center}
  58. /*弹出层*/
  59. .confirmbox {
  60. background: #fff;
  61. border: 1px solid #cccccc;
  62. border-radius: 3px;
  63. padding: 40px 40px 30px;
  64. text-align: center;
  65. position: fixed;
  66. left: 50%;
  67. top: 50%;
  68. transform: translate(-50%, -50%);
  69. z-index: 99;
  70. }
  71. .confirmbox-mask {
  72. background: rgba(0, 0, 0, .7);
  73. left: 0;
  74. right: 0;
  75. top: 0;
  76. bottom: 0;
  77. z-index: 99;
  78. position: fixed;
  79. }
  80. .confirmbox-mask button {
  81. border: none;
  82. background: #2977ff;
  83. width: 80px;
  84. height: 26px;
  85. border-radius: 3px;
  86. font-size: 14px;
  87. color: #fff;
  88. outline: none;
  89. cursor: pointer;
  90. }
  91. .class-modal {
  92. width: 700px;
  93. background: #fff;
  94. // border-radius: 5px;
  95. position: absolute;
  96. top: 50%;
  97. left: 50%;
  98. transform: translate(-50%, -50%);
  99. height:420px;
  100. }
  101. .class-modal-head {
  102. font-size: 14px;
  103. background:#2977ff;
  104. color:#fff;
  105. height:40px;
  106. line-height: 40px;
  107. padding: 0 0 0 15px;
  108. }
  109. .class-modal-body {
  110. margin-top: 5px;
  111. overflow: auto;
  112. padding:15px;
  113. min-height: 340px;
  114. }
  115. .class-modal-body .classes {
  116. margin-bottom: 20px;
  117. }
  118. .class-modal-body .classes > div {
  119. display: inline-block;
  120. max-width: 640px;
  121. vertical-align: top;
  122. }
  123. .class-modal-body .classes a {
  124. text-decoration: none;
  125. display: inline-block;
  126. margin: 0 5px 5px;
  127. color: #136bfb;
  128. font-size: 14px;
  129. }
  130. .class-modal-body .classes a.active {
  131. color: #fc091b;
  132. }
  133. .class-modal .icon-close{
  134. position: absolute;
  135. right: 20px;
  136. top: 6px;
  137. color:#fff;
  138. font-size:20px;
  139. }
  140. .c-red {
  141. color: #CC3300
  142. }
  143. .class_btn{
  144. text-align: center;
  145. }
  146. .confirmbox-mask p{
  147. word-wrap : break-word ;
  148. }
  149. .icon-close{
  150. cursor: pointer;
  151. }
  152. .model-input label{
  153. margin:0 15px;
  154. }
  155. table{margin-top:5px;}
  156. .table_list{
  157. height:250px;
  158. overflow: auto;
  159. }
  160. /* Tooltip 容器 */
  161. .tooltipclass {
  162. display: inline-block;
  163. }
  164. /* Tooltip 文本 */
  165. .tooltipclass .tooltiptext {
  166. visibility: hidden;
  167. width: 160px;
  168. background-color: #555;
  169. color: #fff;
  170. padding: 5px;
  171. border-radius: 6px;
  172. font-size:11px;
  173. text-align: left;
  174. /* 定位 */
  175. position: absolute;
  176. z-index: 1;
  177. }
  178. /* 鼠标移动上去后显示提示框 */
  179. .tooltipclass:hover .tooltiptext {
  180. visibility: visible;
  181. }
  182. </style>
  183. <div class="pro-explain-con flex">
  184. <div class="explain-menu">说明:</div>
  185. <div class="explain-msg">
  186. <?php if(Yii::app()->params['section']==0):?>
  187. 1、点击“生成产品”则系统开始对该班进行数据分析,随后生成错题本、个性化学习宝<br>
  188. <?php else:?>
  189. 1、点击“生成产品”则系统开始对该班进行数据分析,随后生成错题本、个性化学习宝等产品<br>
  190. <?php endif;?>
  191. 2、若班级未上传完成就生成产品,则未上传成绩的学生当0分计算,会导致班级排名等数据不准。可待上传完成后发日志重新生成<br>
  192. 3、若有学生缺考,可点击班级跳转到班级学生列表页,把缺考的学生从本次考试中删除,删除的学生计为缺考生
  193. </div>
  194. <div class="fr pmc-opt-btns backlog-reset " >重新发送 <img src="/images/icon-warning-red.png" title="已点击生成产品未能正常生成时可重新发送"></div>
  195. </div>
  196. <?php if($rs){
  197. foreach ($rs as $v){
  198. $uploadNum = 0;
  199. foreach ($v['result'] as $val){
  200. if($val['is_uploaded_count']==0 ){
  201. $uploadNum++;
  202. }
  203. }
  204. if($uploadNum == count($v['result'])){
  205. continue;
  206. }
  207. ?>
  208. <div class="product-model-con">
  209. <div class="pmc-top clearfix">
  210. <div class="fl pmc-title"><?php echo $v['exam_name']?></div>
  211. <div class="fr pmc-opt-btns tac" exam_group_id = "<?php echo $v['exam_group_id']?>">批量生成</div>
  212. </div>
  213. <div class="pmc-main flex">
  214. <?php foreach ($v['result'] as $val){
  215. if($val['is_uploaded_count']!=0 ){
  216. ?>
  217. <div class="pmc-list clearfix">
  218. <div class="fl class-name tac" ><a href="<?php echo $this->createUrl('print/change',array('cid'=>$val['class_id'],'eid'=>$val['exam_id']));?>"><?php echo $val['class_name']?></a></div>
  219. <div class="fl upload-detail">
  220. <?php
  221. $className='';
  222. if(isset($val['student_answer_img']) && $val['student_answer_img']) {
  223. if($val['is_uploaded_count']==$val['students_count'] && $val['student_answer_img']==$val['students_count']){
  224. $className='crate_back';
  225. }else{
  226. $className='gray-bg';
  227. }
  228. ?>
  229. <div class="upload-progress">成绩上传进度:<?php echo $val['is_uploaded_count']?>/<?php echo $val['students_count']?></div>
  230. <div class="upload-progress">答卷上传进度:<?php echo $val['student_answer_img']?>/<?php echo $val['students_count']?></div>
  231. <?php
  232. }else{
  233. if($val['is_uploaded_count']==$val['students_count'] ){
  234. $className='crate_back';
  235. }else{
  236. $className='gray-bg';
  237. }
  238. ?>
  239. <div class="upload-progress">成绩上传进度:<?php echo $val['is_uploaded_count']?>/<?php echo $val['students_count']?></div>
  240. <?php
  241. }
  242. ?>
  243. <div class="born-product tac <?php echo $className;?>" exam_id = "<?php echo $val['exam_id']?>" is_uploaded_count="<?php echo $val['is_uploaded_count']?>" students_count="<?php echo $val['students_count']?>" answer_upload='<?php if(isset($val['student_answer_img'])){echo $val['student_answer_img']; }else{
  244. echo 0;
  245. }?>' class_id = "<?php echo $val['class_id']?>">生成产品</div>
  246. </div>
  247. </div>
  248. <?php
  249. }
  250. }?>
  251. </div>
  252. </div>
  253. <?php
  254. }
  255. }?>
  256. <!-- 弹窗 -->
  257. <div class="confirmbox-mask" style="display:none " id="fieldModal">
  258. <div class="class-modal">
  259. <i class="icon close_1 icon-close">×</i>
  260. <div class="class-modal-head">重新发送</div>
  261. <form id="examSelect">
  262. <div class="class-modal-body">
  263. <input type="text" name="keyword" value="" placeholder="请输入考试名称">
  264. <button class="search_exam ">搜索</button> <span class="notice c-red "></span>
  265. <div class="table_list">
  266. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  267. </table>
  268. </div>
  269. </div>
  270. </form>
  271. </div>
  272. </div>
  273. <script>
  274. $(function(){
  275. $(".gray-bg").click(function () {
  276. answer_upload=$(this).attr('answer_upload');
  277. is_uploaded_count=$(this).attr('is_uploaded_count');
  278. students_count=$(this).attr('students_count');
  279. var msg = '有学生未上传成绩,现在生成产品,班级排名数据混乱。确认要现在生成吗?';
  280. if(students_count==is_uploaded_count){
  281. //全部上传
  282. if(answer_upload>0 &&answer_upload!=is_uploaded_count){
  283. var msg = '该场考试已上传成绩学生数量与已上传学生答题卡数量不一致,现在生成产品,会导致部分学生产品无作答图片,确认现在生成吗?';
  284. }
  285. }else{
  286. //有学生未上传
  287. if(answer_upload>0){
  288. if(answer_upload==is_uploaded_count){
  289. var msg = '有学生未上传成绩,现在生成产品,班级排名数据混乱。确认要现在生成吗?';
  290. }else{
  291. var msg = '有学生未上传成绩,且已上传成绩学生数量与已上传学生答题卡数量不一致,现在生成产品,班级排名数据混乱且会导致部分学生产品无作答图片,确认现在生成吗?';
  292. }
  293. }
  294. }
  295. var obj = $(this);
  296. layer.msg(msg, {
  297. time: 0,
  298. btn: ['确定', '取消'],
  299. area: ['370px', '180px'], //宽高
  300. yes: function(index){
  301. layer.close(index);
  302. var data ={
  303. exam_id:obj.attr('exam_id'),
  304. is_uploaded_count:obj.attr('is_uploaded_count'),
  305. class_id:obj.attr('class_id'),
  306. students_count:obj.attr('students_count')
  307. };
  308. $.post("<?php echo Yii::app()->createUrl('backlog/ajaxSend')?>",data,function (rs) {
  309. var m = JSON.parse(rs);
  310. if(m.status){
  311. layer.msg('发送成功,正在生成的路上...',{
  312. icon: 1
  313. }, function(){
  314. layer.closeAll();
  315. evaluationClient.rebacklog(m.count);
  316. location.reload();
  317. });
  318. }else {
  319. layer.msg('发送失败!',{
  320. icon: 5
  321. }, function(){
  322. layer.closeAll();
  323. location.reload();
  324. });
  325. }
  326. });
  327. }
  328. });
  329. });
  330. $(".crate_back").click(function () {
  331. var obj = $(this);
  332. var data ={
  333. exam_id:obj.attr('exam_id')
  334. };
  335. $.post("<?php echo Yii::app()->createUrl('backlog/ajaxSend')?>",data,function (rs) {
  336. var m = JSON.parse(rs);
  337. if(m.status){
  338. layer.msg('发送成功,正在生成的路上...',{
  339. icon: 1
  340. }, function(){
  341. layer.closeAll();
  342. evaluationClient.rebacklog(m.count);
  343. location.reload();
  344. });
  345. }else {
  346. layer.msg('发送失败!',{
  347. icon: 5
  348. }, function(){
  349. layer.closeAll();
  350. location.reload();
  351. });
  352. }
  353. });
  354. });
  355. $(".fr.pmc-opt-btns.tac").click(function () {
  356. var obj = $(this);
  357. var data ={
  358. exam_group_id:obj.attr('exam_group_id')
  359. };
  360. $.post("<?php echo Yii::app()->createUrl('backlog/ajaxAllSend')?>",data,function (rs) {
  361. var m = JSON.parse(rs);
  362. if(m.status){
  363. layer.msg('发送成功,正在生成的路上...',{
  364. icon: 1
  365. }, function(){
  366. layer.closeAll();
  367. evaluationClient.rebacklog(m.count);
  368. location.reload();
  369. });
  370. }else {
  371. layer.msg('发送失败!请继续上传成绩',{
  372. icon: 5
  373. }, function(){
  374. layer.closeAll();
  375. location.reload();
  376. });
  377. }
  378. });
  379. });
  380. $('.backlog-reset').click(function(){
  381. $('#fieldModal').show();
  382. });
  383. $('.close_1').click(function(){
  384. $('#fieldModal').hide();
  385. });
  386. //搜索考试
  387. $('.search_exam').click(function(){
  388. $('.notice').html('');
  389. keyword=$('input[name=keyword]').val();
  390. if(keyword==''){
  391. layer.msg('请输入考试名称');
  392. return false;
  393. }
  394. $.ajax({
  395. url:'<?php echo $this->createUrl('backlog/ajaxGetBacklogExam')?>',
  396. type:'POST',
  397. dataType:'json',
  398. data:{examName:keyword},
  399. success:function(res){
  400. if(res.status==1){
  401. if(res.exam==0){
  402. $('.notice').html('未查询到对应考试名称');
  403. }else{
  404. $('#dynamic-table').html(res.data);
  405. }
  406. }
  407. }
  408. });
  409. return false;
  410. });
  411. $('#dynamic-table')
  412. .on('click','.send-repeat',function(){
  413. var data ={
  414. exam_id:$(this).attr('id')
  415. };
  416. text = '该班级已发送产品生成,确定再次发送吗?';
  417. layer.msg(text,
  418. {
  419. btn:['确定','取消'],
  420. time: 0,
  421. yes:function(){
  422. $.post("<?php echo Yii::app()->createUrl('backlog/ajaxSend')?>",data,function (rs) {
  423. var m = JSON.parse(rs);
  424. if(m.status){
  425. layer.msg('发送成功,正在生成的路上...',{
  426. icon: 1
  427. }, function(){
  428. layer.closeAll();
  429. });
  430. }else {
  431. layer.msg('发送失败!',{
  432. icon: 5
  433. }, function(){
  434. layer.closeAll();
  435. });
  436. }
  437. });
  438. }
  439. });
  440. })
  441. })
  442. </script>
  443. </body>
  444. </html>