_popup.php 79 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934
  1. <style>
  2. /*弹出层*/
  3. .modal{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;}
  4. .modal{width: 100%;height: 100%;background: rgba(0,0,0,.4)}
  5. .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
  6. .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #50d2c2;box-sizing: border-box;}
  7. .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
  8. .model-score{text-align: center;margin:30px 0;}
  9. .model-score input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
  10. .model-score input:focus{border-color: #50d2c2;box-shadow: 0 0 5px #50d2c2;}
  11. .modal-btn{text-align: center;margin:10px 0;}
  12. .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
  13. .modal1{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;}
  14. .modal1{width: 100%;height: 100%;background: rgba(0,0,0,.4)}
  15. .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
  16. .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #50d2c2;box-sizing: border-box;}
  17. .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
  18. .model-score1{text-align: center;margin:30px 0;}
  19. .model-score1 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
  20. .model-score1 input:focus{border-color: #50d2c2;box-shadow: 0 0 5px #50d2c2;}
  21. .modal-btn{text-align: center;margin:10px 0;}
  22. .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
  23. .modal2{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;}
  24. .modal2{width: 100%;height: 100%;background: rgba(0,0,0,.4)}
  25. .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
  26. .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #50d2c2;box-sizing: border-box;}
  27. .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
  28. .model-score2{text-align: center;margin:30px 0;}
  29. .model-score2 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
  30. .model-score2 input:focus{border-color: #50d2c2;box-shadow: 0 0 5px #50d2c2;}
  31. .modal-btn{text-align: center;margin:10px 0;}
  32. .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
  33. .modal1_multi{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;background: rgba(0,0,0,.4)}
  34. .model-rule{width:80%;margin:5px auto;}
  35. .model-rule label{display: block;margin:10px 0;}
  36. .modal1_multi .model-score1{width:80%;margin:10px auto;text-align: left}
  37. .modal1_multi .modal-btn{text-align: center;margin:5px 0;clear:both;}
  38. .modal1_multi .modal-btn a{display: inline-block;margin:5px 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
  39. .modal1_multi .model-score-m{width:80%;margin:5px auto;}
  40. #update_msg{color:red}
  41. .modal1_multi .model-score-m label{display: block;margin:5px 0;}
  42. .modal1_multi .model-score-m label .score_tag{width:70px;display: inline-block;}
  43. .modal1_multi .model-score-m label .score_input{padding-left: 5px; height: 20px;width: 200px;border:1px solid #ccc;outline: none; }
  44. .dn{display: none}
  45. .modal_student{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;}
  46. .modal_student{width: 100%;height: 100%;background: rgba(0,0,0,.4)}
  47. .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
  48. .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #50d2c2;box-sizing: border-box;color: #fff}
  49. .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
  50. .model-score1{text-align: center;margin:30px 0;}
  51. .model-score1 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
  52. .model-score1 input:focus{border-color: #50d2c2;box-shadow: 0 0 5px #50d2c2;}
  53. .modal-btn{text-align: center;margin:10px 0;}
  54. .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
  55. .modal_subject{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;}
  56. .modal_subject{width: 100%;height: 100%;background: rgba(0,0,0,.4)}
  57. .batch_topic{padding-left: 30px; font-size:14px;text-align: justify;line-height: 22px;}
  58. .batch_topic a{margin:0 5px; color: #4395ff}
  59. .batch_topic p{display: inline;}
  60. .confirmbox-mask {
  61. background: rgba(0, 0, 0, .7);
  62. left: 0;
  63. right: 0;
  64. top: 0;
  65. bottom: 0;
  66. z-index: 99;
  67. position: fixed;
  68. }
  69. button {
  70. border: none;
  71. background: #2977ff;
  72. width: 80px;
  73. height: 26px;
  74. border-radius: 3px;
  75. font-size: 14px;
  76. color: #fff;
  77. outline: none;
  78. cursor: pointer;
  79. }
  80. button.save {
  81. display: block;
  82. margin: 40px auto;
  83. }
  84. .confirmbox .confirmbox-btns {
  85. margin-top: 40px;
  86. }
  87. .class-modal {
  88. width: 500px;
  89. min-height: 400px;
  90. background: #fff;
  91. // border-radius: 5px;
  92. position: absolute;
  93. top: 50%;
  94. left: 50%;
  95. transform: translate(-50%, -50%);
  96. }
  97. .class-modal-head {
  98. font-size: 14px;
  99. background:#2977ff;
  100. color:#fff;
  101. height:35px;
  102. line-height: 35px;
  103. padding: 0 0 0 15px;
  104. }
  105. .class-modal-body {
  106. margin-top: 20px;
  107. max-height: 300px;
  108. overflow: auto;
  109. margin-left:50px;
  110. }
  111. .class-modal-body .classes {
  112. margin-bottom: 20px;
  113. }
  114. .class-modal-body .classes > div {
  115. display: inline-block;
  116. max-width: 640px;
  117. vertical-align: top;
  118. }
  119. .class-modal-body .classes a {
  120. text-decoration: none;
  121. display: inline-block;
  122. margin: 0 5px 5px;
  123. color: #136bfb;
  124. font-size: 14px;
  125. }
  126. .class-modal-body .classes a.active {
  127. color: #fc091b
  128. }
  129. .class-modal .icon-close{
  130. position: absolute;
  131. right: 20px;
  132. top: 2px;
  133. color:#fff;
  134. }
  135. .c-red {
  136. color: #CC3300
  137. }
  138. .avg{
  139. margin:0 10px;
  140. }
  141. .class_btn{
  142. text-align: center;
  143. }
  144. .confirmbox-mask p{
  145. word-wrap : break-word ;
  146. }
  147. .template-flag-box a{display:inline-block;color:#fff;text-decoration:none;border-radius:3px;width: 100px;text-align: center;background: #1FBF86;height: 30px;margin-right:20px;line-height:30px}
  148. .class-modal-body p{margin:10px 0;}
  149. .class-modal-body p span{display: inline-block;width:80px;}
  150. .icon-close{cursor:pointer;font-size:20px;line-height: 35px;}
  151. .class_btn{position: fixed;bottom: 2%;text-align: center;width:500px;}
  152. .red-tig{color:red;}
  153. .topic a.c-red{ color: #CC3300}
  154. .answerList td{text-align: center;padding:3px 0;border-bottom: 1px dotted #ccc;}
  155. .answerShow{border-collapse:separate;background: #666;width:190px;}
  156. .answerShow td{text-align: center;background:#fff;cursor: pointer}
  157. .answerShow td.active{background:#50d2c2;color:#000}
  158. .answerShow td.active_gray{background:#ccc;color:#fff}
  159. .new_half_score{width:50px;}
  160. </style>
  161. <script>
  162. $(function () {
  163. $('.choose-topic').hover(function(){
  164. $(this).css('border',"1px solid #50d2c2")
  165. },function(){
  166. $(this).css('border',"none")
  167. })
  168. //整理试题数据
  169. let topicGroup=[];
  170. let answerArr = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
  171. let subjectId='<?php echo $subject?>';
  172. let answerArrRight=['T','F'];
  173. <?php
  174. if($subject==8){
  175. echo "let answerArrT=['T','F'];";
  176. }else{
  177. echo "let answerArrT=['√','×'];";
  178. }
  179. ?>
  180. <?php
  181. foreach ($topic_group as $id => $item){
  182. echo "topicGroup['".$id."']=[];";
  183. foreach ($item as $v){
  184. echo "var obj=[];";
  185. if(isset($v['id'])){
  186. echo "obj.push('".$v['id']."');";
  187. }elseif(isset($v['topic_slave_id'])){
  188. echo "obj.push('".$v['topic_slave_id']."');";
  189. }
  190. //半对分,更新答案
  191. $ruleAnswer='';
  192. $ruleScore=$v['score'];
  193. $ruleType=2;
  194. $ruleScoreHalf=0;
  195. if(isset($update_answer[$v['order']])){
  196. $ruleAnswer=$update_answer[$v['order']]['update_answer'];
  197. }elseif(isset($new_rules[$v['order']])){
  198. $ruleAnswer=$new_rules[$v['order']]['rule_answer'];
  199. $ruleType=$new_rules[$v['order']]['rule_type'];
  200. $ruleScoreHalf=$new_rules[$v['order']]['rule_score_half'];
  201. $ruleScore=$new_rules[$v['order']]['rule_score'];
  202. }
  203. if($ruleScore){
  204. echo "obj.push('".$ruleScore."');";
  205. }else{
  206. echo "obj.push('".$v['score']."');";
  207. }
  208. echo "obj.push('".$v['order']."');";
  209. if(isset($v['alias'])){
  210. echo "obj.push('".$v['alias']."');";
  211. }else{
  212. echo "obj.push('".$v['order']."');";
  213. }
  214. if($ruleAnswer){
  215. echo "obj.push('".$ruleAnswer."');";
  216. }else{
  217. echo "obj.push('".$v['answer']."');";
  218. }
  219. echo "obj.push('".count($v['items'])."');";
  220. echo "obj.push('".$ruleAnswer."');";
  221. echo "obj.push('".$ruleType."');";
  222. echo "obj.push('".$ruleScoreHalf."');";
  223. if(isset($send_points[$v['order']])){
  224. echo "obj.push(1);";
  225. }else{
  226. echo "obj.push(0);";
  227. }
  228. echo "obj.push('');";
  229. echo "topicGroup['".$id."'].push(obj);";
  230. echo "obj=null;";
  231. }
  232. }
  233. ?>
  234. console.log(topicGroup);
  235. //批量更新判分规则
  236. $(".change_multi_answer1").click(function () {
  237. $(".modal1_multi").fadeIn();
  238. $("#topic_order_m").html('');
  239. $('.total_score').hide();
  240. $('.half_score').hide();
  241. $('.title-txt').html('批量更改判分规则');
  242. $('.tig-txt').hide();
  243. //读取答案
  244. var topicAnswer=[];
  245. var topicId=[];
  246. var scoreHalf=[];
  247. var obj=$(this).closest('.choose-topic').find('.topic');
  248. if(obj.length>0){
  249. for(var i=0;i<obj.length;i++){
  250. if(obj.eq(i).find('.rule_answer').val()!='' && obj.eq(i).find('.rule_answer').val()!=undefined){
  251. topicAnswer.push(obj.eq(i).find('.rule_answer').val());
  252. }else{
  253. console.log(obj.eq(i).find('.right-answer').val());
  254. topicAnswer.push(obj.eq(i).find('.right-answer').val());
  255. }
  256. if(obj.eq(i).find('.rule_score_half').val()!='' && obj.eq(i).find('.rule_score_half').val()!=undefined){
  257. scoreHalf.push(obj.eq(i).find('.rule_score_half').val());
  258. }else{
  259. scoreHalf.push(0);
  260. }
  261. topicId.push(obj.eq(i).attr('id'));
  262. }
  263. }
  264. $('.batch').hide();
  265. $('input[name=score_half_m]').val(0);
  266. $('input[name=score_m]').val(0);
  267. $("input[name=type_m]").val($(this).attr('type'));
  268. $("input[name=topic_id_m]").val(topicId.join('///'));
  269. $("input[name=answer_m]").val(topicAnswer.join('///'));
  270. $("input[name=score_half_h]").val(scoreHalf.join('///'));
  271. $('input[name=is_batch]').val(1);
  272. $('input[name=step]').val(0);
  273. });
  274. $(".change-score").click(function(){
  275. $(".modal").fadeIn();
  276. $("#topic_order").html("题号:"+parseInt($(this).parent().prev().find('.order').attr('order_id')));
  277. $("input[name=topic_id]").val($(this).attr('topic'));
  278. $("input[name=type]").val($(this).attr('type'));
  279. $("input[name=score]").val('');
  280. if($(this).attr('type')==1 || $(this).attr('type')==11 || $(this).attr('type')==2){
  281. $('.red-tig').hide();
  282. }else{
  283. $('.red-tig').show();
  284. }
  285. });
  286. $(".close3").click(function(event) {
  287. $(".sumbit3").attr('disabled',false);
  288. layer.closeAll();
  289. hideMulti($(this));
  290. });
  291. $(".sumbit3").click(function(event) {
  292. if($(this).attr('disabled')=='disabled'){
  293. return false;
  294. }
  295. var obj=$(this);
  296. var rule=$("input[name=rule]:checked").val();
  297. var score_m=$("input[name=score_m]").val();
  298. var score_half_m=$("input[name=score_half_m]").val();
  299. var answer=$("input[name=answer_m]").val();
  300. var is_batch=parseInt($('input[name=is_batch]').val());
  301. var step=parseInt($('input[name=step]').val());
  302. var type=parseInt($('input[name=type_m]').val());
  303. if(!answer)
  304. {
  305. layer.msg('答案不能为空');return;
  306. }
  307. console.log(score_m);
  308. if(score_m<0 || score_m=='' ){
  309. layer.msg('分数不能为空');return false;
  310. }
  311. if(is_batch==0) {
  312. if (parseFloat(score_half_m) > parseFloat(score_m)) {
  313. layer.msg('半对分不能大于满分');
  314. return;
  315. }
  316. }else{
  317. score_half_m=$("input[name=score_half_h]").val();
  318. }
  319. if(rule!=1 && (score_half_m==0 || score_half_m=='')){
  320. layer.msg('半对分数不能为空');
  321. return false;
  322. }
  323. if(type==1 || type==2 || type==11){
  324. if(score_m>49){
  325. layer.msg('最大分值不能超过49分');
  326. return false;
  327. }
  328. }else if(type==5){
  329. if(score_m>49){
  330. layer.msg('最大分值不能超过49分');
  331. return false;
  332. }
  333. }else if(type==7){
  334. if(score_m>60){
  335. layer.msg('最大分值不能超过60分');
  336. return false;
  337. }
  338. }else if(type==17){
  339. if(score_m>60){
  340. layer.msg('最大分值不能超过60分');
  341. return false;
  342. }
  343. }
  344. var data={
  345. exam_id:$("input[name=exam_id_m]").val(),
  346. topic_id:$("input[name=topic_id_m]").val(),
  347. answer:answer,
  348. type:$("input[name=type_m]").val(),
  349. score_m:score_m,
  350. score_half_m:score_half_m,
  351. rule:rule,
  352. step:step
  353. };
  354. $(this).attr('disabled',true);
  355. var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
  356. if(is_batch==1){
  357. postUrl="<?php echo Yii::app()->createUrl('allSubject/changeMultiRuleBatch')?>";
  358. }else{
  359. postUrl="<?php echo Yii::app()->createUrl('paper/changemulti')?>";
  360. }
  361. $.ajax({
  362. url:postUrl,
  363. data:data,
  364. dataType:'json',
  365. type:'POST',
  366. success:function(res){
  367. layer.close(alertIndex);
  368. if(res.status==1){
  369. layer.msg('更新成功',hideMulti(obj));
  370. location.reload();
  371. }else{
  372. layer.msg(res.msg);
  373. }
  374. }
  375. });
  376. });
  377. //批量更新判分规则结束
  378. $(".sumbit1").click(function(event) {
  379. if($(this).attr('disabled')=='disabled'){
  380. return false;
  381. }
  382. $(this).closest(".modal").fadeOut();
  383. if(!$("input[name=answer]").val())
  384. {
  385. layer.msg('不能为空');return;
  386. }
  387. var data={
  388. paper_id:$("input[name=paper_id]").val(),
  389. topic_id:$("input[name=topic_id]").val(),
  390. answer:$("input[name=answer]").val(),
  391. type:$("input[name=type]").val()
  392. };
  393. $(this).attr('disabled',true);
  394. var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
  395. $.post("<?php echo Yii::app()->createUrl('paper/answernew')?>",data,function(falgs){
  396. var m =falgs;
  397. layer.close(alertIndex);
  398. if(m==-1)
  399. {
  400. layer.msg('无考试');return;
  401. }else if(m==0)
  402. {
  403. layer.msg('提交失败');return;
  404. }else if(m==-2){
  405. layer.msg('参数有误');return;
  406. }else if(m==-3){
  407. layer.msg('无此题');return;
  408. }else if(m==-4){
  409. layer.msg('接口写入有误');return;
  410. }else if(m==-5){
  411. layer.msg('接口报错:Trans rollback');return;
  412. }else if(m==-6){
  413. layer.msg('校本题库答案修改失败');return;
  414. }else if(m==-7){
  415. layer.msg('校本题库答案已修改,报告无内容需要更新');return;
  416. }else{
  417. location.reload();
  418. }
  419. });
  420. });
  421. $(".sumbit").click(function(event) {
  422. if($(this).attr('disabled')=='disabled'){
  423. return false;
  424. }
  425. var type=$("input[name=type]").val();
  426. var score_m=$("input[name=score]").val();
  427. if(score_m==0 || score_m==''){
  428. layer.msg('分值不能为空');
  429. return false;
  430. }
  431. if(type==1 || type==2 || type==11){
  432. if(score_m>49){
  433. layer.msg('最大分值不能超过49分');
  434. return false;
  435. }
  436. }else if(type==5){
  437. if(score_m>49){
  438. layer.msg('最大分值不能超过49分');
  439. return false;
  440. }
  441. }else if(type==7){
  442. if(score_m>60){
  443. layer.msg('最大分值不能超过60分');
  444. return false;
  445. }
  446. }else if(type==17){
  447. if(score_m>60){
  448. layer.msg('最大分值不能超过60分');
  449. return false;
  450. }
  451. }
  452. $(this).closest(".modal").fadeOut();
  453. var data={
  454. paper_id:$("input[name=paper_id]").val(),
  455. topic_id:$("input[name=topic_id]").val(),
  456. score:$("input[name=score]").val(),
  457. type:$("input[name=type]").val()
  458. };
  459. $(this).attr('disabled',true);
  460. var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
  461. $.post("<?php echo Yii::app()->createUrl('paper/score')?>",data,function(falgs){
  462. var m =JSON.parse(falgs);
  463. layer.close(alertIndex);
  464. console.log(m);
  465. if(m.status==-1)
  466. {
  467. layer.msg('分数不能为空');return;
  468. }else if(m.status==0)
  469. {
  470. if(m.msg!=undefined){
  471. layer.msg(m.msg);
  472. }else{
  473. layer.msg('修改分数失败');
  474. }
  475. return;
  476. }else{
  477. location.reload();
  478. }
  479. });
  480. });
  481. //批量更新答案
  482. $('.update_answer_batch').click(function(){
  483. let type=parseInt($(this).attr('type'));
  484. html="";
  485. $('input[name=topicType]').val(type);
  486. largeId=$(this).attr('topic');
  487. rule_score_half=[];
  488. rule=[],topicId=[];
  489. if(type==2 || type==11){
  490. var obj=$(this).closest('.choose-topic').find('.topic');
  491. if(obj.length>0){
  492. for(var i=0;i<obj.length;i++){
  493. if(obj.eq(i).find('.rule_score_half').val()!='' && obj.eq(i).find('.rule_score_half').val()!=undefined){
  494. rule_score_half.push(obj.eq(i).find('.rule_score_half').val());
  495. }else{
  496. rule_score_half.push(obj.eq(i).find('.rule_score_half').val());
  497. }
  498. if(obj.eq(i).find('.rule_type').val()!='' && obj.eq(i).find('.rule_type').val()!=undefined){
  499. rule.push(obj.eq(i).find('.rule_type').val());
  500. }else{
  501. rule.push(1);
  502. }
  503. topicId.push(obj.eq(i).attr('id'));
  504. }
  505. }
  506. $('input[name=topicAnswerRule]').val(rule.join('///'));
  507. $('input[name=topicIds]').val(topicId.join('///'));
  508. $('input[name=topicHalfScore]').val(rule_score_half.join('///'));
  509. }
  510. if(type==0){
  511. var obj =$(this).closest('.large_title').next().children('.choose-topic');
  512. html=''
  513. for(let i=0;i<obj.length;i++){
  514. tempLargeId=obj.eq(i).find('.topic').attr('id');
  515. if(topicGroup[tempLargeId]!=undefined && topicGroup[tempLargeId].length>0){
  516. for (let i = 0; i < topicGroup[tempLargeId].length; i++) {
  517. html+='<tr>';
  518. html+='<td>'+topicGroup[tempLargeId][i][10]+'</td>';
  519. html+='<td><table align="center" width="100%" border="0" cellspacing="1" cellpadding="1" class="answerShow">';
  520. html+='<tr>';
  521. for(var j=0;j<topicGroup[tempLargeId][i][5];j++){
  522. if(topicGroup[tempLargeId][i][9]==0){
  523. if(topicGroup[tempLargeId][i][4]==answerArr[j]){
  524. html+='<td class="active answer" >'+answerArr[j]+'</td>';
  525. }else{
  526. html+='<td class=" answer" >'+answerArr[j]+'</td>';
  527. }
  528. }else{
  529. if(topicGroup[tempLargeId][i][4]==answerArr[j]){
  530. html+='<td class="active_gray " >'+answerArr[j]+'</td>';
  531. }else{
  532. html+='<td class=" " >'+answerArr[j]+'</td>';
  533. }
  534. }
  535. }
  536. html+='</tr>';
  537. html+='</table>';
  538. html+='</td>';
  539. html+='<td width="30%" class="operateLog" right="'+topicGroup[tempLargeId][i][4]+'" nowAnswer="'+topicGroup[tempLargeId][i][4]+'" topic_id="'+topicGroup[tempLargeId][i][0]+'">无更新</td>';
  540. html+='</tr>';
  541. }
  542. }
  543. }
  544. $('.answerList tbody').html(html);
  545. }else if(type==1){
  546. if(topicGroup[largeId]!=undefined && topicGroup[largeId].length>0){
  547. for (let i = 0; i < topicGroup[largeId].length; i++) {
  548. html+='<tr>';
  549. html+='<td>'+topicGroup[largeId][i][10]+'</td>';
  550. html+='<td><table align="center" width="100%" border="0" cellspacing="1" cellpadding="1" class="answerShow">';
  551. html+='<tr>';
  552. for(var j=0;j<topicGroup[largeId][i][5];j++){
  553. if(topicGroup[largeId][i][9]==0){
  554. if(topicGroup[largeId][i][4]==answerArr[j]){
  555. html+='<td class="active answer" >'+answerArr[j]+'</td>';
  556. }else{
  557. html+='<td class=" answer" >'+answerArr[j]+'</td>';
  558. }
  559. }else{
  560. if(topicGroup[largeId][i][4]==answerArr[j]){
  561. html+='<td class="active_gray" >'+answerArr[j]+'</td>';
  562. }else{
  563. html+='<td class=" " >'+answerArr[j]+'</td>';
  564. }
  565. }
  566. }
  567. html+='</tr>';
  568. html+='</table>';
  569. html+='</td>';
  570. html+='<td width="30%" class="operateLog" right="'+topicGroup[largeId][i][4]+'" nowAnswer="'+topicGroup[largeId][i][4]+'" topic_id="'+topicGroup[largeId][i][0]+'">无更新</td>';
  571. html+='</tr>';
  572. }
  573. }
  574. $('.answerList tbody').html(html);
  575. }else if(type==2){
  576. if(topicGroup[largeId]!=undefined && topicGroup[largeId].length>0){
  577. for (let i = 0; i < topicGroup[largeId].length; i++) {
  578. html+='<tr>';
  579. html+='<td>'+topicGroup[largeId][i][10]+'</td>';
  580. html+='<td><table align="center" width="100%" border="0" cellspacing="1" cellpadding="1" class="answerShow">';
  581. html+='<tr>';
  582. for(var j=0;j<topicGroup[largeId][i][5];j++){
  583. if(topicGroup[largeId][i][9]==0){
  584. if(topicGroup[largeId][i][4].indexOf(answerArr[j])==-1){
  585. html+='<td class=" answer_2" >'+answerArr[j]+'</td>';
  586. }else{
  587. html+='<td class="active answer_2" >'+answerArr[j]+'</td>';
  588. }
  589. }else{
  590. if(topicGroup[largeId][i][4].indexOf(answerArr[j])==-1){
  591. html+='<td class=" " >'+answerArr[j]+'</td>';
  592. }else{
  593. html+='<td class="active gray" >'+answerArr[j]+'</td>';
  594. }
  595. }
  596. }
  597. html+='</tr>';
  598. html+='</table>';
  599. html+='</td>';
  600. html+='<td width="30%" class="operateLog" rule="'+topicGroup[largeId][i][7]+'" right="'+topicGroup[largeId][i][4]+'" half_score="'+topicGroup[largeId][i][8]+'" nowAnswer="'+topicGroup[largeId][i][4]+'" topic_id="'+topicGroup[largeId][i][0]+'">无更新</td>';
  601. html+='</tr>';
  602. }
  603. }
  604. $('.answerList tbody').html(html);
  605. }else if(type==22){
  606. var obj =$(this).closest('.large_title').next().children('.choose-topic');
  607. html=''
  608. for(let i=0;i<obj.length;i++){
  609. tempLargeId=obj.eq(i).find('.topic').attr('id');
  610. if(topicGroup[tempLargeId]!=undefined && topicGroup[tempLargeId].length>0){
  611. for (let i = 0; i < topicGroup[tempLargeId].length; i++) {
  612. html+='<tr>';
  613. html+='<td>'+topicGroup[tempLargeId][i][10]+'</td>';
  614. html+='<td><table align="center" width="100%" border="0" cellspacing="1" cellpadding="1" class="answerShow">';
  615. html+='<tr>';
  616. for(var j=0;j<topicGroup[tempLargeId][i][5];j++){
  617. if(topicGroup[tempLargeId][i][4].indexOf(answerArr[j])==-1){
  618. html+='<td class=" answer_2" >'+answerArr[j]+'</td>';
  619. }else{
  620. html+='<td class="active answer_2" >'+answerArr[j]+'</td>';
  621. }
  622. }
  623. html+='</tr>';
  624. html+='</table>';
  625. html+='</td>';
  626. html+='<td width="30%" class="operateLog" rule="'+topicGroup[tempLargeId][i][7]+'" right="'+topicGroup[tempLargeId][i][4]+'" half_score="'+topicGroup[tempLargeId][i][8]+'" nowAnswer="'+topicGroup[tempLargeId][i][4]+'" topic_id="'+topicGroup[tempLargeId][i][0]+'">无更新</td>';
  627. html+='</tr>';
  628. }
  629. }
  630. }
  631. $('.answerList tbody').html(html);
  632. }else if(type==12){
  633. if(topicGroup[largeId]!=undefined && topicGroup[largeId].length>0){
  634. for (let i = 0; i < topicGroup[largeId].length; i++) {
  635. html+='<tr>';
  636. html+='<td>'+topicGroup[largeId][i][10]+'</td>';
  637. html+='<td><table align="center" width="100%" border="0" cellspacing="1" cellpadding="1" class="answerShow">';
  638. html+='<tr>';
  639. for(var j=0;j<topicGroup[largeId][i][5];j++){
  640. if(topicGroup[largeId][i][4]==answerArrRight[j]){
  641. html+='<td class="active answer" >'+answerArrT[j]+'</td>';
  642. }else{
  643. html+='<td class=" answer" >'+answerArrT[j]+'</td>';
  644. }
  645. }
  646. html+='</tr>';
  647. html+='</table>';
  648. html+='</td>';
  649. html+='<td width="30%" class="operateLog" right="'+topicGroup[largeId][i][4]+'" nowAnswer="'+topicGroup[largeId][i][4]+'" topic_id="'+topicGroup[largeId][i][0]+'">无更新</td>';
  650. html+='</tr>';
  651. }
  652. }
  653. $('.answerList tbody').html(html);
  654. }
  655. $('#updateAnswerBatch').show();
  656. });
  657. //主观题修改分值
  658. $('.change-score_batch').click(function(){
  659. let html='',titleHtml='';
  660. let largeId=$(this).attr('topic');
  661. if(topicGroup[largeId]!=undefined && topicGroup[largeId].length>0){
  662. var totalScore=0;
  663. for (let i = 0; i < topicGroup[largeId].length; i++) {
  664. html+='<p><span>第'+topicGroup[largeId][i][10]+'题</span><input type="text" class="topic_score" name="'+topicGroup[largeId][i][2]+'" value="'+topicGroup[largeId][i][1]+'">分 ';
  665. html+='</p>';
  666. totalScore +=parseInt(topicGroup[largeId][i][1]);
  667. }
  668. titleHtml+='<p><span>总分:</span><input type="text" class="total_score" name="total_score" value="'+totalScore+'" /><button class="avg">平均分配</button></p>';
  669. }
  670. html=titleHtml+html;
  671. $('#classModal').find('.class-modal-body').html(html);
  672. $('input[name=topic_type_action]').val(5);
  673. $('#classModal').show();
  674. });
  675. //批量修改单选题分值
  676. $('.up_score').click(function(){
  677. let html='',titleHtml='';
  678. let largeId=$(this).attr('topic');
  679. let type=$(this).attr('type');
  680. if(type==0){
  681. var obj =$(this).closest('.large_title').next().children('.choose-topic');
  682. html=''
  683. var totalScore=0;
  684. var isSend=false;
  685. for(let i=0;i<obj.length;i++){
  686. tempLargeId=obj.eq(i).find('.topic').attr('id');
  687. if(topicGroup[tempLargeId]!=undefined && topicGroup[tempLargeId].length>0){
  688. for (let i = 0; i < topicGroup[tempLargeId].length; i++) {
  689. if(topicGroup[tempLargeId][i][9]==0){
  690. html+='<p><span>第'+topicGroup[tempLargeId][i][10]+'题</span><input type="text" class="topic_score" name="'+topicGroup[tempLargeId][i][2]+'" value="'+topicGroup[tempLargeId][i][1]+'">分 ';
  691. html+='</p>';
  692. totalScore +=parseInt(topicGroup[tempLargeId][i][1]);
  693. }else{
  694. isSend=true;
  695. html+='<p><span>第'+topicGroup[tempLargeId][i][10]+'题</span><input type="text" class="topic_score" style="background: #ccc" readonly name="'+topicGroup[tempLargeId][i][2]+'" value="'+topicGroup[tempLargeId][i][1]+'">分 ';
  696. html+='</p>';
  697. totalScore +=parseInt(topicGroup[tempLargeId][i][1]);
  698. }
  699. }
  700. }
  701. }
  702. if(isSend){
  703. titleHtml+='<p><span>总分:</span><input type="text" class="" name="" value="'+totalScore+'" /><button class="gray">平均分配</button></p>';
  704. }else{
  705. titleHtml+='<p><span>总分:</span><input type="text" class="total_score" name="total_score" value="'+totalScore+'" /><button class="avg">平均分配</button></p>';
  706. }
  707. }else{
  708. if(topicGroup[largeId]!=undefined && topicGroup[largeId].length>0){
  709. var totalScore=0;
  710. var isSend=false;
  711. for (let i = 0; i < topicGroup[largeId].length; i++) {
  712. if(topicGroup[largeId][i][9]==0){
  713. html+='<p><span>第'+topicGroup[largeId][i][10]+'题</span><input type="text" class="topic_score" name="'+topicGroup[largeId][i][2]+'" value="'+topicGroup[largeId][i][1]+'">分 ';
  714. html+='</p>';
  715. totalScore +=parseInt(topicGroup[largeId][i][1]);
  716. }else{
  717. isSend=true;
  718. html+='<p><span>第'+topicGroup[largeId][i][10]+'题</span><input type="text" class="topic_score" style="background: #ccc" readonly name="'+topicGroup[largeId][i][2]+'" value="'+topicGroup[largeId][i][1]+'">分 ';
  719. html+='</p>';
  720. totalScore +=parseInt(topicGroup[largeId][i][1]);
  721. }
  722. }
  723. if(isSend){
  724. titleHtml+='<p><span>总分:</span><input type="text" class="" name="" value="'+totalScore+'" /><button class="gray">平均分配</button></p>';
  725. }else{
  726. titleHtml+='<p><span>总分:</span><input type="text" class="total_score" name="total_score" value="'+totalScore+'" /><button class="avg">平均分配</button></p>';
  727. }
  728. }
  729. }
  730. html=titleHtml+html;
  731. $('#classModal').find('.class-modal-body').html(html);
  732. $('input[name=topic_type_action]').val(1);
  733. $('#classModal').show();
  734. });
  735. //批量更改分值
  736. $('.update_score_batch').click(function(){
  737. let type=parseInt($(this).attr('type'));
  738. let html='',titleHtml='';
  739. let largeId=$(this).attr('topic');
  740. //读取答案
  741. var topicAnswer=[];
  742. var topicId=[];
  743. var rule=[];
  744. if(type==22){
  745. var obj =$(this).closest('.large_title').next().children('.choose-topic').find('.topic');
  746. }else{
  747. var obj=$(this).closest('.choose-topic').find('.topic');
  748. }
  749. if(obj.length>0){
  750. for(var i=0;i<obj.length;i++){
  751. if(obj.eq(i).find('.rule_answer').val()!='' && obj.eq(i).find('.rule_answer').val()!=undefined){
  752. topicAnswer.push(obj.eq(i).find('.rule_answer').val());
  753. }else{
  754. topicAnswer.push(obj.eq(i).find('.right-answer').val());
  755. }
  756. if(obj.eq(i).find('.rule_type').val()!='' && obj.eq(i).find('.rule_type').val()!=undefined){
  757. rule.push(obj.eq(i).find('.rule_type').val());
  758. }else{
  759. rule.push(1);
  760. }
  761. topicId.push(obj.eq(i).attr('id'));
  762. }
  763. }
  764. $('input[name=topicAnswer]').val(topicAnswer.join('///'));
  765. $('input[name=topicRule]').val(rule.join('///'));
  766. $('input[name=topicIds]').val(topicId.join('///'));
  767. if(type==22){
  768. var obj =$(this).closest('.large_title').next().children('.choose-topic');
  769. html=''
  770. var totalScore=0;
  771. for(let i=0;i<obj.length;i++){
  772. tempLargeId=obj.eq(i).find('.topic').attr('id');
  773. if(topicGroup[tempLargeId]!=undefined && topicGroup[tempLargeId].length>0){
  774. for (let i = 0; i < topicGroup[tempLargeId].length; i++) {
  775. html+='<p><span>第'+topicGroup[tempLargeId][i][10]+'题</span><input type="text" class="topic_multi_score" name="topic_multi_score'+topicGroup[tempLargeId][i][2]+'" value="'+topicGroup[tempLargeId][i][1]+'">分 ';
  776. html+=' 半对<input type="text" class="new_half_score" name="half_score_'+topicGroup[tempLargeId][i][2]+'" value="'+topicGroup[tempLargeId][i][8]+'">分';
  777. html+='</p>';
  778. totalScore +=parseInt(topicGroup[tempLargeId][i][1]);
  779. }
  780. }
  781. }
  782. titleHtml+='<p><span>总分:</span><input type="text" class="total_multi_score" name="total_multi_score" value="'+totalScore+'" /><button class="avg_multi">平均分配</button></p>';
  783. }else{
  784. if(topicGroup[largeId]!=undefined && topicGroup[largeId].length>0){
  785. var totalScore=0;
  786. for (let i = 0; i < topicGroup[largeId].length; i++) {
  787. html+='<p><span>第'+topicGroup[largeId][i][10]+'题</span><input type="text" class="topic_multi_score" name="topic_multi_score'+topicGroup[largeId][i][2]+'" value="'+topicGroup[largeId][i][1]+'">分 ';
  788. html+=' 半对<input type="text" class="new_half_score" name="half_score_'+topicGroup[largeId][i][2]+'" value="'+topicGroup[largeId][i][8]+'">分';
  789. html+='</p>';
  790. totalScore +=parseInt(topicGroup[largeId][i][1]);
  791. }
  792. titleHtml+='<p><span>总分:</span><input type="text" class="total_multi_score" name="total_multi_score" value="'+totalScore+'" /><button class="avg_multi">平均分配</button></p>';
  793. }
  794. }
  795. html=titleHtml+html;
  796. $('.multiSelectScore').html(html);
  797. $('#classModalMulti').show();
  798. });
  799. //单个更新规则
  800. $(".change_multi_answer").click(function () {
  801. var step=$(this).attr('step');
  802. if(step==1){
  803. $('.total_score').hide();
  804. $('.half_score').hide();
  805. $('.model-score-m').hide();
  806. $('.tig-txt').hide();
  807. }else if(step==2){
  808. $('.model-rule').hide();
  809. $('.total_score').hide();
  810. $('.half_score').hide();
  811. $('.model-score-m').show();
  812. }else if(step==3){
  813. $('.model-rule').hide();
  814. $('.total_score').show();
  815. $('.half_score').show();
  816. $('.batch').hide();
  817. $('.tig-txt').hide();
  818. }
  819. obj=$(this).closest('.choose-topic').find('.topic');
  820. $('.title-txt').html("题号:"+obj.find('.order').attr('order_id'));
  821. $(".modal1_multi").fadeIn();
  822. $("#topic_order_m").html("题号:"+obj.find('.order').attr('order_id'));
  823. $("input[name=topic_id_m]").val($(this).attr('topic'));
  824. $("input[name=type_m]").val($(this).attr('type'));
  825. $("input[name=step]").val(step);
  826. //判断是否修改过规则
  827. var ruleAnswer=$(this).closest('.choose-topic').find('.rule_answer').val(),
  828. ruleType=$(this).closest('.choose-topic').find('.rule_type').val(),
  829. ruleScoreHalf=$(this).closest('.choose-topic').find('.rule_score_half').val();
  830. var rightAnswer=$(this).closest('.choose-topic').find('.right-answer').val();
  831. if(ruleType!=0 ){
  832. if(ruleAnswer!=''){
  833. $("input[name=answer_m]").val(ruleAnswer);
  834. // $("input[name=answer_student]").val(ruleAnswer);
  835. }else{
  836. $("input[name=answer_m]").val(rightAnswer);
  837. // $("input[name=answer_student]").val(rightAnswer);
  838. }
  839. $("input[name=score_half_m]").val(ruleScoreHalf);
  840. var index=parseInt(ruleType)-1;
  841. $('input[name=rule]').eq(index).prop("checked",'checked');
  842. rightAnswer=ruleAnswer;
  843. }else{
  844. $('input[name=score_half_m]').val(0);
  845. $("input[name=answer_m]").val(rightAnswer);
  846. $("input[name=answer_student]").val(rightAnswer);
  847. }
  848. $("input[name=score_m]").val($(this).attr('score'));
  849. });
  850. //更改答案
  851. $(".change-answer").click(function(){
  852. $(".modal1").fadeIn();
  853. obj=$(this).closest('.choose-topic').find('.topic');
  854. $("#topic_order1").html("题号:"+obj.find('.order').attr('order_id'));
  855. $("input[name=topic_id]").val(obj.attr('id'));
  856. $("input[name=type]").val($(this).attr('type'));
  857. });
  858. //更改分值
  859. $(".change-score").click(function(){
  860. console.log('change-score');
  861. $(".modal").fadeIn();
  862. obj=$(this).closest('.choose-topic').find('.topic');
  863. $("#topic_order").html("题号:"+obj.find('.order').attr('order_id'));
  864. $("input[name=topic_id]").val(obj.attr('id'));
  865. $("input[name=type]").val($(this).attr('type'));
  866. $("input[name=score]").val('');
  867. if($(this).attr('type')==1 || $(this).attr('type')==11 || $(this).attr('type')==2){
  868. $('.red-tig').hide();
  869. }else{
  870. $('.red-tig').show();
  871. }
  872. });
  873. //修改文理综试题科目
  874. $(".change-topic-subject").click(function(){
  875. $(".modal_subject").fadeIn();
  876. var old_subject=$(this).attr('subject-name');
  877. var old_subject_id=$(this).attr('subject');
  878. $('.oldSubjectName').html('原科目:'+old_subject);
  879. $("input[name=topic_id_subject]").val($(this).attr('topic'));
  880. $("input[name=old_subject_id]").val(old_subject_id);
  881. });
  882. /* 修改分数弹层*/
  883. $(".close").click(function(event) {
  884. $(".sumbit").attr('disabled',false);
  885. layer.closeAll();
  886. $(this).closest(".modal").fadeOut();
  887. });
  888. $(".close1").click(function(event) {
  889. $(".sumbit1").attr('disabled',false);
  890. layer.closeAll();
  891. $(this).closest(".modal1").fadeOut();
  892. });
  893. $(".close2").click(function(event) {
  894. $(".sumbit2").attr('disabled',false);
  895. layer.closeAll();
  896. $(this).closest(".modal2").fadeOut();
  897. });
  898. $(".close3").click(function(event) {
  899. $(".sumbit3").attr('disabled',false);
  900. layer.closeAll();
  901. hideMulti($(this));
  902. });
  903. $(".close_student").click(function(event) {
  904. $(".sumbit_student").attr('disabled',false);
  905. layer.closeAll();
  906. $(this).closest(".modal_student").fadeOut();
  907. });
  908. $(".close_subject").click(function(event) {
  909. $(".sumbit_subject").attr('disabled',false);
  910. layer.closeAll();
  911. $(this).closest(".modal_subject").fadeOut();
  912. });
  913. $('.icon-close,.exam-close').click(function(){
  914. $(this).closest('.confirmbox-mask').hide();
  915. });
  916. function hideMulti(obj) {
  917. obj.closest(".modal1_multi").hide();
  918. $('#update_msg').html('');
  919. obj.closest(".modal1_multi").find('input[name=rule]').eq(1).prop('checked',true);
  920. $('input[name=answer_m]').val('');
  921. $('input[name=score_m]').val(5);
  922. $('input[name=score_half_m]').val(3);
  923. $('input[name=is_batch]').val(0);
  924. $('input[name=score_half_h]').val('');
  925. $('.total_score').show();
  926. $('.half_score').show();
  927. $('.model-rule').show();
  928. $('.model-score-m').show();
  929. $('.batch').show();
  930. $('.tig-txt').show();
  931. }
  932. function checkFloat(num){
  933. num=String(num);
  934. arr=num.split(".");
  935. //console.log(arr[1]);
  936. if(arr[1]==undefined){
  937. return true;
  938. }else if(arr[1]==5){
  939. return true;
  940. }
  941. return false;
  942. }
  943. function checkFloat1(num){
  944. num=String(num);
  945. arr=num.split(".");
  946. if(arr.length<3){
  947. return true;
  948. }
  949. return false;
  950. }
  951. $('.save_multi_score').click(function(){
  952. if($(this).attr('disabled')=='disabled'){
  953. return false;
  954. }
  955. let topicAnswer=$('input[name=topicAnswer]').val();
  956. let topicRule=$('input[name=topicRule]').val();
  957. let topicIds=$('input[name=topicIds]').val();
  958. let topicScore=[],topicHalfScore=[];
  959. for(var i=0;i<$('.topic_multi_score').length;i++){
  960. if($('.topic_multi_score').eq(i).val()==0 || $('.topic_multi_score').eq(i).val()==''){
  961. layer.msg('请填写题目分数!');
  962. return false;
  963. }
  964. if(parseInt($('.topic_multi_score').eq(i).val())>49){
  965. layer.msg('选择题分数上限为49分!');
  966. return false;
  967. }
  968. if(parseInt($('.topic_multi_score').eq(i).val())<1){
  969. layer.msg('选择题分数不能小于1分!');
  970. return false;
  971. }
  972. if( $('.new_half_score').eq(i).val()=='' || parseFloat($('.new_half_score').eq(i).val())<0 || !checkFloat1($('.new_half_score').eq(i).val()) ){
  973. layer.msg('请填写正确的题目半对分数!');
  974. return false;
  975. }
  976. if( parseFloat($('.new_half_score').eq(i).val())>parseInt($('.topic_multi_score').eq(i).val())){
  977. layer.msg('半对分不能大于满分!');
  978. return false;
  979. }
  980. topicScore.push($('.topic_multi_score').eq(i).val());
  981. topicHalfScore.push($('.new_half_score').eq(i).val());
  982. }
  983. topicAnswerArr=topicAnswer.split('///');
  984. topicRuleArr=topicRule.split('///');
  985. topicIdArr=topicIds.split('///');
  986. let update_answers=[];
  987. for(var i=0;i<topicAnswerArr.length;i++){
  988. update_answers.push({topicId:topicIdArr[i],topicAnswer:topicAnswerArr[i],topicRule:topicRuleArr[i],topicScore:topicScore[i],topicHalfScore:topicHalfScore[i]});
  989. }
  990. console.log(update_answers);
  991. data={
  992. update_answers:update_answers,
  993. exam_id:$("input[name=exam_id]").val(),
  994. change_obj:'score'
  995. };
  996. $(this).attr('disabled',true);
  997. var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
  998. $.ajax({
  999. url:"<?php echo $this->createUrl('paper/updateMultiAnswerBatch')?>",
  1000. data:data,
  1001. dataType:'json',
  1002. type:'POST',
  1003. success:function(res){
  1004. layer.close(alertIndex);
  1005. if(res.status==1){
  1006. layer.msg('更新成功');
  1007. location.reload();
  1008. }else{
  1009. layer.msg(res.msg);
  1010. }
  1011. }
  1012. });
  1013. });
  1014. $('.saveAnswerBatch').click(function(){
  1015. if($(this).attr('disabled')=='disabled'){
  1016. return false;
  1017. }
  1018. let updateAnswerArr=[];
  1019. let topicType=$('input[name=topicType]').val();
  1020. let score_half_m=$("input[name=topicHalfScore]").val();
  1021. $.each($('.operateLog'),function(i,v){
  1022. let oldAnswer=$(v).attr('right'),
  1023. newAnswer=$(v).attr('nowAnswer'),
  1024. topicRule=$(v).attr('rule'),
  1025. topicHalfScore=$(v).attr('half_score'),
  1026. topicId=$(v).attr('topic_id');
  1027. if(newAnswer==''){
  1028. layer.msg('答案不能为空');
  1029. return false;
  1030. }
  1031. if(oldAnswer!=newAnswer){
  1032. updateAnswerArr.push({topicId,newAnswer,topicRule,topicHalfScore});
  1033. }
  1034. })
  1035. if(updateAnswerArr.length==0){
  1036. layer.msg('答案无更新');
  1037. return false;
  1038. }
  1039. var data={
  1040. exam_id:$("input[name=exam_id]").val(),
  1041. paper_id:$("input[name=paper_id]").val(),
  1042. update_answers:updateAnswerArr,
  1043. score_half_m:score_half_m,
  1044. change_obj:'answer'
  1045. };
  1046. obj=$(this);
  1047. $(this).attr('disabled',true);
  1048. var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
  1049. if(topicType==1 || topicType==12 || topicType==0){
  1050. postUrl="<?php echo $this->createUrl('paper/updateAnswerBatch')?>";
  1051. }else{
  1052. postUrl="<?php echo $this->createUrl('paper/updateMultiAnswerBatch')?>";
  1053. }
  1054. $.ajax({
  1055. url:postUrl,
  1056. data:data,
  1057. dataType:'json',
  1058. type:'POST',
  1059. success:function(res){
  1060. layer.close(alertIndex);
  1061. if(res.status==1){
  1062. layer.msg('更新成功');
  1063. location.reload();
  1064. }else{
  1065. obj.attr('disabled',false);
  1066. layer.msg(res.msg);
  1067. }
  1068. }
  1069. });
  1070. });
  1071. //批量更新单选题分数
  1072. $('.save_score').click(function(){
  1073. var topicScore={};
  1074. for(var i=0;i<$('.topic_score').length;i++){
  1075. if($('.topic_score').eq(i).val()==0 || $('.topic_score').eq(i).val()==''){
  1076. layer.msg('请填写题目分数!');
  1077. return false;
  1078. }
  1079. if(parseInt($('.topic_score').eq(i).val())>49){
  1080. layer.msg('选择题分数上限为49分!');
  1081. return false;
  1082. }
  1083. var order=$('.topic_score').eq(i).attr('name');
  1084. var score=$('.topic_score').eq(i).val();
  1085. topicScore[order]=score;
  1086. }
  1087. action=$('input[name=topic_type_action]').val();
  1088. $(this).attr('disabled',true);
  1089. obj=$(this);
  1090. //批量更新分数
  1091. if(action==1){
  1092. $.ajax({
  1093. url:'<?php echo $this->createUrl('allSubject/updateScoreBatch')?>',
  1094. type:'POST',
  1095. dataType:'json',
  1096. data:{scores:topicScore,paper_id:$("input[name=paper_id]").val()},
  1097. success:function(res){
  1098. if(res.status==1){
  1099. layer.msg('修改成功',{icon:1,time:2000},function () {
  1100. window.location.reload();
  1101. });
  1102. }else{
  1103. if(res.msg!=undefined){
  1104. layer.msg(res.msg)
  1105. obj.attr('disabled',false);
  1106. }else{
  1107. layer.msg('修改失败',{icon:1,time:2000},function () {
  1108. window.location.reload();
  1109. });
  1110. }
  1111. }
  1112. }
  1113. });
  1114. }else{
  1115. var data={
  1116. paper_id:$("input[name=paper_id]").val(),
  1117. topic_id:$("input[name=topic_id]").val(),
  1118. score:$("input[name=score]").val(),
  1119. type:$("input[name=type]").val()
  1120. };
  1121. $.post("<?php echo Yii::app()->createUrl('paper/score')?>",data,function(falgs){
  1122. var m =JSON.parse(falgs);
  1123. layer.close(alertIndex);
  1124. console.log(m);
  1125. if(m.status==-1)
  1126. {
  1127. layer.msg('分数不能为空');return;
  1128. }else if(m.status==0)
  1129. {
  1130. if(m.msg!=undefined){
  1131. layer.msg(m.msg);
  1132. }else{
  1133. layer.msg('修改分数失败');
  1134. }
  1135. return;
  1136. }else{
  1137. location.reload();
  1138. }
  1139. });
  1140. }
  1141. });
  1142. $(".sumbit").click(function(event) {
  1143. if($(this).attr('disabled')=='disabled'){
  1144. return false;
  1145. }
  1146. var type=$("input[name=type]").val();
  1147. var score_m=$("input[name=score]").val();
  1148. if(score_m==0 || score_m==''){
  1149. layer.msg('分值不能为空');
  1150. return false;
  1151. }
  1152. if(type==1 || type==2 || type==11){
  1153. if(score_m>49){
  1154. layer.msg('最大分值不能超过49分');
  1155. return false;
  1156. }
  1157. }else if(type==5){
  1158. if(score_m>49){
  1159. layer.msg('最大分值不能超过49分');
  1160. return false;
  1161. }
  1162. }else if(type==7){
  1163. if(score_m>60){
  1164. layer.msg('最大分值不能超过60分');
  1165. return false;
  1166. }
  1167. }else if(type==17){
  1168. if(score_m>60){
  1169. layer.msg('最大分值不能超过60分');
  1170. return false;
  1171. }
  1172. }
  1173. $(this).closest(".modal").fadeOut();
  1174. var data={
  1175. paper_id:$("input[name=paper_id]").val(),
  1176. topic_id:$("input[name=topic_id]").val(),
  1177. score:$("input[name=score]").val(),
  1178. type:$("input[name=type]").val()
  1179. };
  1180. $(this).attr('disabled',true);
  1181. var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
  1182. $.post("<?php echo Yii::app()->createUrl('paper/score')?>",data,function(falgs){
  1183. var m =JSON.parse(falgs);
  1184. layer.close(alertIndex);
  1185. console.log(m);
  1186. if(m.status==-1)
  1187. {
  1188. layer.msg('分数不能为空');return;
  1189. }else if(m.status==0)
  1190. {
  1191. if(m.msg!=undefined){
  1192. layer.msg(m.msg);
  1193. }else{
  1194. layer.msg('修改分数失败');
  1195. }
  1196. return;
  1197. }else{
  1198. location.reload();
  1199. }
  1200. });
  1201. });
  1202. /* 上移试题 */
  1203. $("body").delegate('.batch_topic .up', 'click', function(event) {
  1204. var data={
  1205. paper_id:$(this).attr('paper_id'),
  1206. topic_id:$(this).attr('topic'),
  1207. action:'up'
  1208. };
  1209. $.post("<?php echo Yii::app()->createUrl('paper/moveBatch')?>",data,function(falgs){
  1210. var m =JSON.parse(falgs);
  1211. layer.closeAll();
  1212. console.log(m);
  1213. if(m.status==1)
  1214. {
  1215. window.location.reload();
  1216. }else if(m.status==0)
  1217. {
  1218. if(m.msg!=undefined){
  1219. layer.msg(m.msg);
  1220. }else{
  1221. layer.msg('移动失败');
  1222. }
  1223. return;
  1224. }
  1225. });
  1226. });
  1227. /* 下移试题 */
  1228. $("body").delegate('.batch_topic .down', 'click', function(event) {
  1229. var data={
  1230. paper_id:$(this).attr('paper_id'),
  1231. topic_id:$(this).attr('topic'),
  1232. action:'down'
  1233. };
  1234. $.post("<?php echo Yii::app()->createUrl('paper/moveBatch')?>",data,function(falgs){
  1235. var m =JSON.parse(falgs);
  1236. layer.closeAll();
  1237. console.log(m);
  1238. if(m.status==1)
  1239. {
  1240. window.location.reload();
  1241. }else if(m.status==0)
  1242. {
  1243. if(m.msg!=undefined){
  1244. layer.msg(m.msg);
  1245. }else{
  1246. layer.msg('移动失败');
  1247. }
  1248. }
  1249. });
  1250. });
  1251. $('.sendPoints').click(function(){
  1252. let topicId=$(this).attr('topic');
  1253. let paperId=$(this).attr('paper_id');
  1254. let actionType=$(this).attr('action_type');
  1255. msg='';
  1256. if(actionType==1){
  1257. $('input[name=paperId]').val(paperId);
  1258. $('input[name=topicId]').val(topicId);
  1259. $('#sendScore').show();
  1260. }else{
  1261. if($(this).attr('disabled')=='disabled'){
  1262. return false;
  1263. }
  1264. msg='0分题每题只可设置一次,且不可撤销,请谨慎操作';
  1265. indexmsg=layer.confirm(msg, {
  1266. btn: ['确定', '取消'] //按钮
  1267. }, function () {
  1268. $('.sendPoints').attr('disabled',true);
  1269. layer.close(indexmsg);
  1270. layer.msg('更新中请稍候。。。。。。',{time:0});
  1271. $.ajax({
  1272. url:"<?php echo $this->createUrl('paper/sendPoints')?>",
  1273. data:{actype:actionType,paper_id:paperId,topic_id:topicId},
  1274. dataType:'json',
  1275. type:'POST',
  1276. success:function(res){
  1277. if(res.status==1){
  1278. layer.msg('更新成功');
  1279. location.reload();
  1280. }else{
  1281. if(res.msg!=undefined){
  1282. layer.msg(res.msg);
  1283. }else{
  1284. layer.msg('更新失败');
  1285. }
  1286. }
  1287. }
  1288. });
  1289. })
  1290. }
  1291. });
  1292. $('.saveSendScoreBtn').click(function(){
  1293. answer=$('input[name=sendScoreAnswer]').val();
  1294. if(answer==''){
  1295. layer.msg('请选择送分答案');
  1296. }
  1297. let topicId=$('input[name=topicId]').val();
  1298. let paperId=$('input[name=paperId]').val();
  1299. if($(this).attr('disabled')=='disabled'){
  1300. return false;
  1301. }
  1302. msg='送分题每题只可设置一次,且不可撤销,请谨慎操作';
  1303. indexmsg=layer.confirm(msg, {
  1304. btn: ['确定', '取消'] //按钮
  1305. }, function () {
  1306. $('.saveSendScoreBtn').attr('disabled',true);
  1307. layer.close(indexmsg);
  1308. layer.msg('更新中请稍候。。。。。。',{time:0});
  1309. $.ajax({
  1310. url:"<?php echo $this->createUrl('paper/sendScore')?>",
  1311. data:{answer:answer,paper_id:paperId,topic_id:topicId},
  1312. dataType:'json',
  1313. type:'POST',
  1314. success:function(res){
  1315. if(res.status==1){
  1316. layer.msg('更新成功');
  1317. location.reload();
  1318. }else{
  1319. if(res.msg!=undefined){
  1320. layer.msg(res.msg);
  1321. }else{
  1322. layer.msg('更新失败');
  1323. }
  1324. }
  1325. }
  1326. });
  1327. })
  1328. });
  1329. $('.answerList')
  1330. .on('click','.answer',function(){
  1331. if(!$(this).hasClass('active')){
  1332. showLogObj=$(this).closest('table').closest('tr').find('.operateLog');
  1333. $(this).closest('table').find('.answer').removeClass('active');
  1334. $(this).addClass('active');
  1335. $oldAnswer=showLogObj.attr('right');
  1336. clickAnswer=$(this).html();
  1337. if(clickAnswer=='√'){
  1338. clickAnswer='T';
  1339. }
  1340. if(clickAnswer=='×'){
  1341. clickAnswer='F';
  1342. }
  1343. if(clickAnswer==$oldAnswer){
  1344. showLogObj.html("无更新");
  1345. showLogObj.removeClass('red-tig');
  1346. }else{
  1347. if(showLogObj.attr('right')=='T' || showLogObj.attr('right')=='F'){
  1348. if(subjectId!=8){
  1349. if(showLogObj.attr('right')=='T'){
  1350. showLogObj.html("√改为"+$(this).html());
  1351. }else{
  1352. showLogObj.html("×改为"+$(this).html());
  1353. }
  1354. }else{
  1355. showLogObj.html(showLogObj.attr('right')+"改为"+$(this).html());
  1356. }
  1357. }else{
  1358. showLogObj.html(showLogObj.attr('right')+"改为"+$(this).html());
  1359. }
  1360. showLogObj.addClass('red-tig');
  1361. }
  1362. showLogObj.attr('nowAnswer',clickAnswer);
  1363. }
  1364. })
  1365. .on('click','.answer_2',function(){
  1366. showLogObj=$(this).closest('table').closest('tr');
  1367. $oldAnswer=showLogObj.find('.operateLog').attr('right');
  1368. if(!$(this).hasClass('active')){
  1369. $(this).addClass('active');
  1370. }else{
  1371. if(showLogObj.find('.active').length<=1){
  1372. layer.msg('多选题答案不能少于一个');
  1373. return false;
  1374. }
  1375. $(this).removeClass('active');
  1376. }
  1377. console.log(showLogObj.find('.active').length);
  1378. var nowAnswer=[];
  1379. $.each(showLogObj.find('.answer_2'),function(i,v){
  1380. if($(v).hasClass('active')){
  1381. nowAnswer.push($(v).html())
  1382. }
  1383. })
  1384. if($oldAnswer==nowAnswer.join(',')){
  1385. showLogObj.find('.operateLog').html('无更新');
  1386. showLogObj.find('.operateLog').removeClass('red-tig');
  1387. }else{
  1388. showLogObj.find('.operateLog').html($oldAnswer+"改为"+nowAnswer.join(','));
  1389. showLogObj.find('.operateLog').addClass('red-tig');
  1390. }
  1391. showLogObj.find('.operateLog').attr('nowAnswer',nowAnswer.join(','));
  1392. })
  1393. .on('click','.answer_3',function(){
  1394. showLogObj=$(this).closest('table').closest('tr');
  1395. $oldAnswer=showLogObj.find('.operateLog').attr('right');
  1396. if(!$(this).hasClass('active')){
  1397. $(this).addClass('active');
  1398. }else{
  1399. if(showLogObj.find('.active').length<=1){
  1400. layer.msg('送分题答案不能少于一个');
  1401. return false;
  1402. }
  1403. $(this).removeClass('active');
  1404. }
  1405. var nowAnswer=[];
  1406. $.each(showLogObj.find('.answer_3'),function(i,v){
  1407. if($(v).hasClass('active')){
  1408. nowAnswer.push($(v).html())
  1409. }
  1410. })
  1411. $('input[name=sendScoreAnswer]').val(nowAnswer.join(','));
  1412. })
  1413. $('.multiSelectScore')
  1414. .on('click','.avg_multi',function(){
  1415. var total_score=$('input[name=total_multi_score]').val();
  1416. var topic_count=$('.topic_multi_score').length;
  1417. if(total_score==0 || total_score==''){
  1418. layer.msg('请填写题目总分!');
  1419. }else{
  1420. var avg_score=total_score/topic_count;
  1421. if(checkFloat(avg_score)==false){
  1422. $('.avg_multi_result').html('无法平均分配');
  1423. $('.avg_multi_result').addClass('red');
  1424. }else{
  1425. $('.avg_multi_result').html('');
  1426. for(var i=1;i<=topic_count;i++){
  1427. $('.topic_multi_score').val(avg_score);
  1428. }
  1429. }
  1430. }
  1431. })
  1432. $('.class-modal-body')
  1433. .on('click','.avg',function(){
  1434. var total_score=$('input[name=total_score]').val();
  1435. var topic_count=$('.topic_score').length;
  1436. if(total_score==0 || total_score==''){
  1437. layer.msg('请填写题目总分!');
  1438. }else{
  1439. var avg_score=total_score/topic_count;
  1440. if(checkFloat(avg_score)==false){
  1441. $('.avg_result').html('无法平均分配');
  1442. $('.avg_result').addClass('red');
  1443. }else{
  1444. $('.avg_result').html('');
  1445. for(var i=1;i<=topic_count;i++){
  1446. $('.topic_score').val(avg_score);
  1447. }
  1448. }
  1449. }
  1450. })
  1451. .on('change','.total_score',function(){
  1452. $(this).val($(this).val().replace(/[^\d+]/g,""));
  1453. if(checkFloat($(this).val())==false){
  1454. layer.msg('分数设置不正确!');
  1455. $(this).val(0);
  1456. }
  1457. if( $(this).val()!=''){
  1458. $(this).val(parseFloat($(this).val()));
  1459. }
  1460. $('.topic_score').val(0);
  1461. $('#topic_error').html('');
  1462. })
  1463. .on('change','.total_multi_score',function(){
  1464. $(this).val($(this).val().replace(/[^\d+]/g,""));
  1465. if(checkFloat($(this).val())==false){
  1466. layer.msg('分数设置不正确!');
  1467. $(this).val(0);
  1468. }
  1469. if( $(this).val()!=''){
  1470. $(this).val(parseFloat($(this).val()));
  1471. }
  1472. $('.topic_multi_score').val(0);
  1473. $('.new_half_score').val(0);
  1474. $('#topic_error').html('');
  1475. })
  1476. .on('change','.topic_score',function(){
  1477. $(this).val($(this).val().replace(/[^\d+]/g,""));
  1478. if(checkFloat($(this).val())==false){
  1479. layer.msg('分数设置不正确!');
  1480. $(this).val(0);
  1481. }
  1482. if( $(this).val()!=''){
  1483. $(this).val(parseFloat($(this).val()));
  1484. }
  1485. var sum=0;
  1486. for(var i=0;i<$('.topic_score').length;i++){
  1487. if($('.topic_score').eq(i).val()!=''){
  1488. sum+=parseFloat($('.topic_score').eq(i).val());
  1489. }
  1490. }
  1491. $('.total_score').val(sum);
  1492. $('#topic_error').html('');
  1493. });
  1494. })
  1495. </script>
  1496. <!-- 修改分数弹窗 -->
  1497. <div class="modal">
  1498. <div class="modal-shadow"></div>
  1499. <div class="modal-content">
  1500. <div class="modal-title clearfix">
  1501. <span id="topic_order"></span><em class="fr close">×</em>
  1502. </div>
  1503. <span class="red-tig">&nbsp;&nbsp;&nbsp;&nbsp;提示:只修改试题分值,已批阅的学生得分不做修改!</span>
  1504. <div class="model-score">
  1505. 分数:<input type="text" name="score">分
  1506. <input type="hidden" name="paper_id" value="<?php echo $paper_id?>">
  1507. <input type="hidden" name="topic_id" value="">
  1508. <input type="hidden" name="type" value="">
  1509. </div>
  1510. <div class="modal-btn">
  1511. <a href="javascript:;" class="sumbit">确定</a>
  1512. <a href="javascript:;" class="close">取消</a>
  1513. </div>
  1514. </div>
  1515. </div>
  1516. <!-- 修改多选题分数弹窗 -->
  1517. <div class="modal1_multi">
  1518. <div class="modal-shadow"></div>
  1519. <div class="modal-content">
  1520. <div class="modal-title clearfix">
  1521. <span class="title-txt">更改试题答案</span><span id="update_msg"></span><em class="fr close3">×</em>
  1522. </div>
  1523. <div class="model-rule">
  1524. 评分规则:
  1525. <label><input type="radio" name="rule" value="1" >规则A
  1526. <br>全选对为全对;错选漏选为0分。
  1527. </label>
  1528. <label><input type="radio" name="rule" value="2" checked >规则B
  1529. <br>全选对为全对;错选为0分;没有全部选对且没有错选为半对。
  1530. </label>
  1531. <label><input type="radio" name="rule" value="3">规则C
  1532. <br>全选对为全对;答案数量不超过正确答案数量情况下,部分选对为半对;
  1533. 答案数量超过正确答案数量或全选错为0分。
  1534. </label>
  1535. </div>
  1536. <div class="model-score-m">
  1537. <label class="batch"> <span class="score_tag ">正确答案:</span><input class="score_input" type="text" name="answer_m"></label>
  1538. <label class="total_score"><span class="score_tag ">满分:</span><input type="text" class="score_input" name="score_m" value="5">分</label>
  1539. <label class="half_score"><span class="score_tag">半对分:</span><input type="text" class="score_input" name="score_half_m" value="3">分</label>
  1540. <input type="hidden" name="exam_id_m" value="<?php echo $exam_id?>">
  1541. <input type="hidden" name="topic_id_m" value="">
  1542. <input type="hidden" name="answer_m" value="">
  1543. <input type="hidden" name="type_m" value="">
  1544. <input type="hidden" name="is_batch" value="0">
  1545. <input type="hidden" name="step" value="0">
  1546. <input type="hidden" name="score_half_h" value="">
  1547. <span class="tig-txt" style="float: left;margin-left: 70px;font-size: 10px;padding-top: 5px;">正确答案 英文半角大写 A.B.C.D</span>
  1548. </div>
  1549. <div class="modal-btn">
  1550. <a href="javascript:;" class="sumbit3">确定</a>
  1551. <a href="javascript:;" class="close3">取消</a>
  1552. </div>
  1553. </div>
  1554. </div>
  1555. <!-- 修改答案弹窗 -->
  1556. <div class="modal1">
  1557. <div class="modal-shadow"></div>
  1558. <div class="modal-content">
  1559. <div class="modal-title clearfix">
  1560. 更改试题答案(<span id="topic_order1"></span>)<em class="fr close1">×</em>
  1561. </div>
  1562. <div class="model-score1">
  1563. 正确答案:<input type="text" name="answer">
  1564. <input type="hidden" name="paper_id" value="<?php echo $paper_id?>">
  1565. <input type="hidden" name="topic_id" value="">
  1566. <input type="hidden" name="type" value="">
  1567. <span style="float: left;margin-left: 70px;font-size: 10px;padding-top: 5px;">正确答案 英文半角大写 A.B.C.D</span>
  1568. </div>
  1569. <div class="modal-btn">
  1570. <a href="javascript:;" class="sumbit1">确定</a>
  1571. <a href="javascript:;" class="close1">取消</a>
  1572. </div>
  1573. </div>
  1574. </div>
  1575. <!-- 更改试题科目 -->
  1576. <div class="modal_subject">
  1577. <div class="modal-shadow"></div>
  1578. <div class="modal-content">
  1579. <div class="modal-title clearfix">
  1580. 更改试题科目<em class="fr close_subject">×</em>
  1581. </div>
  1582. <div class="model-score2 oldSubjectName">原科目:</div>
  1583. <div class="model-score2">
  1584. 正确科目(<span id="topic_order_student"></span>):
  1585. <select name="subject_id" id="subject_id">
  1586. <option value="0">请选择科目</option>
  1587. <?php
  1588. if(isset($subjects)){
  1589. foreach ($subjects as $key =>$val){
  1590. echo '<option value="'.$key.'">'.$val.'</option>';
  1591. }
  1592. }
  1593. ?>
  1594. </select>
  1595. <input type="hidden" name="exam_id_subject" value="<?php echo $exam_id?>">
  1596. <input type="hidden" name="topic_id_subject" value="">
  1597. <input type="hidden" name="old_subject_id" value="">
  1598. <input type="hidden" name="paper_id_subject" value="<?php echo $paper_id?>">
  1599. </div>
  1600. <div class="modal-btn">
  1601. <a href="javascript:;" class="sumbit_subject">确定</a>
  1602. <a href="javascript:;" class="close_subject">取消</a>
  1603. </div>
  1604. </div>
  1605. </div>
  1606. <!--批量修改单选题分值-->
  1607. <div class="confirmbox-mask" style="display: none" id="classModal">
  1608. <div class="class-modal">
  1609. <i class="icon icon-close">×</i>
  1610. <div class="class-modal-head">批量更改分值</div>
  1611. <div class="class-modal-body">
  1612. <p><span>总分:</span><input type="text" class="total_score" name="total_score" value="<?php echo isset($choice_question_score_sum)?$choice_question_score_sum:'';?>" /><button class="avg">平均分配</button></p>
  1613. <?php
  1614. if(isset($type[1])){
  1615. foreach ($type[1] as $item){
  1616. $topicNo=0;
  1617. if(isset($alias[$item['order']])){
  1618. $topicNo =$alias[$item['order']] ;
  1619. }else{
  1620. $topicNo= $item['order'];
  1621. }
  1622. echo '<p><span>第'.$topicNo.'题:</span><input type="text" class="topic_score" name="'.$topicNo.'" value="'.intval($item['score']).'" />分</p>';
  1623. }
  1624. }
  1625. ?>
  1626. </div>
  1627. <div class="class_btn">
  1628. <div class="avg_result c-red"></div>
  1629. <input type="hidden" name="topic_type_action" value="0">
  1630. <button type="button" class="save_score">确定</button>
  1631. </div>
  1632. </div>
  1633. </div>
  1634. <!--批量修改多选题分值-->
  1635. <div class="confirmbox-mask" style="display: none" id="classModalMulti">
  1636. <div class="class-modal">
  1637. <i class="icon icon-close">×</i>
  1638. <div class="class-modal-head">批量更改分值</div>
  1639. <div class="class-modal-body multiSelectScore">
  1640. <p><span>总分:</span><input type="text" class="total_score" name="total_score" value="" /><button class="avg">平均分配</button></p>
  1641. </div>
  1642. <div class="class_btn">
  1643. <div class="avg_multi_result c-red"></div>
  1644. <input type="hidden" name="topicAnswer" value="">
  1645. <input type="hidden" name="topicRule" value="">
  1646. <input type="hidden" name="topic_type_index" value="0">
  1647. <input type="hidden" name="topicIds" value="0">
  1648. <button type="button" class="save_multi_score">确定</button>
  1649. </div>
  1650. </div>
  1651. </div>
  1652. <!--批量客观题答案-->
  1653. <div class="confirmbox-mask" style="display: none" id="updateAnswerBatch">
  1654. <div class="class-modal">
  1655. <i class="icon icon-close">×</i>
  1656. <div class="class-modal-head">批量更改答案</div>
  1657. <div class="class-modal-body">
  1658. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="answerList">
  1659. <thead>
  1660. <tr>
  1661. <td>题号</td>
  1662. <td>答案</td>
  1663. <td>更新标记</td>
  1664. </tr>
  1665. </thead>
  1666. <tbody>
  1667. </tbody>
  1668. </table>
  1669. </div>
  1670. <div class="class_btn">
  1671. <div class="avg_result c-red"></div>
  1672. <input type="hidden" name="topicType" value="">
  1673. <input type="hidden" name="topicHalfScore" value="">
  1674. <input type="hidden" name="topicAnswerRule" value="">
  1675. <button type="button" class="saveAnswerBatch">确定</button>
  1676. </div>
  1677. </div>
  1678. </div>
  1679. <!--送分题选择答案弹窗-->
  1680. <div class="confirmbox-mask" style="display: none" id="sendScore">
  1681. <div class="class-modal">
  1682. <i class="icon icon-close">×</i>
  1683. <div class="class-modal-head">设置送分题</div>
  1684. <div class="class-modal-body">
  1685. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="answerList">
  1686. <thead>
  1687. <tr>
  1688. <td colspan="4">请选择需要送分的选项,学生选择以下任意选项均得分</td>
  1689. </tr>
  1690. </thead>
  1691. <tbody>
  1692. <tr>
  1693. <td >
  1694. <table width="100%" border="0" cellspacing="1" cellpadding="1" class="answerShow" align="center">
  1695. <tr>
  1696. <td class="answer_3">A</td>
  1697. <td class="answer_3">B</td>
  1698. <td class="answer_3">C</td>
  1699. <td class="answer_3">D</td>
  1700. <td class="answer_3">E</td>
  1701. <td class="answer_3">F</td>
  1702. <td class="answer_3">G</td>
  1703. </tr>
  1704. </table>
  1705. </td>
  1706. </tr>
  1707. <tr>
  1708. <td >注意:一旦设置,不可取消,且不能再修改试题分值与答案,请谨慎操作!</td>
  1709. </tr>
  1710. </tbody>
  1711. </table>
  1712. </div>
  1713. <div class="class_btn">
  1714. <button type="button" class="saveSendScoreBtn">确定</button>
  1715. <input type="hidden" name="sendScoreAnswer" value="">
  1716. <input type="hidden" name="paperId" value="">
  1717. <input type="hidden" name="topicId" value="">
  1718. </div>
  1719. </div>
  1720. </div>