modify_exam.php 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. <script src="/js/jquery.datetimepicker.js"></script>
  2. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
  3. <link rel="stylesheet" href="/css/modelCreatePaper.css" />
  4. <link rel="stylesheet" href="/css/jquery.datetimepicker.css" />
  5. <link rel="stylesheet" type="text/css" href="/css/update-exam/base.css">
  6. <link rel="stylesheet" type="text/css" href="/css/update-exam/open.css">
  7. <link rel="stylesheet" type="text/css" href="/css/update-exam/selPaperPop.css">
  8. <div class="main-content-inner">
  9. <!-- 导航栏开始-->
  10. <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
  11. <!-- 导航栏结束-->
  12. <style>
  13. body{
  14. overflow:initial;
  15. }
  16. .range-select ul {
  17. position: relative;
  18. font-size: 0;
  19. border: 1px solid #BBBBBB;
  20. margin-right: 24px;
  21. }
  22. .range-select ul li {
  23. text-align: center;
  24. display: inline-block;
  25. font-size: 14px;
  26. width: 25px;
  27. height: 24px;
  28. line-height: 24px;
  29. border-right: 1px solid #BBBBBB;
  30. }
  31. .decade-con:after, .decade-con-inp:after {
  32. content: '十位';
  33. position: absolute;
  34. left: 50%;
  35. top: 30px;
  36. width: 60px;
  37. font-size: 12px;
  38. transform: translateX(-50%);
  39. text-align: center;
  40. }
  41. </style>
  42. <div class="page-content">
  43. <div class="mcp-title">基本信息</div>
  44. <form class="saveForm" action="<?php echo Yii::app()->createUrl('print/modifyThirdExam')?>" method="post" enctype="multipart/form-data">
  45. <div class="mcp-main-con">
  46. <div class="mcp-form-list clearfix">
  47. <div class="mcp-form-menu fl">试卷名称</div>
  48. <div class="mcp-form-detail fl"><input type="text" placeholder="必填" class="test-paper-name" name="examName" value='<?php echo $name?>'></div>
  49. <div id="examName-error"></div>
  50. </div>
  51. <div class="mcp-form-list clearfix">
  52. <div class="mcp-form-menu fl">选择考试类型</div>
  53. <div class="mcp-form-detail fl clearfix">
  54. <div class="mcp-radio-sel fl <?php if($examStatus==2){echo 'disabled';}?>">
  55. <span class="sel-btn <?php if($type==1) echo 'select';?> examType" value="1"></span>
  56. <span>周考</span>
  57. </div>
  58. <div class="mcp-radio-sel fl <?php if($examStatus==2){echo 'disabled';}?>">
  59. <span class="sel-btn <?php if($type==2) echo 'select';?> examType" value="2"></span>
  60. <span>单元考</span>
  61. </div>
  62. <div class="mcp-radio-sel fl <?php if($examStatus==2){echo 'disabled';}?>">
  63. <span class="sel-btn <?php if($type==3) echo 'select';?> examType" value="3"></span>
  64. <span>月考</span>
  65. </div>
  66. <div class="mcp-radio-sel fl <?php if($examStatus==2){echo 'disabled';}?>">
  67. <span class="sel-btn <?php if($type==4) echo 'select';?> examType" value="4"></span>
  68. <span>联考</span>
  69. </div>
  70. <div class="mcp-radio-sel fl <?php if($examStatus==2){echo 'disabled';}?>">
  71. <span class="sel-btn <?php if($type==5) echo 'select';?> examType" value="5"></span>
  72. <span>期中考试</span>
  73. </div>
  74. <div class="mcp-radio-sel fl <?php if($examStatus==2){echo 'disabled';}?>">
  75. <span class="sel-btn <?php if($type==6) echo 'select';?> examType" value="6"></span>
  76. <span>期末考试</span>
  77. </div>
  78. <div class="mcp-radio-sel fl <?php if($examStatus==2){echo 'disabled';}?>">
  79. <span class="sel-btn <?php if($type==7) echo 'select';?> examType" value="7"></span>
  80. <span>模拟考</span>
  81. </div>
  82. <div class="mcp-radio-sel fl <?php if($examStatus==2){echo 'disabled';}?>">
  83. <span class="sel-btn <?php if($type==8) echo 'select';?> examType" value="8"></span>
  84. <span>冲刺考</span>
  85. </div>
  86. <div class="clear"></div>
  87. <div class="mcp-radio-sel fl <?php if($examStatus==2){echo 'disabled';}?>">
  88. <span class="sel-btn <?php if($type==9) echo 'select';?> examType" value="9"></span>
  89. <span>测验(适用于非正式考试)</span>
  90. </div>
  91. </div>
  92. <div id="type-error"></div>
  93. </div>
  94. <?php if(!$qxkPaperId):?>
  95. <div class="mcp-form-list clearfix">
  96. <div class="mcp-form-menu fl">&nbsp; </div>
  97. <div class="mcp-form-detail fl clearfix <?php if($examStatus==2){echo 'disabled';}?>">
  98. <?php
  99. if($is_custom_tpl==0){
  100. echo '(当前考试为固定模板,不可修改试卷和答题卡)';
  101. }else{
  102. ?>
  103. <div class="mcp-radio-sel fl">
  104. <span >打印方式:</span>
  105. <span class="show_msg_1">
  106. <?php
  107. if($paper_tpl_type==1){
  108. echo '题卡合一';
  109. }else{
  110. echo '题卡分离';
  111. }
  112. ?>
  113. </span>
  114. </div>
  115. <div class="mcp-radio-sel paper_type_set fl <?php if($paper_tpl_type==1) echo 'hide'?>">
  116. <span >试卷纸张:</span>
  117. <span class="show_msg_2">
  118. <?php
  119. if($paper==0){
  120. echo 'A4';
  121. }else{
  122. echo 'A3';
  123. }
  124. ?>
  125. </span>
  126. </div>
  127. <div class="mcp-radio-sel fl">
  128. <span >答题卡纸张:</span>
  129. <span class="show_msg_3">
  130. <?php
  131. echo $dtk;
  132. ?>
  133. </span>
  134. </div>
  135. <div class="clear"></div>
  136. <?php if($createType==1):?>
  137. <div class="mcp-radio-sel fl">
  138. <span >填空题分值格式:</span>
  139. <span class="show_msg_4">
  140. <?php
  141. switch ($tianType){
  142. case 1:
  143. echo '自定义分值';
  144. break;
  145. case 2:
  146. echo '2/3/5分';
  147. break;
  148. case 3:
  149. echo '2/3/4/6分';
  150. break;
  151. case 4:
  152. echo '2/4分';
  153. break;
  154. default:
  155. echo '';
  156. }
  157. ?>
  158. </span>
  159. </div>
  160. <div class="mcp-radio-sel fl">
  161. <span >解答题分值上限:</span>
  162. <span class="show_msg_5">
  163. <?php
  164. switch ($jieType){
  165. case 1:
  166. echo '15';
  167. break;
  168. case 2:
  169. echo '16';
  170. break;
  171. case 3:
  172. echo '29';
  173. break;
  174. case 4:
  175. echo '49';
  176. break;
  177. default:
  178. echo '';
  179. }
  180. ?>
  181. </span>
  182. </div>
  183. <?php
  184. endif;
  185. }
  186. ?>
  187. <div class="clear"></div>
  188. <div class="mcp-form-detail fl clearfix">
  189. <?php if($is_custom_tpl==1 && $subjectId!=8 && $examStatus<2):?>
  190. <a href="#" class="openDtk">>>>设置模板</a>
  191. <?php endif;?>
  192. </div>
  193. </div>
  194. <div id="type-error"></div>
  195. </div>
  196. <?php endif;?>
  197. <div class="mcp-form-list clearfix">
  198. <div class="mcp-form-menu fl">考试时间</div>
  199. <div class="mcp-form-detail fl clearfix">
  200. <input type="text" class='core datetimepicker8' style="width: 100px;" name="examDate" <?php if($examStatus==2){echo 'disabled';}?> value='<?php echo $examDate?>' />
  201. </div>
  202. <div id="examDate"></div>
  203. </div>
  204. </div>
  205. <input name="examGroupId" value="<?php echo $examGroupId?>" type="hidden"/>
  206. <input name="type" value="<?php echo $type?>" type="hidden"/>
  207. <input name="tianType" value="<?php echo $tianType?>" type="hidden"/>
  208. <input name="jieType" value="<?php echo $jieType?>" type="hidden"/>
  209. <input name="isCustomTpl" value="<?php echo $is_custom_tpl?>" type="hidden"/>
  210. <input name="tplDataPaper" value="<?php echo $paper?>" type="hidden"/>
  211. <input name="printTypeCard" value="<?php echo $paper_tpl_type?>" type="hidden"/>
  212. <input name="dtkType" value="<?php echo $dtkType?>" type="hidden"/>
  213. <p></p>
  214. <p></p>
  215. <p></p>
  216. <div style="min-height: 100px;"></div>
  217. </form>
  218. <!--<button id="createThird">确定</button>-->
  219. <div class="mcp-form-list mcp-fl-btns clearfix" style="float: left;padding-left: 150px;">
  220. <input type="button" value="确定" class="mcp-sure-btn" id="createThird" active="true">
  221. <input type="button" value="返回" class="mcp-back-btn">
  222. </div>
  223. </div>
  224. </div>
  225. <!--修改试卷模板-->
  226. <div class="sel-paper-pop editDtk" style="display: none">
  227. <div class="paper-pop-con">
  228. <div class="paper-pop-top clearfix">
  229. 试卷模板管理<div class="fr pop-close">×</div>
  230. </div>
  231. <div class="paper-pop-main clearfix">
  232. <div class="fl exam-set-detail">
  233. <div class="sel-print-set clearfix">
  234. <div class="set-top-title fl">打印设置</div>
  235. <div class="fl">
  236. <div class="opt-top">
  237. <span class="set-top-opt-name gray-font">打印方式:</span>
  238. <div class="set-top-tab">
  239. <span class="tab-list <?php if($paper_tpl_type==1){echo 'selected';}?>">题卡合一</span>
  240. <span class="tab-list <?php if($paper_tpl_type!=1){echo 'selected';}?>">题卡分离</span>
  241. </div>
  242. </div>
  243. <div class="set-block-opt clearfix">
  244. <div class="print-type-card fl">
  245. <span class="gray-font">答题卡:</span>
  246. <div class="prev-class">
  247. <select name="dtk_type" class="dtk_type">
  248. <option value="0">请选择类型</option>
  249. <option value="1" <?php if(isset($dtk) && $dtk=='A3'){echo 'selected';}?>>A3</option>
  250. <?php if($subjectId!=8):?>
  251. <option value="2" <?php if(isset($dtk) && $dtk=='A4'){echo 'selected';}?>>A4</option>
  252. <option value="3" <?php if(isset($dtk) && $dtk=='8k'){echo 'selected';}?>>8k</option>
  253. <option value="4" <?php if(isset($dtk) && $dtk=='16k'){echo 'selected';}?>>16k</option>
  254. <?php endif;?>
  255. </select>
  256. </div>
  257. </div>
  258. <div class="print-type-card fl <?php if($paper_tpl_type==1) echo 'hide';?>">
  259. <span class="gray-font">试卷:</span>
  260. <div class="prev-class">
  261. <select name="paper_type" class="paper_type">
  262. <option value="0">请选择类型</option>
  263. <option value="2" <?php if($paper==0) echo 'selected';?>>A4</option>
  264. <?php if($subjectId!=8):?>
  265. <option value="1" <?php if($paper!=0) echo 'selected';?>>A3</option>
  266. <?php endif;?>
  267. </select>
  268. </div>
  269. </div>
  270. </div>
  271. <p class="red-font">*选择题上限30道,填空题上限30道,解答题上限5道</p>
  272. </div>
  273. </div>
  274. <div class="sel-print-set clearfix">
  275. <div class="set-top-title fl">填空题设置</div>
  276. <?php if($createType==1):?>
  277. <div class="fl">
  278. <div class="opt-top">
  279. <span class="set-top-opt-name gray-font">分值格式:</span>
  280. <div class="set-top-tab kong-tab-opt">
  281. <span class="tab-list <?php if($tianType==1) echo 'selected';?> ">自定义分值</span>
  282. <span class="tab-list <?php if($tianType==2) echo 'selected';?>">2/3/5分</span>
  283. <span class="tab-list <?php if($tianType==3) echo 'selected';?>">2/3/4/6分</span>
  284. <span class="tab-list <?php if($tianType==4) echo 'selected';?>">2/4分</span>
  285. </div>
  286. </div>
  287. <div class="set-block-opt">
  288. <span class="gray-font">打分框示意图如下:</span>
  289. </div>
  290. <div class="kong-set">
  291. <span class="line-show"></span>
  292. <div class="card-set-score kong-set-score <?php if($tianType!=1) echo 'hide';?>">
  293. <span class="score-msg fir-score-msg"></span>
  294. <a class="red-font">*打√打×即可</a>
  295. </div>
  296. <div class="card-set-score kong-set-score <?php if($tianType!=2) echo 'hide';?>">
  297. <span class="score-msg">2</span>
  298. <span class="score-msg">3</span>
  299. <span class="score-msg">5</span>
  300. </div>
  301. <div class="card-set-score kong-set-score <?php if($tianType!=3) echo 'hide';?>">
  302. <span class="score-msg">2</span>
  303. <span class="score-msg">3</span>
  304. <span class="score-msg">4</span>
  305. <span class="score-msg">6</span>
  306. </div>
  307. <div class="card-set-score kong-set-score <?php if($tianType!=4) echo 'hide';?>">
  308. <span class="score-msg">2</span>
  309. <span class="score-msg">4</span>
  310. </div>
  311. </div>
  312. </div>
  313. <?php else:?>
  314. <div class="fl">
  315. <p class="red-font">*当前考试为旧版组卷,不支持分值格式设置</p>
  316. </div>
  317. <?php endif;?>
  318. </div>
  319. <div class="sel-print-set clearfix">
  320. <div class="set-top-title fl">解答题设置</div>
  321. <?php if($createType==1):?>
  322. <div class="fl">
  323. <div class="opt-top">
  324. <span class="set-top-opt-name gray-font">分值上限:</span>
  325. <div class="set-top-tab jieda-score">
  326. <?php
  327. if($this->schoolInfo->province_id==12){
  328. ?>
  329. <span value="1" class="tab-list <?php if($jieType==1) echo 'selected';?>">15</span>
  330. <?php
  331. }else{
  332. ?>
  333. <span value="2" class="tab-list <?php if($jieType==2) echo 'selected';?>">16</span>
  334. <?php
  335. }
  336. ?>
  337. <span value="3" class="tab-list <?php if($jieType==3) echo 'selected';?>">29</span>
  338. <span value="4" class="tab-list <?php if($jieType==4) echo 'selected';?>">49</span>
  339. </div>
  340. </div>
  341. <div class="set-block-opt">
  342. <span class="gray-font">打分框示意图如下:</span>
  343. </div>
  344. <div class="card-set-score jie-set-score range-select <?php if($jieType!=1 && $jieType!=2 ) echo 'hide';?>">
  345. <ul class="fl decade-con">
  346. <li>1</li>
  347. </ul>
  348. <ul class="fl single-con">
  349. <li>0</li>
  350. <li>1</li>
  351. <li>2</li>
  352. <li>3</li>
  353. <li>4</li>
  354. <li>5</li>
  355. <li>6</li>
  356. </ul>
  357. </div>
  358. <div class="card-set-score range-select jie-set-score <?php if($jieType!=3) echo 'hide';?>" >
  359. <ul class="fl decade-con">
  360. <li>1</li>
  361. <li>2</li>
  362. </ul>
  363. <ul class="fl single-con">
  364. <li>0</li>
  365. <li>1</li>
  366. <li>2</li>
  367. <li>3</li>
  368. <li>4</li>
  369. <li>5</li>
  370. <li>6</li>
  371. <li>7</li>
  372. <li>8</li>
  373. <li>9</li>
  374. </ul>
  375. </div>
  376. <div class="card-set-score range-select jie-set-score <?php if($jieType!=4) echo 'hide';?>" >
  377. <ul class="fl decade-con">
  378. <li>1</li>
  379. <li>2</li>
  380. <li>3</li>
  381. <li>4</li>
  382. </ul>
  383. <ul class="fl single-con">
  384. <li>0</li>
  385. <li>1</li>
  386. <li>2</li>
  387. <li>3</li>
  388. <li>4</li>
  389. <li>5</li>
  390. <li>6</li>
  391. <li>7</li>
  392. <li>8</li>
  393. <li>9</li>
  394. </ul>
  395. </div>
  396. </div>
  397. <?php else:?>
  398. <div class="fl">
  399. <p class="red-font">*当前考试为旧版组卷,不支持分值上限设置</p>
  400. </div>
  401. <?php endif;?>
  402. </div>
  403. </div>
  404. </div>
  405. <div class="paper-pop-bottom">
  406. <div class="paper-set-save-btn">保存</div>
  407. </div>
  408. </div>
  409. </div>
  410. <script>
  411. var printTypeCard='<?php echo $paper_tpl_type?>',
  412. dtk_type='<?php echo $dtkType?>',
  413. tplDataPaper='<?php echo $paper?>',
  414. tianType='<?php echo $tianType?>',
  415. jieType='<?php echo $jieType?>',
  416. subjectId=parseInt('<?php echo $subjectId?>');
  417. $('.openDtk').click(function(){
  418. $('.editDtk').show();
  419. });
  420. $('.pop-close').click(function(){
  421. $('.editDtk').hide();
  422. });
  423. $('.dtk_type').change(function(){
  424. if($(this).val()>0){
  425. dtk_type=$(this).val();
  426. }
  427. });
  428. $('.paper_type').change(function(){
  429. if($(this).val()>0){
  430. tplDataPaper=$(this).val();
  431. }
  432. });
  433. $('.exam-type-list,.tab-list').click(function(){
  434. if (!$(this).hasClass('selected')) {
  435. if ($(this).text()=='题卡分离') {
  436. $('.print-type-card').eq(1).removeClass('hide');
  437. printTypeCard=2;
  438. } else if ($(this).text()=='题卡合一') {
  439. if(subjectId==8){
  440. return false;
  441. }
  442. $('.print-type-card').eq(1).addClass('hide');
  443. printTypeCard=1;
  444. }
  445. if ($(this).parent().hasClass('kong-tab-opt')) {
  446. var idx = $(this).index();
  447. tianType=idx+1;
  448. $('.kong-set-score').addClass('hide');
  449. $('.kong-set-score').eq(idx).removeClass('hide');
  450. }
  451. if ($(this).parent().hasClass('jieda-score')) {
  452. var idx = $(this).index();
  453. console.log(idx);
  454. jieType=$(this).attr('value');
  455. $('.jie-set-score').addClass('hide');
  456. $('.jie-set-score').eq(idx).removeClass('hide');
  457. }
  458. $(this).addClass('selected').siblings().removeClass('selected');
  459. }
  460. })
  461. $('.paper-set-save-btn').click(function(){
  462. $('input[name=printTypeCard]').val(printTypeCard);
  463. $('input[name=tplDataPaper]').val(tplDataPaper);
  464. $('input[name=dtkType]').val(dtk_type);
  465. $('input[name=tianType]').val(tianType);
  466. $('input[name=jieType]').val(jieType);
  467. $('.editDtk').hide();
  468. if(printTypeCard==1){
  469. $('.show_msg_1').html('题卡合一');
  470. $('.paper_type_set').addClass('hide');
  471. }else{
  472. $('.show_msg_1').html('题卡分离');
  473. $('.paper_type_set').removeClass('hide');
  474. }
  475. if(tplDataPaper==1){
  476. $('.show_msg_2').html('A3');
  477. }else if(tplDataPaper==2){
  478. $('.show_msg_2').html('A4');
  479. }
  480. if(dtk_type==1){
  481. $('.show_msg_3').html('A3');
  482. }else if(dtk_type==2){
  483. $('.show_msg_3').html('A4');
  484. }else if(dtk_type==3){
  485. $('.show_msg_3').html('8k');
  486. }else if(dtk_type==4){
  487. $('.show_msg_3').html('16k');
  488. }
  489. if(tianType==1){
  490. $('.show_msg_4').html('自定义分值');
  491. }else if(tianType==2){
  492. $('.show_msg_4').html('2/3/5分');
  493. }else if(tianType==3){
  494. $('.show_msg_4').html('2/3/4/6分');
  495. }else if(tianType==4){
  496. $('.show_msg_4').html('2/4分');
  497. }
  498. if(jieType==1) {
  499. $('.show_msg_5').html('15');
  500. }else if(jieType==2){
  501. $('.show_msg_5').html('16');
  502. }else if(jieType==3){
  503. $('.show_msg_5').html('29');
  504. }else if(jieType==4){
  505. $('.show_msg_5').html('49');
  506. }
  507. });
  508. </script>
  509. <!--修改试卷模板end-->
  510. <script>
  511. $(document).ready(function(){
  512. $('.datetimepicker8').datetimepicker({
  513. onGenerate:function( ct ){
  514. $(this).find('.xdsoft_date').toggleClass('xdsoft_disabled');
  515. $(this).find('.xdsoft_today').removeClass('xdsoft_disabled');
  516. },
  517. format:'Y-m-d',
  518. formatDate:'Y-m-d',
  519. //minDate:'-1970/01/2',
  520. maxDate:'+1970/01/2',
  521. minDate: '-<?php echo date('Y-m-d', strtotime('Yesterday')); ?>',
  522. timepicker:false
  523. });
  524. //选择考试时间
  525. //返回
  526. $('.mcp-back-btn').click(function(){
  527. //location.href="<?php echo Yii::app()->createUrl('print/index')?>";
  528. window.history.back();
  529. });
  530. $('input[name="examName"]').keydown(function(event){
  531. $('#examName-error').html("");
  532. });
  533. //阅卷方式
  534. $('.markType').click(function(){
  535. var markType = $(this).attr('value');
  536. if(markType){
  537. $('#markType-error').html("");
  538. }
  539. $('input[name="markType"]').val(markType);
  540. });
  541. //考试类型
  542. $('.examType').click(function(){
  543. var type = $(this).attr('value');
  544. if(type){
  545. $('#type-error').html("");
  546. }
  547. $('input[name="type"]').val(type);
  548. });
  549. if ($('.sel-classes > span').length > 0){
  550. for (var i = 0;i < $('.sel-classes > span').length; i++){
  551. for (var k = 0;k < $('.bjs-lis').length; k++){
  552. if ($('.bjs-lis').eq(k).text().trim()==$('.sel-classes > span').eq(i).text().trim()) {
  553. $('.bjs-lis').eq(k).find('.judge-sel').addClass('active');
  554. }
  555. }
  556. }
  557. }
  558. $('.mcp-radio-sel').click(function(){
  559. if (!$(this).find('.sel-btn').hasClass('select') && !$(this).hasClass('disabled')) {
  560. $(this).find('.sel-btn').addClass('select');
  561. $(this).siblings().find('.sel-btn').removeClass('select');
  562. }
  563. });
  564. $('.grade-sel ul li').click(function(){
  565. $(this).addClass('active').siblings().removeClass('active');
  566. });
  567. // $('.judge-sel').on('click',function(){
  568. // alert(1);
  569. // if (!$(this).hasClass('active')) {
  570. // $(this).addClass('active');
  571. // $('.sel-classes').append('<span>'+$(this).closest('.bjs-lis').text()+'</span>');
  572. // } else {
  573. // $(this).removeClass('active');
  574. // for (var i = 0;i < $('.sel-classes > span').length; i++) {
  575. // console.log($('.sel-classes > span').eq(i).text());
  576. // if ($('.sel-classes > span').eq(i).text().trim() == $(this).closest('.bjs-lis').text().trim()){
  577. // $('.sel-classes > span').eq(i).remove();
  578. // }
  579. // }
  580. // }
  581. // });
  582. $('.sel-classes > span').click(function(){
  583. $(this).remove();
  584. for (var i = 0;i < $('.bjs-lis').length; i++) {
  585. if ($('.bjs-lis').eq(i).text().trim()==$(this).text().trim()){
  586. $('.bjs-lis').eq(i).find('.judge-sel').removeClass('active');
  587. }
  588. }
  589. });
  590. // 下拉列表模拟
  591. $('.inp-text').click(function(){
  592. if ($(this).next().is(':hidden')){
  593. $(this).next().show();
  594. } else {
  595. $(this).next().hide();
  596. }
  597. });
  598. // 点下拉列表选项
  599. $('.select-con li').click(function(){
  600. $(this).closest('.select-con').hide();
  601. $(this).closest('.mcp-form-detail').find('.inp-text').text($(this).text());
  602. });
  603. // 点击空白处下拉列表消失
  604. $(document).click(function(e){
  605. var targetNode = $(e.target).closest(".inp-text");
  606. if (targetNode.length>0){
  607. return;
  608. }else{
  609. $(".select-con").hide();
  610. }
  611. });
  612. $("body").delegate("#createThird[active='true']", "click", function(e) {
  613. var error = new Array();
  614. var examName = $('input[name="examName"]').val();
  615. var type = $('input[name="type"]').val();
  616. var markType = $("#markType").find(".select").attr("value");
  617. var examDate = $("input[name='examDate']").val();
  618. if(examName == "" || examName == null){
  619. $('#examName-error').html('请指定考试名称');
  620. error.push('没有指定考试名称');
  621. }else{
  622. $('#examName-error').html('');
  623. }
  624. if(type == "" || type == null){
  625. $('#type-error').html('请指定考试类型');
  626. error.push('没有指定考试类型');
  627. }else{
  628. $('#type-error').html('');
  629. }
  630. if (examDate == '') {
  631. $('#examDate').html('请设置考试日期');
  632. error.push('请设置考试日期');
  633. }else{
  634. $('#examDate').html('');
  635. }
  636. console.log(error);
  637. if(error.length == 0){
  638. $(this).attr("active","false");
  639. $(".saveForm").submit();
  640. }
  641. });
  642. });
  643. </script>