sheet.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <style>
  2. /*切换选择*/
  3. .tab-con{
  4. position: relative;
  5. height: 30px;
  6. width: 200px;
  7. background: #F2F2F2;
  8. border: 1px solid #01B677;
  9. border-radius: 15px;
  10. }
  11. .has-sel{
  12. background: #01B677;
  13. color: #fff;
  14. width: 50%;
  15. height: 30px;
  16. border-top-left-radius: 15px;
  17. border-bottom-left-radius: 15px;
  18. text-align: center;
  19. line-height: 30px;
  20. }
  21. .sel-opt{
  22. width: 50%;
  23. position: relative;
  24. color: #01B677;
  25. line-height: 30px;
  26. text-indent: 6px;
  27. cursor: pointer;
  28. }
  29. .sel-opt:after{
  30. content: '';
  31. border-left: 6px solid transparent;
  32. border-right: 6px solid transparent;
  33. border-top: 8px solid #01B677;
  34. position: absolute;
  35. right: 12px;
  36. top: 12px;
  37. }
  38. // .sel-opt select{
  39. // width: 100%;
  40. // height: 30px;
  41. // background: #F2F2F2;
  42. // color: #01B677;
  43. // text-indent: 6px;
  44. // font-size: inherit;
  45. // border-top-right-radius: 15px;
  46. // border-bottom-right-radius: 15px;
  47. // cursor: pointer;
  48. // }
  49. // .sel-opt select option{
  50. // position: relative;
  51. // }
  52. .points{
  53. position: absolute;
  54. top: -2px;
  55. right: 0;
  56. width: 10px;
  57. height: 10px;
  58. background: #F01516;
  59. border-radius: 50%;
  60. }
  61. .sel-cons{
  62. border: 1px solid #01B677;
  63. width: 50%;
  64. position: absolute;
  65. right: 0;
  66. top: 30px;
  67. text-indent: 10px;
  68. display: none;
  69. }
  70. .sc-lis{
  71. line-height: 30px;
  72. cursor: pointer;
  73. }
  74. .sc-lis span{
  75. position: relative;
  76. }
  77. .sc-lis .points{
  78. top: 2px;
  79. right: -16px;
  80. }
  81. </style>
  82. <div class="main-content-inner">
  83. <ul class="clearfix main-content-inner-ul">
  84. <?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)){?>
  85. <li class="pull-left">
  86. <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>
  87. <img src="/images/line.jpg" style="height:45px;" />
  88. </li>
  89. <li class="pull-left">
  90. <!--<button onclick='ccc()' class="button button_normal button_group button_arrow " data-button="red">下载错题本</button>-->
  91. <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>
  92. <img src="/images/line.jpg" style="height:45px;" />
  93. </li>
  94. <li class="pull-left">
  95. <!--<button onclick='ccc()' class="button button_normal button_group button_arrow " data-button="red">下载个性化学习方案</button>-->
  96. <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>
  97. <img src="/images/line.jpg" style="height:45px;" />
  98. </li>
  99. <li class="pull-left">
  100. <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>
  101. <img src="/images/line.jpg" style="height:45px;" />
  102. </li>
  103. <li class="pull-left">
  104. <button onclick='location.href="<?php echo $this->createUrl("print/student_product");?>"' class="button button_normal button_group button_arrow " data-button="red">阶段复习个性化学习宝</button>
  105. <img src="/images/line.jpg" style="height:45px;" />
  106. </li>
  107. <li class="pull-left">
  108. <button onclick='location.href="<?php echo $this->createUrl("third/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">第三方试卷</button>
  109. <img src="/images/line.jpg" style="height:45px;" />
  110. </li>
  111. <li class="pull-left">
  112. <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow " data-button="red">导出报告</button>
  113. <img src="/images/line.jpg" style="height:45px;" />
  114. </li>
  115. <li class="pull-left">
  116. <button onclick='location.href="<?php echo $this->createUrl("upload/index");?>"' class="button button_normal button_group button_arrow" data-button="red">上传试卷</button>
  117. <img src="/images/line.jpg" style="height:45px;" />
  118. </li>
  119. <li class="pull-left">
  120. <button onclick='location.href="<?php echo $this->createUrl("record/importscore"); ?>"'
  121. class="button button_normal button_group button_arrow " data-button="red">导入成绩
  122. </button>
  123. <img src="/images/line.jpg" style="height:45px;"/>
  124. </li>
  125. <?php }else{ ?>
  126. <li class="pull-left">
  127. <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>
  128. <img src="/images/line.jpg" style="height:45px;" />
  129. </li>
  130. <li class="pull-left">
  131. <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow " data-button="red">导出报告</button>
  132. <img src="/images/line.jpg" style="height:45px;" />
  133. </li>
  134. <li class="pull-left">
  135. <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>
  136. <img src="/images/line.jpg" style="height:45px;" />
  137. </li>
  138. <?php }?>
  139. <!-- <div class="tab-con clearfix pull-right" style="margin:8px 11px 0 0">
  140. <div class="has-sel fl"><?php /*echo isset(Yii::app()->params["subjectId"][Yii::app()->session['session_subject_id']])?Yii::app()->params["subjectId"][Yii::app()->session['session_subject_id']]:'数学'*/?></div>
  141. <div class="sel-opt fl">
  142. 切换学科
  143. <?php /*if($subject){*/?>
  144. <div class="points"></div>
  145. <?php /*}*/?>
  146. </div>
  147. <div class="sel-cons" style="z-index:6;background-color: #fff;">
  148. <div class="sc-lis" val="3"><span>数学<?php /*if($subject && isset($subject[3]) && !empty($subject[3])){*/?><div class="points"></div><?php /*}*/?></span></div>
  149. <div class="sc-lis" val="12"><span>物理<?php /*if($subject && isset($subject[12]) && !empty($subject[12])){*/?><div class="points"></div><?php /*}*/?></span></div>
  150. <div class="sc-lis" val="13"><span>化学<?php /*if($subject && isset($subject[13]) && !empty($subject[13])){*/?><div class="points"></div><?php /*}*/?></span></div>
  151. <div class="sc-lis" val="14"><span>生物<?php /*if($subject && isset($subject[14]) && !empty($subject[14])){*/?><div class="points"></div><?php /*}*/?></span></div>
  152. </div>
  153. </div>-->
  154. <li class="pull-left">
  155. <button onclick='location.href="<?php echo $this->createUrl("cylet/index");?>"' class="button button_normal button_group button_arrow" data-button="red">全学科统考</button>
  156. </li>
  157. </ul>
  158. <div class="page-content">
  159. <div class="row" style="margin:0px">
  160. <div class="col-xs-12">
  161. <!-- PAGE CONTENT BEGINS -->
  162. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  163. <div class="row">
  164. <div class="col-xs-4">
  165. <form method="get" id="form1" action="<?php echo $this->createUrl("third/sheet");?>">
  166. <div class="dataTables_length" style="margin: 6px 0px;">
  167. <div class="dataTables_length">
  168. <label><input type="text" class="form-control input-sm" placeholder="请输入学生姓名" name="sname" value="<?php echo $sname;?>"></label>
  169. <!--<button class="btn btn-minier btn-primary" id="search">搜索</button>-->
  170. <button style="padding:4px 12px;"class="label-primary-s bth-s">搜索</button>
  171. </div>
  172. </div>
  173. <?php if(isset($exam['exam_id'])){
  174. ?>
  175. <input type="hidden" name="exam_id" class="emid" value="<?php echo $exam['exam_id'];?>" />
  176. <input type="hidden" name="class_id" class="class_id" value="<?php echo $class_id;?>" />
  177. <?php }?>
  178. </form>
  179. </div>
  180. <div class="col-xs-8">
  181. <div class="dataTables_filter" id="dynamic-table_filter" style="padding-top:15px;text-align: right;">
  182. <?php if(isset($exam['exam_id'])){
  183. ?>
  184. <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="selectSheet">
  185. <i style="font-style: normal;" ></i>选择模板
  186. </a>
  187. <?php }?>
  188. <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="addSheet">
  189. <i style="font-style: normal;" ></i>新建答题卡
  190. </a>
  191. </div>
  192. </div>
  193. </div>
  194. <div class="row">
  195. <div class="col-xs-12" style="font-weight:bold;padding:0px 15px">
  196. <?php if(isset($exam['exam_id'])){
  197. ?>
  198. <?php echo $className;?> <?php echo $exam['name'];?> <?php echo $exam['topic_type'];?>
  199. <?php }?>
  200. </div>
  201. </div>
  202. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  203. <thead>
  204. <tr>
  205. <?php if(isset($exam['exam_id'])){
  206. ?>
  207. <th class="center">
  208. </th>
  209. </td>
  210. <?php }?>
  211. <th>答题卡ID</th>
  212. <th>答题卡名称</th>
  213. <th>客观题数量</th>
  214. <th>主观题数量</th>
  215. <th>选做题数量</th>
  216. <th>操作</th>
  217. </tr>
  218. </thead>
  219. <tbody>
  220. <?php if(!empty($sheet)):foreach($sheet as $rt):?>
  221. <tr>
  222. <?php if(isset($exam['exam_id'])){
  223. ?>
  224. <td class="center">
  225. <input type="radio" name="sheet_id" class="ace myselect" value="<?php echo $rt['sheet_id'];?>" stnm="<?php echo $rt['sheet_id'];?>">
  226. </td>
  227. <?php }?>
  228. <td><?php echo $rt['sheet_id'];?></td>
  229. <td><?php echo $rt['name'];?></td>
  230. <td><?php echo $rt['ke_topic_num'];?></td>
  231. <td><?php echo $rt['zu_topic_num'] ?></td>
  232. <td><?php echo $rt['xuan_topic_num'] ?></td>
  233. <td>
  234. <span class="iconfont addbx click-sc update" title="编辑" sheet_id = "<?php echo $rt['sheet_id']?>">&#xe77d;</span>
  235. <span class="iconfont addbx click-delete delClass" style="background-color: red;" sheet_id = "<?php echo $rt['sheet_id']?>">&#xe616;</span> </td>
  236. </tr>
  237. <?php endforeach;else:?>
  238. <tr><td colspan="6">暂无数据!</td></tr>
  239. <?php endif;?>
  240. </tbody>
  241. </table>
  242. <?php if(isset($exam['exam_id'])){
  243. ?>
  244. <input type="hidden" name="wpCode" id="wpCode" value="<?php echo $exam['exam_id'];?>" />
  245. <input type="hidden" name="schoolId" id="schoolId" value="<?php echo Yii::app()->session['school_id'];?>" />
  246. <input type="hidden" name="className" id="className" value="<?php echo $className;?>" />
  247. <?php }?>
  248. </div>
  249. <!-- PAGE CONTENT ENDS -->
  250. </div>
  251. </div>
  252. <?php if(!empty($pages)):?>
  253. <div class="row">
  254. <div class="col-xs-6">
  255. &nbsp;
  256. </div>
  257. <div class="col-xs-6">
  258. <div class="dataTables_paginate paging_simple_numbers">
  259. <?php
  260. $this->widget('CLinkPager', array(
  261. 'header' => '',
  262. 'firstPageLabel'=> '首页',
  263. 'lastPageLabel' => '末页',
  264. 'prevPageLabel' => '上一页',
  265. 'nextPageLabel' => '下一页',
  266. 'pages' => $pages,
  267. 'maxButtonCount'=> 5,
  268. ));
  269. echo '共:'.$rowsCount.'条';
  270. ?>
  271. </div>
  272. </div>
  273. </div>
  274. <?php endif;?>
  275. </div>
  276. </div>
  277. <script type="text/javascript">
  278. $(document).ready(function(){
  279. /*var str = '<div class="points"></div>';
  280. $(".sc-lis").each(function(){
  281. if($(this).find(".points").length>0){
  282. $(".sel-opt").append(str);
  283. }
  284. });*/
  285. $(".sel-opt,.sel-cons").mouseover(function(){
  286. $(".sel-cons").show();
  287. }).mouseout(function(){
  288. $(".sel-cons").hide();
  289. });
  290. $(".sc-lis").click(function(){
  291. var data = {
  292. subjectId : $(this).attr('val')
  293. };
  294. $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>",data,function(flags){
  295. if(flags)
  296. {
  297. location.reload();
  298. }else
  299. {
  300. alert('网络异常');
  301. }
  302. });
  303. $('.has-sel').text($(this).text());
  304. $(".sel-cons").hide();
  305. });
  306. })
  307. function ccc(){
  308. layer.msg('敬请期待!', {
  309. time: 0,
  310. btn: ['确定', '取消'],
  311. yes: function(index){
  312. layer.close(index);
  313. return false;
  314. }
  315. });
  316. }
  317. $(function(){
  318. // 全选\反选
  319. $("#selectSheet").click(function(){
  320. var sheet_id = $("input[name=sheet_id]:checked").val();
  321. if(sheet_id)
  322. {
  323. data={
  324. sheet_id:sheet_id,
  325. exam_id:$("input[name=exam_id]").val()
  326. };
  327. $.post("<?php echo Yii::app()->createUrl('third/binding')?>",data,function(rs){
  328. var m =JSON.parse(rs);
  329. if(m.status==0)
  330. {
  331. layer.msg('绑定失败',{
  332. icon: 5
  333. }, function(){
  334. layer.closeAll();
  335. location.reload();
  336. });
  337. }
  338. if(m.status==1)
  339. {
  340. layer.msg('绑定成功',{
  341. icon: 1
  342. }, function(){
  343. layer.closeAll();
  344. location.href="<?php echo Yii::app()->createUrl('third/index')?>";
  345. });
  346. }
  347. if(m.status==-4)
  348. {
  349. layer.msg('答题卡与试卷不匹配',{
  350. icon: 5
  351. }, function(){
  352. layer.closeAll();
  353. location.reload();
  354. });
  355. }
  356. if(m.status==-6)
  357. {
  358. layer.msg('答题卡分数与出卷分数不匹配',{
  359. icon: 5
  360. }, function(){
  361. layer.closeAll();
  362. location.reload();
  363. });
  364. }
  365. if(m.status==-7)
  366. {
  367. layer.msg('答题卡分数未上传',{
  368. icon: 5
  369. }, function(){
  370. layer.closeAll();
  371. location.reload();
  372. });
  373. }
  374. if(m.status==-1)
  375. {
  376. layer.msg('未上传答题卡',{
  377. icon: 5
  378. }, function(){
  379. layer.closeAll();
  380. location.reload();
  381. });
  382. }
  383. if(m.status==-8)
  384. {
  385. layer.msg('试卷尚未上传题',{
  386. icon: 5
  387. }, function(){
  388. layer.closeAll();
  389. location.reload();
  390. });
  391. }
  392. if(m.status==-2||m.status==-3)
  393. {
  394. layer.msg('试卷已绑定',{
  395. icon: 5
  396. }, function(){
  397. layer.closeAll();
  398. location.reload();
  399. });
  400. }
  401. });
  402. }else{
  403. alert('请选择答题卡');
  404. }
  405. });
  406. $("#addSheet").click(function(){
  407. evaluationClient.createAnswerSheet(0);
  408. });
  409. $(".update").click(function(){
  410. var sheet_id = $(this).attr('sheet_id');
  411. if(sheet_id)
  412. {
  413. evaluationClient.createAnswerSheet(sheet_id);
  414. }else
  415. {
  416. alert('无法编辑');
  417. }
  418. });
  419. $(".delClass").click(function(){
  420. var sheet_id = $(this).attr('sheet_id');
  421. var msg = '您确定要删除答题卡吗?';
  422. layer.msg(msg, {
  423. time: 0,
  424. btn: ['确定', '取消'],
  425. yes: function(index){
  426. layer.close(index);
  427. $.ajax({
  428. url: "<?php echo Yii::app()->createUrl('third/del')?>",
  429. type: "POST",
  430. dataType: "json",
  431. data: {
  432. sheet_id: sheet_id
  433. },
  434. success: function (data){
  435. if(data.status == 1){
  436. layer.msg('删除成功',{
  437. icon: 1
  438. }, function(){
  439. layer.closeAll();
  440. location.reload();
  441. });
  442. }else{
  443. layer.msg('删除失败',{
  444. icon: 5
  445. }, function(){
  446. layer.closeAll();
  447. location.reload();
  448. });
  449. }
  450. },
  451. error: function (data, status, e){ //服务器响应失败处理函数
  452. layer.msg('返回失败!',{
  453. icon: 1
  454. }, function(){
  455. layer.closeAll();
  456. });
  457. }
  458. });
  459. }
  460. });
  461. });
  462. })
  463. </script>