thirdview.php 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  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" href="/css/third/paperCard.css" />
  6. <link type="text/css" rel="stylesheet" href="/js/select/select2.min.css" />
  7. <link rel="stylesheet" href="/css/alert.css"/>
  8. <script src="/js/select/select2.min.js"></script>
  9. <style>
  10. #choose-error{color: #FF0000;}
  11. #examName-error{color: #FF0000;}
  12. #classIds-error{color: #FF0000;}
  13. #type-error{color: #FF0000;}
  14. #markType-error{color: #FF0000;}
  15. #subject-error{color: #FF0000;}
  16. #examDate{color: #FF0000;}
  17. .class-box{
  18. width: 500px;
  19. }
  20. .class-box>p{
  21. margin-bottom: 10px;
  22. }
  23. .class-box>ul{
  24. width: 500px;
  25. height: 200px;
  26. padding: 10px 20px;
  27. background-color: #FAFAFA;
  28. box-sizing: border-box;
  29. border:1px solid #ddd;
  30. }
  31. .class-box>ul>li{
  32. float: left;
  33. margin-right: 15px;
  34. margin-bottom: 10px;
  35. cursor: pointer;
  36. }
  37. .class-box>ul>li>img{
  38. vertical-align: middle;
  39. margin-left: 3px;
  40. }
  41. .class-modal-body{margin-bottom:15px;}
  42. #gradeTxt{display:inline-block;border-left:2px solid #2677ff;padding-left:10px;}
  43. .class_right{
  44. width:650px;
  45. }
  46. .class_area li{
  47. width:185px;
  48. height:30px;
  49. line-height: 30px;
  50. text-align: center;
  51. border:1px solid #ccc;
  52. margin:5px;
  53. border-radius: 3px;
  54. cursor:pointer
  55. }
  56. .class_area li.active{
  57. color:#fff;
  58. background: #2977ff;
  59. cursor:pointer
  60. }
  61. .selected-box{overflow:auto}
  62. </style>
  63. <div class="main-content-inner">
  64. <!-- 导航栏开始-->
  65. <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
  66. <!-- 导航栏结束-->
  67. <div class="test-data">
  68. <div class="page-content">
  69. <div class="mcp-title">
  70. <span class="active">第1步、考试基本信息</span>
  71. <span><i class="horizontal-line"></i></span>
  72. <span>第2步、关联在线答题卡</span>
  73. </div>
  74. <form class="saveForm">
  75. <div class="mcp-main-con">
  76. <div class="mcp-form-list clearfix">
  77. <div class="mcp-form-menu fl">试卷名称</div>
  78. <div class="mcp-form-detail fl"><input type="text" placeholder="必填" class="test-paper-name" name="examName"></div>
  79. <div id="examName-error"></div>
  80. </div>
  81. <!--
  82. <div class="mcp-form-list clearfix">
  83. <div class="mcp-form-menu fl">试卷类型</div>
  84. <div class="mcp-form-menu fl">
  85. <div class="mcp-form-detail fl clearfix">
  86. <select name="tpl_index" class="fl choose-subject">
  87. <option value="1050" selected>全国版</option>
  88. <option value="1051">江苏版</option>
  89. </select>
  90. </div>
  91. </div>
  92. <div id="subject-error"></div>
  93. </div>
  94. -->
  95. <div class="mcp-form-list clearfix">
  96. <div class="mcp-form-menu fl">考试类型</div>
  97. <div class="mcp-form-detail fl clearfix">
  98. <div class="mcp-radio-sel fl">
  99. <span class="sel-btn select examType" value="1"></span>
  100. <span>周考</span>
  101. </div>
  102. <div class="mcp-radio-sel fl">
  103. <span class="sel-btn examType" value="2"></span>
  104. <span>单元考</span>
  105. </div>
  106. <div class="mcp-radio-sel fl">
  107. <span class="sel-btn examType" value="3"></span>
  108. <span>月考</span>
  109. </div>
  110. <div class="mcp-radio-sel fl">
  111. <span class="sel-btn examType" value="4"></span>
  112. <span>联考</span>
  113. </div>
  114. <div class="mcp-radio-sel fl">
  115. <span class="sel-btn examType" value="5"></span>
  116. <span>期中考试</span>
  117. </div>
  118. <div class="mcp-radio-sel fl">
  119. <span class="sel-btn examType" value="6"></span>
  120. <span>期末考试</span>
  121. </div>
  122. <div class="mcp-radio-sel fl">
  123. <span class="sel-btn examType" value="7"></span>
  124. <span>模拟考</span>
  125. </div>
  126. <div class="mcp-radio-sel fl">
  127. <span class="sel-btn examType" value="8"></span>
  128. <span>冲刺考</span>
  129. </div>
  130. <div class="clear"></div>
  131. <div class="mcp-radio-sel fl">
  132. <span class="sel-btn examType" value="9"></span>
  133. <span>测验(适用于非正式考试)</span>
  134. </div>
  135. </div>
  136. <div id="type-error"></div>
  137. </div>
  138. <div class="mcp-form-list clearfix">
  139. <div class="mcp-form-menu fl">主阅卷员</div>
  140. <div class="mcp-form-detail fl">
  141. <select class="sel-option projSelect" style="width: 150px">
  142. <option value="0">选择阅卷员</option>
  143. <?php foreach($teacher_arr as $t):?>
  144. <option value="<?php echo $t['teacher_id']?>"><?php echo $t['teacher_name']?></option>
  145. <?php endforeach;?>
  146. </select>
  147. </div>
  148. <div id="choose-error"></div>
  149. </div>
  150. <div class="mcp-form-list clearfix">
  151. <div class="mcp-form-menu fl">选择年级</div>
  152. <div class="mcp-form-detail fl">
  153. <select class="select-grade" isthird="0" name="select-grade" style="width: 150px">
  154. <option value="0">请选择</option>
  155. <option value="1">高一</option>
  156. <option value="2">高二</option>
  157. <option value="3">高三</option>
  158. </select>
  159. </div>
  160. <div id="grade-error"></div>
  161. </div>
  162. <div class="mcp-form-list clearfix">
  163. <div class="mcp-form-menu fl">选择班级</div>
  164. <div class="mcp-form-detail fl">
  165. <a class="btn btn-success btn-sm select-class">添加班级</a>
  166. <span id="classIds-error"></span>
  167. <div class="select-class-list">
  168. <div class="class-box fl">
  169. <ul class="selected-box">
  170. </ul>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. <div class="mcp-form-list clearfix <?php echo $is_qxk?'hide':'';?>">
  176. <div class="mcp-form-menu fl">题源</div>
  177. <div class="mcp-form-detail fl clearfix" >
  178. <span class="show_text_book">
  179. <?php
  180. if(isset($textbookArr[1])){
  181. echo $textbookArr[1]['subject_name'].' 教材版本 '.$textbookArr[1]['text_book_name'];
  182. }
  183. ?>
  184. </span>
  185. <span class="red">
  186. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**请认真确认,如果信息有误,请在教材管理模块更改
  187. </span>
  188. <input type="hidden" name="subjectId" value="<?php echo $textbookArr[1]['subject_id']?>">
  189. <input type="hidden" name="textbookId" value="<?php echo $textbookArr[1]['textbook_id']?>">
  190. </div>
  191. </div>
  192. <div class="mcp-form-list clearfix">
  193. <div class="mcp-form-menu fl">阅卷方式</div>
  194. <div class="mcp-form-detail fl clearfix" id ="markType">
  195. <div class="mcp-radio-sel fl">
  196. <span class="sel-btn select markType" value="3"></span>
  197. <span class ="markType" value="3">班级混合阅卷</span>
  198. </div>
  199. <div class="mcp-radio-sel fl">
  200. <span class="sel-btn markType" value="4"></span>
  201. <span class="markType" value="4">班级单独阅卷</span>
  202. </div>
  203. <div class="mcp-radio-sel fl">
  204. <span class="sel-btn markType" value="0"></span>
  205. <span class="markType" value="0">线下阅卷(暂只支持在线答题卡)</span>
  206. </div>
  207. <div id="markType-error"></div>
  208. </div>
  209. </div>
  210. <div class="mcp-form-list clearfix">
  211. <div class="mcp-form-menu fl">考试时间</div>
  212. <div class="mcp-form-detail fl clearfix">
  213. <input type="text" class='core datetimepicker8' readonly style="width: 100px;" name="examDate" />
  214. </div>
  215. <div id="examDate"></div>
  216. </div>
  217. </div>
  218. <input name="type" value="1" type="hidden"/>
  219. <input name="teacherId" value="0" type="hidden"/>
  220. <input name="markType" value="3" type="hidden"/>
  221. <input type="hidden" name="tpl_index" value="1050">
  222. <input name="classIds" value="0" type="hidden"/>
  223. <input name="isQxk" value="<?php echo $is_qxk?>" type="hidden"/>
  224. </form>
  225. <!--<button id="createThird">确定</button>-->
  226. <!-- <div class="mcp-form-list mcp-fl-btns clearfix">
  227. <input type="button" value="保存并返回" class="mcp-sure-btn" id="createThird" active="true">
  228. <input type="button" value="确定" class="mcp-sure-btn" active="true">
  229. <input type="button" value="返回" class="mcp-back-btn" >
  230. </div> -->
  231. <div class="template-flag-box">
  232. <a href="javascript:;" id="createThird" active="true">保存并返回</a>
  233. <!-- <a href="javascript:;" id="goNext" active="true">保存并下一步</a> -->
  234. <a href="javascript:;" id="goNextNew" active="true">保存并下一步</a>
  235. <a href="javascript:;" id="goBack" class="gray" active="true">放弃并返回</a>
  236. <!--<a href="javascript:;" class="template-flag">创建答题卡</a>-->
  237. </div>
  238. </div>
  239. </div>
  240. <div class="relation-answer-card">
  241. <div class="page-content">
  242. <div class="mcp-title">
  243. <span >第1步、考试基本信息</span>
  244. <span><i class="horizontal-line"></i></span>
  245. <span class="active">第2步、关联在线答题卡</span>
  246. </div>
  247. <!-- 新版本右侧答题卡 -->
  248. <div class="hgc_leftContent">
  249. <div class="module">
  250. <h2>
  251. <span>当前答题卡</span>
  252. <span class="theme notice">新版本,无需切割模板,可通过扫描入口直接扫描</span>
  253. </h2>
  254. <div class="contentInfo">
  255. <div class="opratorBnts">
  256. <span class="theme" id="saveMyTpl">保存为我的模版</span>
  257. <span class="theme" id="downLoadPdfBtn">下载答题卡</span>
  258. <span class="theme" id="editMyTpl">修改答题卡>></span>
  259. </div>
  260. <div class="subjectInfo">
  261. <div class="infoItem">
  262. <em>基本信息:</em>
  263. <div class="info">
  264. <p>
  265. <span>板式:A3-横版-三栏</span>
  266. <span>考号:填涂(10位)</span>
  267. <span>装订线:有</span>
  268. <span>总分:150分</span>
  269. <span>题量:50</span>
  270. </p>
  271. </div>
  272. </div>
  273. <div class="infoItem">
  274. <em>题目信息:</em>
  275. <div class="info">
  276. <p>
  277. <span>一、单项填空</span>
  278. <span>单选</span>
  279. <span>20题</span>
  280. <span>共20分</span>
  281. </p>
  282. </div>
  283. </div>
  284. </div>
  285. </div>
  286. <div class="contentNoInfo">
  287. <!-- <img src="" alt=""> -->
  288. <span>未创建答题卡</span>
  289. <div class="hbtn">创建在线答题卡</div>
  290. </div>
  291. </div>
  292. <div class="module">
  293. <h2>
  294. <span>我的模版(<em id="tplLength">0</em>)</span>
  295. </h2>
  296. <div class="tplBox">
  297. <div class="leftBtn btnItem"></div>
  298. <div class="tplCut">
  299. <div class="tplList">
  300. </div>
  301. <p id="tplListMsg" style="text-align: center;">暂未保存模板</p>
  302. </div>
  303. <div class="rightBtn btnItem"></div>
  304. </div>
  305. </div>
  306. </div>
  307. <div class="template-flag-box">
  308. <a href="javascript:;" id="createThirdCard" active="true">保存并返回</a>
  309. <a href="javascript:;" id="goBack" class="gray" active="true">放弃并返回</a>
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. <!-- 弹窗 -->
  315. <div class="confirmbox-mask" style="display: none;" id="fieldModal">
  316. <div class="class-modal" style="padding: 0px;">
  317. <div class="class-modal-head" style="background-color: #2977ff;color: white;height: 30px;font-size: 16px;font-weight: initial;"><span style="float: left;padding: 5px;">选择考试班级</span><span class=" add-class-close" style="float: right;padding: 5px;cursor: pointer;">X</span></div>
  318. <form id="examSelect">
  319. <div class="class-modal-body">
  320. <p class="title">
  321. <input type="hidden" id="grade_id" name="grade_id" value="0">
  322. <span style="float: left;" id="gradeTxt">
  323. </span>
  324. <span style="margin-left: 300px;">
  325. <input type="checkbox" id="global_check_all" class="add_class_input">&nbsp;全选 &nbsp;&nbsp;
  326. <input type="checkbox" id="global_check_arts" class="add_class_input">&nbsp;全部文科班 &nbsp;&nbsp;
  327. <input type="checkbox" id="global_check_science" class="add_class_input">&nbsp;全部理科班 &nbsp;&nbsp;
  328. </span>
  329. </p>
  330. <div class="class_area" id="class_area">
  331. <ul class="class_right area_1">
  332. </ul>
  333. </div>
  334. </div>
  335. <p class="class_btn" style="text-align: center;">
  336. <input type="hidden" name="exam_gruop_id" value="0">
  337. <button type="button" class="setting_sumbit" style="margin-right: 10px;">确定</button>
  338. <button type="button" class="cancel-btn">取消</button>
  339. </p>
  340. </form>
  341. </div>
  342. </div>
  343. <script>
  344. var subjects = <?php echo json_encode($textbookArr); ?>;
  345. $(document).ready(function(){
  346. $('.projSelect').select2();
  347. var teacher_name = '';
  348. var islocal = ~location.href.indexOf('xg.com');
  349. var baseUrl = '';
  350. if(islocal){
  351. // baseUrl ='http://192.168.1.51/index.php'
  352. baseUrl ='/index.php'
  353. }else {
  354. baseUrl =''
  355. }
  356. var saveFormData ="";
  357. function isReturn(){
  358. // var isCardReturn = localStorage.getItem('isCardReturn');
  359. // var isCardReturn = ~document.referrer.indexOf('online/third');
  360. var locationUrl = window.location.href;
  361. let isCardReturn = locationUrl.indexOf('isCardReturn')
  362. if(isCardReturn>-1){
  363. $('.test-data').hide();
  364. $('.relation-answer-card').show();
  365. saveFormData = JSON.parse(localStorage.getItem('testFormData'));
  366. }else{
  367. var locationUrl = window.location.href;
  368. localStorage.setItem('referrerUrl',JSON.stringify(locationUrl));
  369. }
  370. }
  371. isReturn();
  372. $('.datetimepicker8').datetimepicker({
  373. onGenerate:function( ct ){
  374. $(this).find('.xdsoft_date').toggleClass('xdsoft_disabled');
  375. $(this).find('.xdsoft_today').removeClass('xdsoft_disabled');
  376. },
  377. format:'Y-m-d',
  378. formatDate:'Y-m-d',
  379. minDate:'-1970/01/2',
  380. maxDate:'+1970/01/2',
  381. timepicker:false
  382. });
  383. //选择考试时间
  384. //选择教材题源
  385. console.log(subjects);
  386. for(var key in subjects){
  387. $(".choose-grade").append('<option value="'+ key +'">'+ subjects[key] +'</option>');
  388. }
  389. $(".choose-grade").change(function(){
  390. var obj = $(this);
  391. var val = obj.val();
  392. var child = $('.choose-book');
  393. child.html('<option value="0">选择教材</option>');
  394. for (var key in textbooks) {
  395. if (key == val) {
  396. child.html('');
  397. for (var name in textbooks[key]) {
  398. child.append('<option value="'+ [name] +'">'+ textbooks[key][name] +'</option>');
  399. }
  400. }
  401. }
  402. });
  403. //返回
  404. $('.mcp-back-btn').click(function(){
  405. location.href="<?php echo Yii::app()->createUrl('third/index')?>";
  406. });
  407. $('input[name="examName"]').keydown(function(event){
  408. $('#examName-error').html("");
  409. });
  410. //阅卷方式
  411. $('.markType').click(function(){
  412. var markType = $(this).attr('value');
  413. if(markType){
  414. $('#markType-error').html("");
  415. }
  416. $('input[name="markType"]').val(markType);
  417. });
  418. //考试类型
  419. $('.examType').click(function(){
  420. var type = $(this).attr('value');
  421. if(type){
  422. $('#type-error').html("");
  423. }
  424. $('input[name="type"]').val(type);
  425. });
  426. //选择教师
  427. $('.sel-option').change(function(){
  428. var teacher_id = $(this).val();
  429. teacher_name = $(this).text();
  430. if(teacher_id){
  431. $('#choose-error').html("");
  432. }
  433. $('input[name="teacherId"]').val(teacher_id);
  434. });
  435. if ($('.sel-classes > span').length > 0){
  436. for (var i = 0;i < $('.sel-classes > span').length; i++){
  437. for (var k = 0;k < $('.bjs-lis').length; k++){
  438. if ($('.bjs-lis').eq(k).text().trim()==$('.sel-classes > span').eq(i).text().trim()) {
  439. $('.bjs-lis').eq(k).find('.judge-sel').addClass('active');
  440. }
  441. }
  442. }
  443. }
  444. $('.mcp-radio-sel').click(function(){
  445. if (!$(this).find('.sel-btn').hasClass('select')) {
  446. $(this).find('.sel-btn').addClass('select');
  447. $(this).siblings().find('.sel-btn').removeClass('select');
  448. }
  449. });
  450. $('.grade-sel ul li').click(function(){
  451. $(this).addClass('active').siblings().removeClass('active');
  452. });
  453. // $('.judge-sel').on('click',function(){
  454. // alert(1);
  455. // if (!$(this).hasClass('active')) {
  456. // $(this).addClass('active');
  457. // $('.sel-classes').append('<span>'+$(this).closest('.bjs-lis').text()+'</span>');
  458. // } else {
  459. // $(this).removeClass('active');
  460. // for (var i = 0;i < $('.sel-classes > span').length; i++) {
  461. // console.log($('.sel-classes > span').eq(i).text());
  462. // if ($('.sel-classes > span').eq(i).text().trim() == $(this).closest('.bjs-lis').text().trim()){
  463. // $('.sel-classes > span').eq(i).remove();
  464. // }
  465. // }
  466. // }
  467. // });
  468. $('.sel-classes > span').click(function(){
  469. $(this).remove();
  470. for (var i = 0;i < $('.bjs-lis').length; i++) {
  471. if ($('.bjs-lis').eq(i).text().trim()==$(this).text().trim()){
  472. $('.bjs-lis').eq(i).find('.judge-sel').removeClass('active');
  473. }
  474. }
  475. });
  476. // 下拉列表模拟
  477. $('.inp-text').click(function(){
  478. if ($(this).next().is(':hidden')){
  479. $(this).next().show();
  480. } else {
  481. $(this).next().hide();
  482. }
  483. });
  484. // 点下拉列表选项
  485. $('.select-con li').click(function(){
  486. $(this).closest('.select-con').hide();
  487. $(this).closest('.mcp-form-detail').find('.inp-text').text($(this).text());
  488. });
  489. // 点击空白处下拉列表消失
  490. $(document).click(function(e){
  491. var targetNode = $(e.target).closest(".inp-text");
  492. if (targetNode.length>0){
  493. return;
  494. }else{
  495. $(".select-con").hide();
  496. }
  497. });
  498. function saveThirdForm(e,btnType) {
  499. var classIds='';
  500. $(".selected-box").find('li').each(function(index,el){
  501. classIds += $(el).attr('value')+",";
  502. });
  503. $('input[name="classIds"]').val(classIds);
  504. var error = new Array();
  505. var classIds = $('input[name="classIds"]').val();
  506. var examName = $('input[name="examName"]').val();
  507. var type = $('input[name="type"]').val();
  508. var teacherId = $('input[name="teacherId"]').val();
  509. // var markType = $('input[name="markType"]').val();
  510. var markType = $("#markType").find(".select").attr("value");
  511. var subjectId = $('input[name=subjectId]').val();
  512. var examDate = $("input[name='examDate']").val();
  513. if(subjectId == 0 || subjectId == null){
  514. $('#subject-error').html('请指定题源');
  515. error.push('没有指定题源');
  516. }else{
  517. $('#subject-error').html('');
  518. }
  519. if(examName == "" || examName == null){
  520. $('#examName-error').html('请指定考试名称');
  521. error.push('没有指定考试名称');
  522. }else{
  523. $('#examName-error').html('');
  524. }
  525. if(type == "" || type == null){
  526. $('#type-error').html('请指定考试类型');
  527. error.push('没有指定考试类型');
  528. }else{
  529. $('#type-error').html('');
  530. }
  531. if(teacherId == '0' || teacherId == null){
  532. $('#choose-error').html('请指定阅卷老师');
  533. error.push('没有指定阅卷老师');
  534. }
  535. $('#choose-error').html('');
  536. if(classIds == "" || classIds == null){
  537. $('#classIds-error').html('请指定考试班级');
  538. error.push('没有指定考试班级');
  539. }else{
  540. $('#classIds-error').html('');
  541. }
  542. console.log(classIds);
  543. if(!markType){
  544. $('#markType-error').html('请指定阅卷方式');
  545. error.push('没有指定阅卷方式');
  546. }else{
  547. $('#markType-error').html('');
  548. }
  549. if (examDate == '') {
  550. $('#examDate').html('请设置考试日期');
  551. error.push('请设置考试日期');
  552. } else if (examDate < '<?php echo date('Y-m-d'); ?>') {
  553. //$('#examDate').html('考试日期设置错误');
  554. // error.push('考试日期设置错误');
  555. }else{
  556. $('#examDate').html('');
  557. }
  558. if(error.length == 0){
  559. // debugger
  560. $(e.target).attr("active","false");
  561. saveFormData = {
  562. examName:examName,
  563. subjectId:subjectId,
  564. textbookId:$('input[name="textbookId"]').val(),
  565. tpl_index:$('input[name="tpl_index"]').val(),
  566. examDate:examDate,
  567. type:type,
  568. teacherId:teacherId,
  569. markType:markType,
  570. classIds:classIds,
  571. isQxk:$('input[name="isQxk"]').val()
  572. };
  573. localStorage.setItem('testFormData',JSON.stringify(saveFormData))
  574. var formData = new FormData();
  575. for(var k in saveFormData){
  576. formData.append(k,saveFormData[k])
  577. }
  578. $.ajax({
  579. url:baseUrl+'/index.php/third/createthirdForNext',
  580. method: 'POST',
  581. processData: false,
  582. contentType: false,
  583. dataType: 'json',
  584. data: formData,
  585. success: function (data) {
  586. if(data.status ==1){
  587. saveFormData.examGroupId = data.examGroupId;
  588. saveFormData.teacher_name = teacher_name;
  589. var addGrade = 0;
  590. $('.grade-sel ul li').each(function(){
  591. if($(this).hasClass('active')){
  592. addGrade = $(this).attr('grade')
  593. }
  594. })
  595. saveFormData.grade = addGrade;
  596. localStorage.setItem('testFormData',JSON.stringify(saveFormData));
  597. if(btnType===1){
  598. goBack();
  599. }else if(btnType===2){
  600. $('.test-data').hide();
  601. $('.relation-answer-card').show();
  602. }else if(btnType===3){
  603. // location.href = '/index.php/third/thirdCardSecond'
  604. location.href = '/index.php/online/answersheetList/examGroupId/'+saveFormData.examGroupId+'?isThird=1&examGroupId='+saveFormData.examGroupId
  605. }
  606. }else{
  607. if(data.info){
  608. layer.msg(data.info);
  609. }else{
  610. if(data.msg){
  611. layer.msg(data.msg);
  612. }
  613. //
  614. }
  615. $(e.target).attr("active","true");
  616. }
  617. }
  618. })
  619. }else{
  620. layer.msg(error.join(','));
  621. $(e.target).attr("active","true");
  622. }
  623. }
  624. function goBack(){
  625. //location.href = '/index.php/third/index'
  626. window.history.back();
  627. }
  628. //保存并返回
  629. $("body").delegate("#createThird[active='true']", "click", function(e) {
  630. $('#createThird').attr('active',false);
  631. $('#goNext').attr('active',false);
  632. $('#goNextNew').attr('active',false);
  633. saveThirdForm(e,1);
  634. });
  635. //保存并关联答题卡
  636. $("body").delegate("#goNext[active='true']", "click", function(e) {
  637. $('#createThird').attr('active',false);
  638. $('#goNext').attr('active',false);
  639. $('#goNextNew').attr('active',false);
  640. saveThirdForm(e,2);
  641. });
  642. //保存并关联答题卡
  643. $("body").delegate("#goNextNew[active='true']", "click", function(e) {
  644. $('#createThird').attr('active',false);
  645. $('#goNext').attr('active',false);
  646. $('#goNextNew').attr('active',false);
  647. saveThirdForm(e,3);
  648. });
  649. //取消并返回
  650. $("body").delegate("#goBack[active='true']", "click", function(e) {
  651. localStorage.setItem('isCardReturn',0)
  652. goBack();
  653. });
  654. });
  655. </script>
  656. <script src="/js/third/submit.js"></script>
  657. <script src="/js/third/select-class.js"></script>