exam_answer.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. .click-sc:focus {
  82. color: #fff;
  83. }
  84. .click-sc:hover {
  85. color: #fff;
  86. }
  87. .table-select{text-align: center;}
  88. .table-select .circle{display: inline-block;width: 30px;height: 30px;border: 1px solid #e4e4e4;border-radius: 50%;margin: 6px;background: #e4e4e4;}
  89. .circle.select{background: #9966FF;}
  90. </style>
  91. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
  92. <div class="main-content-inner">
  93. <ul class="clearfix main-content-inner-ul">
  94. <?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)){?>
  95. <li class="pull-left">
  96. <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>
  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'=>'wtb'));?>"' 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/sub_index",array('type'=>'isp'));?>"' 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("print/sub_index",array('type'=>'studytrend'));?>"' class="button button_normal button_group button_arrow " 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("print/student_product");?>"' 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("third/index");?>"' class="button button_normal button_group button_arrow button_active" 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("export/index");?>"' class="button button_normal button_group button_arrow " data-button="red">导出报告</button>
  121. <img src="/images/line.jpg" style="height:45px;" />
  122. </li>
  123. <li class="pull-left">
  124. <button onclick='location.href="<?php echo $this->createUrl("upload/index");?>"' class="button button_normal button_group button_arrow" data-button="red">上传试卷</button>
  125. <img src="/images/line.jpg" style="height:45px;" />
  126. </li>
  127. <?php if(isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)){
  128. ?>
  129. <li class="pull-left">
  130. <button onclick='location.href="<?php echo $this->createUrl("print/restore");?>"' class="button button_normal button_group button_arrow" data-button="red">还原考试</button>
  131. <img src="/images/line.jpg" style="height:45px;" />
  132. </li>
  133. <?php
  134. }?>
  135. <li class="pull-left">
  136. <button onclick='location.href="<?php echo $this->createUrl("record/importscore"); ?>"'
  137. class="button button_normal button_group button_arrow " data-button="red">导入成绩
  138. </button>
  139. <img src="/images/line.jpg" style="height:45px;"/>
  140. </li>
  141. <?php }else{ ?>
  142. <li class="pull-left">
  143. <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>
  144. <img src="/images/line.jpg" style="height:45px;" />
  145. </li>
  146. <li class="pull-left">
  147. <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow " data-button="red">导出报告</button>
  148. <img src="/images/line.jpg" style="height:45px;" />
  149. </li>
  150. <li class="pull-left">
  151. <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>
  152. <img src="/images/line.jpg" style="height:45px;" />
  153. </li>
  154. <?php }?>
  155. <!--<div class="tab-con clearfix pull-right" style="margin:8px 11px 0 0">
  156. <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>
  157. <div class="sel-opt fl">
  158. 切换学科
  159. <?php /*if($subject){*/?>
  160. <div class="points"></div>
  161. <?php /*}*/?>
  162. </div>
  163. <div class="sel-cons" style="z-index:6;background-color: #fff;">
  164. <div class="sc-lis" val="3"><span>数学<?php /*if($subject && isset($subject[3]) && !empty($subject[3])){*/?><div class="points"></div><?php /*}*/?></span></div>
  165. <div class="sc-lis" val="12"><span>物理<?php /*if($subject && isset($subject[12]) && !empty($subject[12])){*/?><div class="points"></div><?php /*}*/?></span></div>
  166. <div class="sc-lis" val="13"><span>化学<?php /*if($subject && isset($subject[13]) && !empty($subject[13])){*/?><div class="points"></div><?php /*}*/?></span></div>
  167. <div class="sc-lis" val="14"><span>生物<?php /*if($subject && isset($subject[14]) && !empty($subject[14])){*/?><div class="points"></div><?php /*}*/?></span></div>
  168. </div>
  169. </div>-->
  170. <li class="pull-left">
  171. <button onclick='location.href="<?php echo $this->createUrl("cylet/index");?>"' class="button button_normal button_group button_arrow" data-button="red">全学科统考</button>
  172. </li>
  173. </ul>
  174. <div class="page-content">
  175. <div class="row" style="margin:0px;">
  176. <div class="col-xs-12">
  177. <!-- PAGE CONTENT BEGINS -->
  178. <form method="post" id="form1" action="<?php echo $this->createUrl("third/save_answer");?>">
  179. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  180. <div class="row">
  181. <div class="col-xs-8" style="font-weight:bold;padding:0px 15px;margin: 30px 0 0 0 ; ">
  182. <?php echo $exam_data->name;?>
  183. </div>
  184. <div class="col-xs-3" style="float: left;">
  185. <div class="dataTables_filter" id="dynamic-table_filter" style="padding-top:15px;text-align: right;">
  186. <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="saveAnswer">
  187. <i style="font-style: normal;" ></i>确定
  188. </a>
  189. </div>
  190. </div>
  191. </div>
  192. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable table-select" style="font-size:12px">
  193. <thead>
  194. <tr>
  195. <th>题号</th>
  196. <th >A</th>
  197. <th>B</th>
  198. <th >C</th>
  199. <th >D</th>
  200. <th >分数</th>
  201. </tr>
  202. </thead>
  203. <tbody>
  204. <?php if(isset($paper_topic)){
  205. foreach($paper_topic as $v){
  206. ?>
  207. <tr class="single">
  208. <th ><?php echo $v->order?></th>
  209. <td><span class="circle <?php if(isset($exam_answer_data[$v->order]) && !empty($exam_answer_data[$v->order])){
  210. if($exam_answer_data[$v->order] == 'A'){echo 'select';}
  211. }?>" answer = "A"></span></td>
  212. <td><span class="circle <?php if(isset($exam_answer_data[$v->order]) && !empty($exam_answer_data[$v->order])){
  213. if($exam_answer_data[$v->order] == 'B'){echo 'select';}
  214. }?>" answer = "B"></span></td>
  215. <td><span class="circle <?php if(isset($exam_answer_data[$v->order]) && !empty($exam_answer_data[$v->order])){
  216. if($exam_answer_data[$v->order] == 'C'){echo 'select';}
  217. }?>" answer = "C"></span></td>
  218. <td><span class="circle <?php if(isset($exam_answer_data[$v->order]) && !empty($exam_answer_data[$v->order])){
  219. if($exam_answer_data[$v->order] == 'D'){echo 'select';}
  220. }?>" answer = "D"></span></td>
  221. <th><?php echo $v->score?>分</th>
  222. <input type="hidden" name="answer[]" value="<?php if(isset($exam_answer_data[$v->order]) && !empty($exam_answer_data[$v->order])){
  223. echo $exam_answer_data[$v->order];
  224. }?>">
  225. </tr>
  226. <?php }}?>
  227. </tbody>
  228. </table>
  229. </div>
  230. <input type="hidden" name="exam_group_id" value="<?php echo $exam_group_id?>">
  231. <input type="hidden" name="paper_id" value="<?php echo $paper_data->paper_id?>">
  232. </form>
  233. <!--上传模板弹窗-->
  234. <!-- PAGE CONTENT ENDS -->
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. <script>
  240. $(document).ready(function(){
  241. $('.circle').click(function(){
  242. $(this).addClass('select').parent().siblings().find('.circle').removeClass('select');
  243. var answer = $(this).attr("answer");
  244. $(this).closest('.single').find('input').val(answer);
  245. })
  246. $('#saveAnswer').click(function(){
  247. alert($("input[name=answer]").val());return;
  248. $('form').submit();
  249. });
  250. });
  251. </script>