operate.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>试题编辑</title>
  6. <link rel="stylesheet" type="text/css" href="/css/base.css">
  7. <!-- bootstrap & fontawesome -->
  8. <link rel="stylesheet" href="/css/bootstrap.min.css" />
  9. <link rel="stylesheet" href="/css/font-awesome/4.2.0/css/font-awesome.min.css" />
  10. <!-- page specific plugin styles -->
  11. <!-- text fonts -->
  12. <link rel="stylesheet" href="/css/fonts/fonts.googleapis.com.css" />
  13. <!-- ace styles -->
  14. <link rel="stylesheet" href="/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />
  15. <link rel="stylesheet" href="/css/style.css" />
  16. <script type="text/javascript" src="/js/jquery.min.js"></script>
  17. <script src="/js/layer/layer.js"></script>
  18. <style>
  19. .header-top{
  20. font-size:16px;
  21. height:30px;
  22. line-height: 30px;
  23. padding:15px;
  24. }
  25. .operate-menu{margin:15px 0;}
  26. .operate-menu li{
  27. width:90px;
  28. font-weight: bold;
  29. font-size:14px;
  30. float:left;
  31. padding:5px 15px;
  32. }
  33. .topic-list{
  34. clear: both;
  35. padding:15px;
  36. width: 90%;
  37. }
  38. .hide{display: none;}
  39. .show{display: block}
  40. .menu-active{color:#2977ff}
  41. .answer-list,.rule-list{
  42. width:35px;
  43. height:30px;
  44. line-height: 30px;
  45. background:#fff;
  46. color:#555;
  47. border:1px solid #555;
  48. display: inline-block;
  49. text-align: center;
  50. margin:3px;
  51. cursor: pointer;
  52. }
  53. .rule-list{
  54. width:70px;
  55. }
  56. .answer-active,.rule-active{
  57. background:#2977ff;
  58. color:#fff;
  59. }
  60. .topic-operate{float: right;width:300px;margin-right: 20px;}
  61. .confirmbox-mask {
  62. background: rgba(0, 0, 0, .7);
  63. left: 0;
  64. right: 0;
  65. top: 0;
  66. bottom: 0;
  67. z-index: 99;
  68. position: fixed;
  69. }
  70. button {
  71. border: none;
  72. background: #2977ff;
  73. width: 80px;
  74. height: 26px;
  75. border-radius: 3px;
  76. font-size: 14px;
  77. color: #fff;
  78. outline: none;
  79. cursor: pointer;
  80. }
  81. button.save {
  82. display: block;
  83. margin: 40px auto;
  84. }
  85. .confirmbox .confirmbox-btns {
  86. margin-top: 40px;
  87. }
  88. .class-modal {
  89. width: 500px;
  90. min-height: 400px;
  91. background: #fff;
  92. // border-radius: 5px;
  93. position: absolute;
  94. top: 50%;
  95. left: 50%;
  96. transform: translate(-50%, -50%);
  97. }
  98. .class-modal-head {
  99. font-size: 14px;
  100. background:#2977ff;
  101. color:#fff;
  102. height:35px;
  103. line-height: 35px;
  104. padding: 0 0 0 15px;
  105. }
  106. .class-modal-body {
  107. margin-top: 20px;
  108. max-height: 300px;
  109. overflow: auto;
  110. margin-left:50px;
  111. }
  112. .class-modal-body .classes {
  113. margin-bottom: 20px;
  114. }
  115. .class-modal-body .classes > div {
  116. display: inline-block;
  117. max-width: 640px;
  118. vertical-align: top;
  119. }
  120. .class-modal-body .classes a {
  121. text-decoration: none;
  122. display: inline-block;
  123. margin: 0 5px 5px;
  124. color: #136bfb;
  125. font-size: 14px;
  126. }
  127. .class-modal-body .classes a.active {
  128. color: #fc091b
  129. }
  130. .class-modal .icon-close{
  131. position: absolute;
  132. right: 20px;
  133. top: 2px;
  134. color:#fff;
  135. }
  136. .c-red {
  137. color: #CC3300
  138. }
  139. .avg{
  140. margin:0 10px;
  141. }
  142. .class_btn{
  143. text-align: center;
  144. }
  145. .confirmbox-mask p{
  146. word-wrap : break-word ;
  147. }
  148. .class-modal-body p{margin:10px 0;}
  149. .class-modal-body p span{display: inline-block;width:60px;}
  150. .answerList td{text-align: center;padding:3px 0;border-bottom: 1px dotted #ccc;}
  151. .answerShow{border-collapse:separate;background: #666;width:190px;}
  152. .answerShow td{text-align: center;background:#fff;cursor: pointer}
  153. .answerShow td.active{background:#50d2c2;color:#000}
  154. .answerShow td.active_gray{background:#ccc;color:#fff}
  155. .new_half_score{width:50px;}
  156. .icon-close{cursor:pointer;font-size:20px;line-height: 35px;}
  157. .class_btn{position: fixed;bottom: 2%;text-align: center;width:500px;}
  158. .red-tig{color:red;}
  159. .topic a.c-red{ color: #CC3300}
  160. .fr{margin-right:10px;}
  161. .rule-why{
  162. width:15px;height:15px;display: inline-block;border-radius: 10px;border:1px solid #ccc;line-height: 15px;font-size:10px;margin-top:5px;padding-bottom:5px;
  163. }
  164. </style>
  165. </head>
  166. <body>
  167. <div class="header-top">
  168. <a href="#" onclick="javascript:history.go(-1)" class="">返回</a>
  169. <?php echo $exam_name;?>
  170. <input type="hidden" name="exam_id" value="<?php echo $exam_id?>">
  171. <input type="hidden" name="paper_id" value="<?php echo $paper_id?>">
  172. </div>
  173. <div>
  174. <div>
  175. <ul class="operate-menu">
  176. <?php foreach ($menu as $k =>$v):?>
  177. <li class="topic-menu" id="<?php echo $k; ?>"><?php echo $v;?></li>
  178. <?php endforeach;?>
  179. </ul>
  180. <div class="topic-operate">
  181. <button class="label-primary-s bth-s topic-edit">编辑</button>
  182. <button class="label-primary-s bth-s topic-edit-cancel " style="display: none">取消</button>
  183. <button class="label-primary-s bth-s topic-edit-save " style="display: none">保存</button>
  184. <?php if( isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)) {?>
  185. <button class="label-primary-s bth-s topic-send-point" style="display: ">特殊分值设置</button>
  186. <?php }?>
  187. <input type="hidden" name="select-tab" value="0">
  188. </div>
  189. </div>
  190. <?php
  191. $multipleKongAlias=array('①','②','③','④','⑤','⑥','⑦','⑧','⑨','⑩');
  192. $multipleWenAlias=array('(1)','(2)','(3)','(4)','(5)','(6)','(7)','(8)','(9)','(10)');
  193. if(isset($topic[1])):?>
  194. <div class="topic-list list-type-1 hide">
  195. <p class="red">提示:客观题特殊分值设置请在学生答卷全部上传完后联系技术支持设置,设置后无法撤销且不可再更改分值或答案,请谨慎操作!</p>
  196. <table class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  197. <tr>
  198. <th>题号</th>
  199. <th>答案</th>
  200. <th>初始答案</th>
  201. <th>分值</th>
  202. <th class="send-control" style="display: none">特殊分值设置</th>
  203. </tr>
  204. <?php
  205. foreach ($topic[1] as $item){
  206. $sendPointArr=array();
  207. $sendPointArr[1]='';
  208. $sendPointArr[2]='';
  209. $isSend=0;
  210. if(isset($item['send_points_type'])){
  211. if($item['send_points_type']==1){
  212. $sendPointArr[1]='fr c-red';
  213. $sendPointArr[2]='fr ';
  214. $isSend=1;
  215. }elseif($item['send_points_type']==2){
  216. $sendPointArr[2]='fr c-red';
  217. $sendPointArr[1]='fr ';
  218. $isSend=1;
  219. }elseif ($item['send_points_type']==3){
  220. $sendPointArr[1]='fr c-red';
  221. $sendPointArr[2]='fr ';
  222. $isSend=1;
  223. }
  224. }else{
  225. $sendPointArr[1]='fr sendPoints';
  226. $sendPointArr[2]='fr sendPoints';
  227. }
  228. ?>
  229. <tr class="operate-tr">
  230. <td><?php echo $item['alias']?></td>
  231. <td>
  232. <?php
  233. if(isset($item['update_answer']) && $item['update_answer']){
  234. $rightAnswer=$item['update_answer'];
  235. }else{
  236. $rightAnswer=$item['answer'];
  237. }
  238. for($i=1;$i<=$item['option_count'];$i++){
  239. $answer=numToLetter($i);
  240. if($answer==$rightAnswer){
  241. echo '<span class="answer-list answer-active">'.numToLetter($i).'</span>';
  242. }else{
  243. echo '<span class="answer-list">'.numToLetter($i).'</span>';
  244. }
  245. }
  246. ?>
  247. </td>
  248. <td><?php echo $item['answer']?></td>
  249. <td>
  250. <input type="text" disabled old-score="<?php echo $item['score']?>" value="<?php echo $item['score']?>" class="topic-score" issend="<?php echo $isSend?>">
  251. <input type="hidden" name="old-answer" value="<?php echo $rightAnswer?>">
  252. <input type="hidden" name="new-answer" class="new-answer" value="">
  253. <input type="hidden" name="topic-id" class="topic-id" value="<?php echo $item['id']?>">
  254. </td>
  255. <td class="send-control" style="display:none ">
  256. <a href="javascript:;" option_count="<?php echo $item['option_count'] ?>" topic_id="<?php echo $item['id']?>" paper_id="<?php echo $paper_id?>" class="<?php echo $sendPointArr[1]?>" action_type="1" type="1" >送分题</a>
  257. <a href="javascript:;" topic_id="<?php echo $item['id']?>" paper_id="<?php echo $paper_id?>" class="<?php echo $sendPointArr[2]?>" action_type="2" type="1" >0分题</a>
  258. </td>
  259. </tr>
  260. <?php
  261. }
  262. ?>
  263. </table>
  264. </div>
  265. <?php endif;?>
  266. <?php if(isset($topic[2])):?>
  267. <div class="topic-list list-type-2 hide">
  268. <table class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  269. <tr>
  270. <th>题号</th>
  271. <th>答案</th>
  272. <th>初始答案</th>
  273. <th>满分</th>
  274. <th>半对分</th>
  275. <th>判分规则</th>
  276. </tr>
  277. <?php
  278. foreach ($topic[2] as $item){
  279. ?>
  280. <tr class="operate-tr">
  281. <td><?php echo $item['alias']?></td>
  282. <td>
  283. <?php
  284. if(isset($item['rule_answer']) && $item['rule_answer']){
  285. $rightAnswer=explode(',',$item['rule_answer']);
  286. }else{
  287. $rightAnswer=explode(',',$item['answer']);
  288. }
  289. for($i=1;$i<=$item['option_count'];$i++){
  290. $answer=numToLetter($i);
  291. if(in_array($answer,$rightAnswer)){
  292. echo '<span class="answer-list answer-active answer-multi">'.numToLetter($i).'</span>';
  293. }else{
  294. echo '<span class="answer-list answer-multi">'.numToLetter($i).'</span>';
  295. }
  296. }
  297. ?>
  298. </td>
  299. <td><?php echo $item['answer']?></td>
  300. <td>
  301. <?php
  302. $score=$item['score'];
  303. $halfScore=0;
  304. if(isset($item['rule_score']) && $item['rule_score']){
  305. $score=$item['rule_score'];
  306. }
  307. if(isset($item['rule_score_half']) && $item['rule_score_half']){
  308. $halfScore=$item['rule_score_half'];
  309. }
  310. ?>
  311. <input type="text" disabled old-score="<?php echo $score?>" value="<?php echo $score ?>" name="topic-score" class="topic-score">
  312. </td>
  313. <td>
  314. <input type="text" disabled old-score="<?php echo $halfScore?>" value="<?php echo $halfScore ?>" name="topic-half-score" class="topic-score">
  315. </td>
  316. <td>
  317. <?php
  318. $rule=2;
  319. if(isset($item['rule_type']) && $item['rule_type']){
  320. $rule= $item['rule_type'];
  321. }
  322. ?>
  323. <span class="rule-list <?php if($rule==1) echo 'rule-active' ?>" rule="1" title="全选对为全对;错选漏选为0分">规则A <span class="rule-why">?</span></span>
  324. <span class="rule-list <?php if($rule==2) echo 'rule-active' ?>" rule="2" title="全选对为全对;错选为0分;没有全部选对且没有错选为半对">规则B <span class="rule-why">?</span></span>
  325. <span class="rule-list <?php if($rule==3) echo 'rule-active' ?>" rule="3" title="全选对为全对;答案数量不超过正确答案数量情况下,部分选对为半对;答案数量超过正确答案数量或全选错为0分">规则C <span class="rule-why">?</span></span>
  326. <?php if($subject_id==9){?>
  327. <span class="rule-list <?php if($rule==4) echo 'rule-active' ?>" rule="4" title="全选对为全对;答对一个1分;答对两个2分;错选0分。">规则D <span class="rule-why">?</span></span>
  328. <span class="rule-list <?php if($rule==5) echo 'rule-active' ?>" rule="5" title="全选对为全对;答对一个1分;答对两个2分;错选不扣分但全选错0分;超出答案个数0分。">规则E <span class="rule-why">?</span></span>
  329. <?php }?>
  330. <input type="hidden" name="topic-id" class="topic-id" value="<?php echo $item['id']?>">
  331. <input type="hidden" name="old-rule" class="old-rule" value="<?php echo $rule?>">
  332. <input type="hidden" name="old-answer" class="old-answer" value="<?php echo implode(',',$rightAnswer)?>">
  333. <input type="hidden" name="new-answer" class="new-answer" value="<?php echo implode(',',$rightAnswer)?>">
  334. </td>
  335. </tr>
  336. <?php
  337. }
  338. ?>
  339. </table>
  340. </div>
  341. <?php endif;?>
  342. <?php if(isset($topic[3])):?>
  343. <div class="topic-list list-type-3 hide">
  344. <table class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  345. <tr>
  346. <th>题号</th>
  347. <th>答案</th>
  348. <th>初始答案</th>
  349. <th>分值</th>
  350. </tr>
  351. <?php
  352. foreach ($topic[3] as $item){
  353. if($subject_id==8){
  354. $T='T';
  355. $F='F';
  356. }else{
  357. $T='√';
  358. $F='×';
  359. }
  360. if(isset($item['update_answer']) && $item['update_answer']){
  361. $rightAnswer=$item['update_answer'];
  362. }else{
  363. $rightAnswer=$item['answer'];
  364. }
  365. ?>
  366. <tr class="operate-tr">
  367. <td><?php echo $item['alias']?></td>
  368. <td>
  369. <span class="answer-list <?php if($rightAnswer=='T' || $rightAnswer=='√') echo 'answer-active'?>"><?php echo $T;?></span>
  370. <span class="answer-list <?php if($rightAnswer=='F' || $rightAnswer=='×') echo 'answer-active'?>"><?php echo $F;?></span>
  371. </td>
  372. <td><?php if($item['answer']=='T' || $rightAnswer=='√'){echo $T;}else{ echo $F;}?></td>
  373. <td>
  374. <input type="text" disabled old-score="<?php echo $item['score']?>" value="<?php echo $item['score']?>" class="topic-score">
  375. <input type="hidden" name="old-answer" value="<?php echo $item['answer']?>">
  376. <input type="hidden" name="new-answer" class="new-answer" value="">
  377. <input type="hidden" name="topic-id" class="topic-id" value="<?php echo $item['id']?>">
  378. </td>
  379. </tr>
  380. <?php
  381. }
  382. ?>
  383. </table>
  384. </div>
  385. <?php endif;?>
  386. <?php if(isset($topic[5])):?>
  387. <div class="topic-list list-type-5 hide">
  388. <!-- <p class="red">提示:主观题分值更改请联系技术支持!</p>-->
  389. <table class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  390. <tr>
  391. <th>题号</th>
  392. <th>分值</th>
  393. </tr>
  394. <?php
  395. foreach ($topic[5] as $item){
  396. if(isset($multiple_blank[(string)$item['id']])){
  397. foreach ($multiple_blank[(string)$item['id']] as $k =>$v){
  398. if(isset($scores_type[(string)$item['id']]) && $scores_type[(string)$item['id']]==2){
  399. $signAlias=$multipleKongAlias[$k];
  400. }else{
  401. $signAlias=$multipleWenAlias[$k];
  402. }
  403. ?>
  404. <tr class="operate-tr">
  405. <td><?php echo $item['alias'].$signAlias?></td>
  406. <td>
  407. <input type="text" disabled topic-id="<?php echo $item['id']?>" order="<?php echo $item['order']?>" old-score="<?php echo $v?>" value="<?php echo $v?>" class="topic-score multiple multiple-<?php echo $item['id']?>">
  408. <input type="hidden" name="topic-id" class="topic-id" value="<?php echo $item['id']?>">
  409. </td>
  410. </tr>
  411. <?php
  412. }
  413. }else{
  414. ?>
  415. <tr class="operate-tr">
  416. <td><?php echo $item['alias']?></td>
  417. <td>
  418. <input type="text" disabled order="<?php echo $item['order']?>" old-score="<?php echo $item['score']?>" value="<?php echo $item['score']?>" class="topic-score">
  419. <input type="hidden" name="topic-id" class="topic-id" value="<?php echo $item['id']?>">
  420. </td>
  421. </tr>
  422. <?php
  423. }
  424. ?>
  425. <?php
  426. }
  427. ?>
  428. </table>
  429. </div>
  430. <?php endif;?>
  431. <?php if(isset($topic[7])):?>
  432. <div class="topic-list list-type-7 hide">
  433. <!--<p class="red">提示:主观题分值更改请联系技术支持!</p>-->
  434. <table class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  435. <tr>
  436. <th>题号</th>
  437. <th>分值</th>
  438. </tr>
  439. <?php
  440. foreach ($topic[7] as $item){
  441. if(isset($multiple_blank[(string)$item['id']])){
  442. foreach ($multiple_blank[(string)$item['id']] as $k =>$v){
  443. if(isset($scores_type[(string)$item['id']]) && $scores_type[(string)$item['id']]==2){
  444. $signAlias=$multipleKongAlias[$k];
  445. }else{
  446. $signAlias=$multipleWenAlias[$k];
  447. }
  448. ?>
  449. <tr class="operate-tr">
  450. <td><?php echo $item['alias'].$signAlias?></td>
  451. <td>
  452. <input type="text" disabled topic-id="<?php echo $item['id']?>" order="<?php echo $item['order']?>" old-score="<?php echo $v?>" value="<?php echo $v?>" class="topic-score multiple multiple-<?php echo $item['id']?>">
  453. <input type="hidden" name="topic-id" class="topic-id" value="<?php echo $item['id']?>">
  454. </td>
  455. </tr>
  456. <?php
  457. }
  458. }else {
  459. ?>
  460. <tr class="operate-tr">
  461. <td><?php echo $item['alias'] ?></td>
  462. <td>
  463. <input type="text" disabled order="<?php echo $item['order'] ?>"
  464. old-score="<?php echo $item['score'] ?>" value="<?php echo $item['score'] ?>"
  465. class="topic-score">
  466. <input type="hidden" name="topic-id" class="topic-id" value="<?php echo $item['id'] ?>">
  467. </td>
  468. </tr>
  469. <?php
  470. }
  471. }
  472. ?>
  473. </table>
  474. </div>
  475. <?php endif;?>
  476. <?php if(isset($topic[17])):?>
  477. <div class="topic-list list-type-17 hide">
  478. <!--<p class="red">提示:主观题分值更改请联系技术支持!</p>-->
  479. <table class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  480. <tr>
  481. <th>题号</th>
  482. <th>分值</th>
  483. </tr>
  484. <?php
  485. foreach ($topic[17] as $item){
  486. ?>
  487. <tr class="operate-tr">
  488. <td><?php echo $item['alias']?></td>
  489. <td>
  490. <input type="text" disabled order="<?php echo $item['order']?>" old-score="<?php echo $item['score']?>" value="<?php echo $item['score']?>" class="topic-score">
  491. <input type="hidden" name="topic-id" class="topic-id" value="<?php echo $item['id']?>">
  492. </td>
  493. </tr>
  494. <?php
  495. }
  496. ?>
  497. </table>
  498. </div>
  499. <?php endif;?>
  500. </div>
  501. <!--送分题选择答案弹窗-->
  502. <div class="confirmbox-mask" style="display: none" id="sendScore">
  503. <div class="class-modal">
  504. <i class="icon icon-close">×</i>
  505. <div class="class-modal-head">设置送分题</div>
  506. <div class="class-modal-body">
  507. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="answerList">
  508. <thead>
  509. <tr>
  510. <td colspan="4">请选择需要送分的选项,学生选择以下任意选项均得分</td>
  511. </tr>
  512. </thead>
  513. <tbody>
  514. <tr>
  515. <td >
  516. <table width="100%" border="0" cellspacing="1" cellpadding="1" class="answerShow" align="center" id="sendPointAnswer">
  517. <tr>
  518. <td class="answer_3">A</td>
  519. <td class="answer_3">B</td>
  520. <td class="answer_3">C</td>
  521. <td class="answer_3">D</td>
  522. </tr>
  523. </table>
  524. </td>
  525. </tr>
  526. <tr>
  527. <td >注意:一旦设置,不可取消,且不能再修改试题分值与答案,请谨慎操作!</td>
  528. </tr>
  529. </tbody>
  530. </table>
  531. </div>
  532. <div class="class_btn">
  533. <button type="button" class="saveSendScoreBtn">确定</button>
  534. <input type="hidden" name="sendScoreAnswer" value="">
  535. <input type="hidden" name="paperId" value="">
  536. <input type="hidden" name="topicId" value="">
  537. </div>
  538. </div>
  539. </div>
  540. <?php require_once "_operate.php" ?>
  541. </body>
  542. </html>