123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>试题编辑</title>
- <link rel="stylesheet" type="text/css" href="/css/base.css">
- <script type="text/javascript" src="/js/jquery.min.js"></script>
- <script src="/js/layer/layer.js"></script>
- <style type="text/css">
- /*.topic-content*/
- .choose-topic h3,.filling-topic h3,.answer-topic h3{font-weight: 700;font-size: 14px;line-height: 34px;}
- .topic{padding-left: 30px; font-size:14px;text-align: justify;line-height: 22px;}
- .topic a{margin:0 5px; color: #4395ff}
- .topic p{display: inline;}
- /*.topic .score{color: #f00;}*/
- .score input,.right-answer{width: 30px;text-align: center; background: #fff;border:0;color: #0155fe}
- .score input:focus,.right-answer:focus{border:1px solid #0155fe;outline: none;}
- /*.right-answer{color: #f40;}*/
- .topic-answer input{width: 60px;}
- .words{position: relative;padding-left: 25px; width: 80%;box-sizing: border-box;cursor:pointer;}
- .controls{width: 20%;}
- .order{position: absolute;left: 0;top: 0;width: 25px;}
- .options{padding-left: 35px;}
- .options li{margin-top: 10px; list-style:upper-latin;}
- .listType_1{width: 70%;padding:0 20px;margin-right:10px}
- .listType_2{width: 50%;}
- .listType_3{width: 100%;}
- .topic-answer,.topic-explain{padding-left: 20px;margin:10px 0;}
- .answer-tit{width: 80%;}
- .answer-btn{width: 20%;}
- .topic-detail{display: none;}
- /*弹出层*/
- .modal{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;}
- .modal{width: 100%;height: 100%;background: rgba(0,0,0,.4)}
- .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
- .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #0155fe;box-sizing: border-box;}
- .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
- .model-score{text-align: center;margin:30px 0;}
- .model-score input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
- .model-score input:focus{border-color: #0155fe;box-shadow: 0 0 5px #0155fe;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #0155fe;color: #fff;}
- .modal1{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;}
- .modal1{width: 100%;height: 100%;background: rgba(0,0,0,.4)}
- .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
- .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #0155fe;box-sizing: border-box;}
- .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
- .model-score1{text-align: center;margin:30px 0;}
- .model-score1 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
- .model-score1 input:focus{border-color: #0155fe;box-shadow: 0 0 5px #0155fe;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #0155fe;color: #fff;}
- .modal2{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;}
- .modal2{width: 100%;height: 100%;background: rgba(0,0,0,.4)}
- .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
- .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #0155fe;box-sizing: border-box;}
- .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
- .model-score2{text-align: center;margin:30px 0;}
- .model-score2 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
- .model-score2 input:focus{border-color: #0155fe;box-shadow: 0 0 5px #0155fe;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #0155fe;color: #fff;}
- .controls {width: 26%;}
- .modal1_multi{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;background: rgba(0,0,0,.4)}
- .model-rule{width:80%;margin:5px auto;}
- .model-rule label{display: block;margin:10px 0;}
- .modal1_multi .model-score1{width:80%;margin:10px auto;text-align: left}
- .modal1_multi .modal-btn{text-align: center;margin:5px 0;clear:both;}
- .modal1_multi .modal-btn a{display: inline-block;margin:5px 5px; width: 100px; line-height: 40px;background: #0155fe;color: #fff;}
- .modal1_multi .model-score-m{width:80%;margin:5px auto;}
- #update_msg{color:red}
- .modal1_multi .model-score-m label{display: block;margin:5px 0;}
- .modal1_multi .model-score-m label .score_tag{width:70px;display: inline-block;}
- .modal1_multi .model-score-m label .score_input{padding-left: 5px; height: 20px;width: 200px;border:1px solid #ccc;outline: none; }
- .dn{display: none}
- .modal_student{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;}
- .modal_student{width: 100%;height: 100%;background: rgba(0,0,0,.4)}
- .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
- .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #2977ff;box-sizing: border-box;color: #fff}
- .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
- .model-score1{text-align: center;margin:30px 0;}
- .model-score1 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
- .model-score1 input:focus{border-color: #0155fe;box-shadow: 0 0 5px #0155fe;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #2977ff;color: #fff;}
- .modal_subject{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;}
- .modal_subject{width: 100%;height: 100%;background: rgba(0,0,0,.4)}
- .batch_topic{padding-left: 30px; font-size:14px;text-align: justify;line-height: 22px;}
- .batch_topic a{margin:0 5px; color: #4395ff}
- .batch_topic p{display: inline;}
- .confirmbox-mask {
- background: rgba(0, 0, 0, .7);
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- z-index: 99;
- position: fixed;
- }
- button {
- border: none;
- background: #2977ff;
- width: 80px;
- height: 26px;
- border-radius: 3px;
- font-size: 14px;
- color: #fff;
- outline: none;
- cursor: pointer;
- }
- button.save {
- display: block;
- margin: 40px auto;
- }
- .confirmbox .confirmbox-btns {
- margin-top: 40px;
- }
- .class-modal {
- width: 500px;
- min-height: 400px;
- background: #fff;
- // border-radius: 5px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- }
- .class-modal-head {
- font-size: 14px;
- background:#2977ff;
- color:#fff;
- height:35px;
- line-height: 35px;
- padding: 0 0 0 15px;
- }
- .class-modal-body {
- margin-top: 20px;
- max-height: 300px;
- overflow: auto;
- margin-left:50px;
- }
- .class-modal-body .classes {
- margin-bottom: 20px;
- }
- .class-modal-body .classes > div {
- display: inline-block;
- max-width: 640px;
- vertical-align: top;
- }
- .class-modal-body .classes a {
- text-decoration: none;
- display: inline-block;
- margin: 0 5px 5px;
- color: #136bfb;
- font-size: 14px;
- }
- .class-modal-body .classes a.active {
- color: #fc091b
- }
- .class-modal .icon-close{
- position: absolute;
- right: 20px;
- top: 2px;
- color:#fff;
- }
- .c-red {
- color: #CC3300
- }
- .avg{
- margin:0 10px;
- }
- .class_btn{
- text-align: center;
- }
- .confirmbox-mask p{
- word-wrap : break-word ;
- }
- .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}
- .class-modal-body p{margin:10px 0;}
- .class-modal-body p span{display: inline-block;width:60px;}
- .icon-close{cursor:pointer;font-size:20px;line-height: 35px;}
- .class_btn{position: fixed;bottom: 2%;text-align: center;width:500px;}
- .red-tig{color:red;}
- .topic a.c-red{ color: #CC3300}
- </style>
- <script type="text/javascript">
- $(function(){
- /* 图片不完全按比例自动缩小 */
- $('div.words img,div.topic-explain img').each(function(){
- var x = 400; //填入目标图片宽度
- var y = 40; //填入目标图片高度
- var w=$(this).width(), h=$(this).height();//获取图片宽度、高度
- if (w > x) { //图片宽度大于目标宽度时
- var w_original=w, h_original=h;
- h = h * (x / w); //根据目标宽度按比例算出高度
- w = x; //宽度等于预定宽度
- if (h < y) { //如果按比例缩小后的高度小于预定高度时
- w = w_original * (y / h_original); //按目标高度重新计算宽度
- h = y; //高度等于预定高度
- }
- $(this).attr({width:w,height:h});
- }
- });
- $('li.listType_1 img').each(function(){
- var x = 200; //填入目标图片宽度
- var y = 30; //填入目标图片高度
- var w=$(this).width(), h=$(this).height();//获取图片宽度、高度
- if (w > x) { //图片宽度大于目标宽度时
- var w_original=w, h_original=h;
- h = h * (x / w); //根据目标宽度按比例算出高度
- w = x; //宽度等于预定宽度
- if (h < y) { //如果按比例缩小后的高度小于预定高度时
- w = w_original * (y / h_original); //按目标高度重新计算宽度
- h = y; //高度等于预定高度
- }
- $(this).attr({width:w,height:h});
- }
- });
- /* 点击展开试题解析*/
- $("body").delegate('.words', 'click', function(event) {
- $(this).parent(".topic-content").siblings('.topic-detail').slideToggle();
- });
- /*修改分数*/
- // $("body").delegate('.change-score', 'click', function(event) {
- // $(this).closest(".controls").siblings(".words").find("input").attr("disabled",false).focus();
- // })
- // $("body").delegate('.answer-btn a', 'click', function(event) {
- // $(this).closest('.answer-btn').prev(".answer-tit").find("input").attr("disabled",false).focus();
- // });
- // $("body").delegate('.words input,.right-answer', 'keyup', function(event) {
- // if($(this).is(".words input")){
- // $(this).val($(this).val().replace(/[^0-9]/g,""));
- // }else{
- // $(this).val($(this).val().replace(/[^A-D]/g,""));
- // }
- // var testLength = $(this).val().length;
- // $(this).width(testLength*10 + "px");
- // if(event.keyCode == 13){
- // $(this).blur();
- // $(this).attr("disabled",true)
- // }
- // })
- var open=1;
- /* 上移试题 */
- $("body").delegate('.topic .up', 'click', function(event) {
- var curTopic = $(this).closest(".topic");
- var prevTopic = curTopic.prev(".topic");
- curTopic.after(prevTopic);
- var data={
- paper_id:$(this).attr('paper_id'),
- topic_id:$(this).attr('topic'),
- order:$(this).parent().prev().find('.order').attr('order_id'),
- type:$(this).attr('type')
- };
- $(this).attr('disabled',true);
- layer.msg("正在处理。。。。。。",{time:0})
- if(open==1){
- open=0;
- $.post("<?php echo Yii::app()->createUrl('paper/up')?>",data,function(falgs){
- });
- window.location.reload();
- }
-
- //order();
- });
- /* 下移试题 */
- $("body").delegate('.topic .down', 'click', function(event) {
- var curTopic = $(this).closest(".topic");
- var nextTopic = curTopic.next(".topic");
- nextTopic.after(curTopic);
- var data={
- paper_id:$(this).attr('paper_id'),
- topic_id:$(this).attr('topic'),
- order:$(this).parent().prev().find('.order').attr('order_id'),
- type:$(this).attr('type')
- };
- $(this).attr('disabled',true);
- layer.msg("正在处理。。。。。。",{time:0})
- if(open==1){
- open=0;
- $.post("<?php echo Yii::app()->createUrl('paper/down')?>",data,function(falgs){
- });
- window.location.reload();
- }
- //order();
- });
- function order(){
- /*排序试题*/
- for(var i=0;i<$(".order").length;i++){
- $(".order").eq(i).html(i+1+".");
- $(".order").eq(i).attr('order_id',i+1);
- }
- }
- /* 修改分数弹层*/
- $(".close").click(function(event) {
- $(".sumbit").attr('disabled',false);
- layer.closeAll();
- $(this).closest(".modal").fadeOut();
- });
- $(".close1").click(function(event) {
- $(".sumbit1").attr('disabled',false);
- layer.closeAll();
- $(this).closest(".modal1").fadeOut();
- });
- $(".close2").click(function(event) {
- $(".sumbit2").attr('disabled',false);
- layer.closeAll();
- $(this).closest(".modal2").fadeOut();
- });
- $(".close3").click(function(event) {
- $(".sumbit3").attr('disabled',false);
- layer.closeAll();
- hideMulti($(this));
- });
- $(".close_student").click(function(event) {
- $(".sumbit_student").attr('disabled',false);
- layer.closeAll();
- $(this).closest(".modal_student").fadeOut();
- });
- $(".close_subject").click(function(event) {
- $(".sumbit_subject").attr('disabled',false);
- layer.closeAll();
- $(this).closest(".modal_subject").fadeOut();
- });
- $(".sumbit").click(function(event) {
- if($(this).attr('disabled')=='disabled'){
- return false;
- }
- var type=$("input[name=type]").val();
- var score_m=$("input[name=score]").val();
- if(score_m==0 || score_m==''){
- layer.msg('分值不能为空');
- return false;
- }
- if(type==1 || type==2 || type==11){
- if(score_m>49){
- layer.msg('最大分值不能超过49分');
- return false;
- }
- }else if(type==5){
- if(score_m>49){
- layer.msg('最大分值不能超过49分');
- return false;
- }
- }else if(type==7){
- if(score_m>60){
- layer.msg('最大分值不能超过60分');
- return false;
- }
- }else if(type==17){
- if(score_m>60){
- layer.msg('最大分值不能超过60分');
- return false;
- }
- }
- var questionEle=$('.question_score');
- var question_count=0,question_score='';
- if(questionEle!=undefined && questionEle.length>0){
- question_count=questionEle.length;
- questionEle.each(function(i,v){
- console.log($(v).val());
- if($(v).val()=='' || $(v).val()==0){
- layer.msg('请设置小问分数');
- return false;
- }
- if(question_score==''){
- question_score=$(v).val();
- }else{
- question_score=question_score+','+$(v).val();
- }
- });
- }
- $(this).closest(".modal").fadeOut();
- var data={
- paper_id:$("input[name=paper_id]").val(),
- topic_id:$("input[name=topic_id]").val(),
- score:$("input[name=score]").val(),
- type:$("input[name=type]").val(),
- question_count:question_count,
- question_score:question_score
- };
- $(this).attr('disabled',true);
- var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
- $.post("<?php echo Yii::app()->createUrl('paper/score')?>",data,function(falgs){
- var m =JSON.parse(falgs);
- layer.close(alertIndex);
- console.log(m);
- if(m.status==-1)
- {
- layer.msg('分数不能为空');return;
- }else if(m.status==0)
- {
- if(m.msg!=undefined){
- layer.msg(m.msg);
- }else{
- layer.msg('修改分数失败');
- }
- return;
- }else{
- location.reload();
- }
- });
- });
- $(".sumbit1").click(function(event) {
- if($(this).attr('disabled')=='disabled'){
- return false;
- }
- $(this).closest(".modal").fadeOut();
- if(!$("input[name=answer]").val())
- {
- layer.msg('不能为空');return;
- }
- var data={
- paper_id:$("input[name=paper_id]").val(),
- topic_id:$("input[name=topic_id]").val(),
- answer:$("input[name=answer]").val(),
- type:$("input[name=type]").val()
- };
- $(this).attr('disabled',true);
- var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
- $.post("<?php echo Yii::app()->createUrl('paper/answernew')?>",data,function(falgs){
- var m =falgs;
- layer.close(alertIndex);
- if(m==-1)
- {
- layer.msg('无考试');return;
- }else if(m==0)
- {
- layer.msg('提交失败');return;
- }else if(m==-2){
- layer.msg('参数有误');return;
- }else if(m==-3){
- layer.msg('无此题');return;
- }else if(m==-4){
- layer.msg('接口写入有误');return;
- }else if(m==-5){
- layer.msg('接口报错:Trans rollback');return;
- }else if(m==-6){
- layer.msg('校本题库答案修改失败');return;
- }else if(m==-7){
- layer.msg('校本题库答案已修改,报告无内容需要更新');return;
- }else{
- location.reload();
- }
- });
- });
- $(".sumbit2").click(function(event) {
- if($(this).attr('disabled')=='disabled'){
- return false;
- }
- $(this).closest(".modal2").fadeOut();
- if(!$("input[name=answer1]").val())
- {
- layer.msg('不能为空');return;
- }
- var data={
- paper_id:$("input[name=paper_id]").val(),
- topic_id:$("input[name=topic_id]").val(),
- answer:$("input[name=answer1]").val(),
- type:$("input[name=type]").val()
- };
- $(this).attr('disabled',true);
- var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
- $.post("<?php echo Yii::app()->createUrl('paper/update_answer')?>",data,function(falgs){
- var m = falgs;
- layer.close(alertIndex);
- if(m==-1)
- {
- layer.msg('无题或不是校本题库的题');return;
- }else if(m==0)
- {
- layer.msg('提交失败');return;
- }else if(m==-2){
- layer.msg('参数有误');return;
- }else if(m==-3){
- layer.msg('类型有误');return;
- }else if(m==-4){
- layer.msg('填写不是A,B,C,D');return;
- }else if(m==-5){
- layer.msg('校本题库的题有误');return;
- }else{
- location.reload();
- }
- });
- });
- $(".sumbit3").click(function(event) {
- if($(this).attr('disabled')=='disabled'){
- return false;
- }
- var obj=$(this);
- var rule=$("input[name=rule]:checked").val();
- var score_m=$("input[name=score_m]").val();
- var score_half_m=$("input[name=score_half_m]").val();
- var answer=$("input[name=answer_m]").val();
- var is_batch=parseInt($('input[name=is_batch]').val());
- var step=parseInt($('input[name=step]').val());
- var type=parseInt($('input[name=type_m]').val());
- if(!answer)
- {
- layer.msg('答案不能为空');return;
- }
- if(score_m<0 || score_m=='' ){
- layer.msg('分数不能为空');return false;
- }
- if(is_batch==0) {
- if (parseFloat(score_half_m) > parseFloat(score_m)) {
- layer.msg('半对分不能大于满分');
- return;
- }
- }else{
- score_half_m=$("input[name=score_half_h]").val();
- }
- if(rule!=1 && score_half_m==''){
- layer.msg('半对分数不能为空');
- return false;
- }
- if(type==1 || type==2 || type==11){
- if(score_m>49){
- layer.msg('最大分值不能超过49分');
- return false;
- }
- }else if(type==5){
- if(score_m>49){
- layer.msg('最大分值不能超过49分');
- return false;
- }
- }else if(type==7){
- if(score_m>60){
- layer.msg('最大分值不能超过60分');
- return false;
- }
- }else if(type==17){
- if(score_m>60){
- layer.msg('最大分值不能超过60分');
- return false;
- }
- }
- var data={
- exam_id:$("input[name=exam_id_m]").val(),
- topic_id:$("input[name=topic_id_m]").val(),
- answer:answer,
- type:$("input[name=type_m]").val(),
- score_m:score_m,
- score_half_m:score_half_m,
- rule:rule,
- step:step
- };
- $(this).attr('disabled',true);
- var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
- if(is_batch==1){
- postUrl="<?php echo Yii::app()->createUrl('paper/changeMultiRuleBatch')?>";
- }else{
- postUrl="<?php echo Yii::app()->createUrl('paper/changemulti')?>";
- }
- $.ajax({
- url:postUrl,
- data:data,
- dataType:'json',
- type:'POST',
- success:function(res){
- layer.close(alertIndex);
- if(res.status==1){
- layer.msg('更新成功',hideMulti(obj));
- location.reload();
- }else{
- layer.msg(res.msg);
- }
- }
- });
- });
- $(".sumbit_student").click(function(event) {
- if($(this).attr('disabled')=='disabled'){
- return false;
- }
- if(!$("input[name=answer_student]").val())
- {
- layer.msg('答案不能为空');return;
- }
- var data={
- exam_id:$("input[name=exam_id_student]").val(),
- topic_id:$("input[name=topic_id_student]").val(),
- answer:$("input[name=answer_student]").val(),
- old_answer:$("input[name=old_answer_student]").val(),
- topic_answer:$("input[name=topic_answer]").val(),
- };
- $(this).attr('disabled',true);
- var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
- $.post("<?php echo Yii::app()->createUrl('paper/editstudentanswer')?>",data,function(falgs){
- var m = falgs;
- layer.close(alertIndex);
- if(m==-2)
- {
- layer.msg('提交失败');return;
- }else if(m==-3)
- {
- layer.msg('还未上传成绩');return;
- }else if(m==-4){
- layer.msg('修改失败');return;
- }else if(m==-1){
- layer.msg('答案不正确');return;
- }else if(m==-5){
- layer.msg('未获取到原答案');return;
- }else if(m==-6){
- layer.msg('原答案和新答案没有变化');return;
- }else if(m==-7){
- layer.msg('没有需要更新的数据');return;
- }else{
- //location.reload();
- layer.msg('修改成功',{icon:1,time:2000 },function(){
- $(".modal_student").fadeOut();
- location.reload();
- });
- }
- });
- });
- //更新科目
- $(".sumbit_subject").click(function(event) {
- // $(this).closest(".sumbit_student").fadeOut();
- if($(this).attr('disabled')=='disabled'){
- return false;
- }
- console.log($(this).attr('disabled'));
- if($("#subject_id").val()==0)
- {
- layer.msg('请选择新科目');return;
- }
- if($("#subject_id").val()==$("input[name=old_subject_id]").val()){
- layer.msg('科目没有变化 ');return;
- }
- var data={
- exam_id:$("input[name=exam_id_subject]").val(),
- topic_id:$("input[name=topic_id_subject]").val(),
- subject:$("#subject_id").val(),
- old_subject:$("input[name=old_subject_id]").val(),
- paper_id:$("input[name=paper_id_subject]").val(),
- };
- $(this).attr('disabled',true);
- var alertIndex=layer.msg('正在更新,请稍候。。。。。。',{time:0});
- $.post("<?php echo Yii::app()->createUrl('paper/editTopicSubject')?>",data,function(falgs){
- var m = falgs;
- layer.close(alertIndex);
- if(m==-2)
- {
- layer.msg('提交失败');return;
- }else if(m==-3)
- {
- layer.msg('还未上传成绩');return;
- }else if(m==-4){
- layer.msg('修改失败');return;
- }else if(m==-1){
- layer.msg('答案不正确');return;
- }else{
- //location.reload();
- layer.msg('修改成功');
- $(".modal_subject").fadeOut();
- location.reload();
- }
- });
- });
- $(".change-score").click(function(){
- if($(this).attr('type')==5 || $(this).attr('type')==7 || $(this).attr('type')==17){
- msg='1、线上阅卷:<br>' +
- '(1)未开始阅卷可修改分值。<br>' +
- '(2)已开始阅卷,已阅学生成绩不会自动更新。若将分值改大,需重新按更新后分值再次批改,否则会导致修改分值后批阅的学生分值比修改前已阅学生分值大;若将分值改小,需老师对已阅学生重新打分,否则会导致无法完成阅卷。\n' +
- '<br>' +
- '2、线下阅卷:\n' +
- '<br>' +
- '(1)答题卡未保存可修改分值。\n' +
- '<br>' +
- '(2)答题卡已保存,修改分值对学生打分不生效。';
- indexmsg=layer.confirm(msg, {
- title:"*修改需知!!!",
- btn: ['我已知晓', '取消'] //按钮
- }, function () {
- layer.close(indexmsg)
- $(".modal").fadeIn();
- })
- }else{
- $(".modal").fadeIn();
- }
- $('.question_scores').html('');
- $("input[name=score]").attr('disabled',false);
- order=$(this).parent().prev().find('.order').attr('order_id');
- $("#topic_order").html("题号:"+order);
- $("input[name=topic_id]").val($(this).attr('topic'));
- $("input[name=type]").val($(this).attr('type'));
- $("input[name=score]").val('');
- $question_count=parseInt($(this).attr('question_count'));
- $question_score=$(this).attr('question_score');
- $score_type=$(this).attr('score_type');
- if($question_count>0){
- //小问
- var wenSign=['(1)','(2)','(3)','(4)','(5)','(6)','(7)','(8)','(9)','(10)'];
- var kongSign=['①','②','③','④','⑤','⑥','⑦','⑧','⑨','⑩'];
- var html='';
- $scores=$question_score.split(',');
- $scoreSum=0
- for(var i=0;i<$question_count;i++){
- $scoreSum+=parseInt($scores[i]);
- if($score_type==2){
- html+='<p style="margin-top:8px;">'+order+kongSign[i]+':<input type="text" name="question_score[]" class="question_score" value="'+$scores[i]+'">分</p>';
- }else{
- html+='<p style="margin-top:8px;">'+order+wenSign[i]+':<input type="text" name="question_score[]" class="question_score" value="'+$scores[i]+'">分</p>';
- }
- }
- $('.question_scores').html(html);
- $("input[name=score]").val($scoreSum);
- $("input[name=score]").attr('disabled',true);
- }
- if($(this).attr('type')==1 || $(this).attr('type')==11 || $(this).attr('type')==2){
- $('.red-tig').hide();
- }else{
- $('.red-tig').show();
- }
- });
- $(".change-answer").click(function(){
- $(".modal1").fadeIn();
- $("#topic_order1").html("题号:"+$(this).parent().prev().find('.order').attr('order_id'));
- $("input[name=topic_id]").val($(this).attr('topic'));
- $("input[name=type]").val($(this).attr('type'));
- });
- $(".change_multi_answer").click(function () {
- var step=$(this).attr('step');
- if(step==1){
- $('.total_score').hide();
- $('.half_score').hide();
- $('.model-score-m').hide();
- $('.tig-txt').hide();
- }else if(step==2){
- $('.model-rule').hide();
- $('.total_score').hide();
- $('.half_score').hide();
- $('.model-score-m').show();
- }else if(step==3){
- $('.model-rule').hide();
- $('.total_score').show();
- $('.half_score').show();
- $('.batch').hide();
- $('.tig-txt').hide();
- }
- $('.title-txt').html("题号:"+$(this).parent().prev().find('.order').attr('order_id'));
- $(".modal1_multi").fadeIn();
- $("#topic_order_m").html("题号:"+$(this).parent().prev().find('.order').attr('order_id'));
- $("input[name=topic_id_m]").val($(this).attr('topic'));
- $("input[name=type_m]").val($(this).attr('type'));
- $("input[name=step]").val(step);
- //判断是否修改过规则
- var ruleAnswer=$(this).closest('.topic').find('.rule_answer').val(),
- ruleType=$(this).closest('.topic').find('.rule_type').val(),
- ruleScoreHalf=$(this).closest('.topic').find('.rule_score_half').val();
- var rightAnswer=$(this).closest('.topic').find('.right-answer').val();
- if(ruleType!=0 ){
- if(ruleAnswer!=''){
- $("input[name=answer_m]").val(ruleAnswer);
- // $("input[name=answer_student]").val(ruleAnswer);
- }else{
- $("input[name=answer_m]").val(rightAnswer);
- // $("input[name=answer_student]").val(rightAnswer);
- }
- $("input[name=score_half_m]").val(ruleScoreHalf);
- var index=parseInt(ruleType)-1;
- $('input[name=rule]').eq(index).prop("checked",'checked');
- rightAnswer=ruleAnswer;
- }else{
- $('input[name=score_half_m]').val(0);
- $("input[name=answer_m]").val(rightAnswer);
- $("input[name=answer_student]").val(rightAnswer);
- }
- $("input[name=score_m]").val($(this).attr('score'));
- });
- $(".upload-answer").click(function(){
- $(".modal2").fadeIn();
- $("#topic_order2").html("题号:"+parseInt($(this).parent().prev().find('.order').attr('order_id')));
- $("input[name=topic_id]").val($(this).attr('topic'));
- $("input[name=type]").val($(this).attr('type'));
- });
- //修改学生答案
- $(".change-student-answer").click(function(){
- $(".modal_student").fadeIn();
- var rightAnswer=$(this).closest('.topic').find('.right-answer').val();
- var updateAnswer=$(this).closest('.topic').find('.update_answer').val();
- if(updateAnswer!=undefined && updateAnswer!=""){
- rightAnswer=updateAnswer;
- }
- $("#topic_order_student").html("题号:"+parseInt($(this).parent().prev().find('.order').attr('order_id')));
- $("input[name=topic_id_student]").val($(this).attr('topic'));
- $("input[name=type]").val($(this).attr('type'));
- $("input[name=topic_answer]").val(rightAnswer);
- });
- //批量更新
- $(".change_multi_answer1").click(function () {
- $(".modal1_multi").fadeIn();
- $("#topic_order_m").html('');
- $('.total_score').hide();
- $('.half_score').hide();
- $('.title-txt').html('批量更改判分规则');
- $('.tig-txt').hide();
- //读取答案
- var topicAnswer=[];
- var topicId=[];
- var scoreHalf=[];
- var obj=$(this).closest('.choose-topic').find('.topic');
- if(obj.length>0){
- for(var i=0;i<obj.length;i++){
- if(obj.eq(i).find('.rule_answer').val()!='' && obj.eq(i).find('.rule_answer').val()!=undefined){
- topicAnswer.push(obj.eq(i).find('.rule_answer').val());
- }else{
- topicAnswer.push(obj.eq(i).find('.right-answer').val());
- }
- if(obj.eq(i).find('.rule_score_half').val()!='' && obj.eq(i).find('.rule_score_half').val()!=undefined){
- scoreHalf.push(obj.eq(i).find('.rule_score_half').val());
- }else{
- scoreHalf.push(0);
- }
- topicId.push(obj.eq(i).attr('id'));
- }
- }
- $('.batch').hide();
- $('input[name=score_half_m]').val(0);
- $('input[name=score_m]').val(0);
- $("input[name=type_m]").val($(this).attr('type'));
- $("input[name=topic_id_m]").val(topicId.join('///'));
- $("input[name=answer_m]").val(topicAnswer.join('///'));
- $("input[name=score_half_h]").val(scoreHalf.join('///'));
- $('input[name=is_batch]').val(1);
- $('input[name=step]').val(0);
- });
- //修改文理综试题科目
- $(".change-topic-subject").click(function(){
- $(".modal_subject").fadeIn();
- var old_subject=$(this).attr('subject-name');
- var old_subject_id=$(this).attr('subject');
- $('.oldSubjectName').html('原科目:'+old_subject);
- $("input[name=topic_id_subject]").val($(this).attr('topic'));
- $("input[name=old_subject_id]").val(old_subject_id);
- });
- $(".model-score input").keyup(function(){
- $(this).val($(this).val().replace(/[^0-9|\.]/g,""));
- });
- $(".model-score1 input").keyup(function(){
- $(this).val($(this).val().replace(/[^A-Z]|\.]/g,""));
- });
- $(".model-score2 input").keyup(function(){
- $(this).val($(this).val().replace(/[^A-Z]|\.]/g,""));
- });
- $("input[name=answer_m]").keyup(function(){
- $(this).val($(this).val().replace(/[^A-Z,]|\.]/g,""));
- });
- $("input[name=answer_student]").keyup(function(){
- $(this).val($(this).val().replace(/[^A-Z,]|\.]/g,""));
- });
- $("input[name=score_half_m]").keyup(function(){
- $(this).val($(this).val().replace(/[^\d+|\.]/g,""));
- });
- $("input[name=old_answer_student]").keyup(function(){
- $(this).val($(this).val().replace(/[^A-Z,]|\.]/g,""));
- });
- function hideMulti(obj) {
- obj.closest(".modal1_multi").hide();
- $('#update_msg').html('');
- obj.closest(".modal1_multi").find('input[name=rule]').eq(1).prop('checked',true);
- $('input[name=answer_m]').val('');
- $('input[name=score_m]').val(5);
- $('input[name=score_half_m]').val(3);
- $('input[name=is_batch]').val(0);
- $('input[name=score_half_h]').val('');
- $('.total_score').show();
- $('.half_score').show();
- $('.model-rule').show();
- $('.model-score-m').show();
- $('.batch').show();
- $('.tig-txt').show();
- }
- })
- </script>
- </head>
- <body>
- <a href="<?php echo Yii::app()->createUrl('paper/recover',array('exam_id'=>$exam_id))?>" class="<?php if( isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)) {
- }else{ echo 'dn';}?>"><h3 style="color:#ff7800">恢复考试状态</h3></a>
- <?php if($type && isset($type[1]) && !empty($type[1])){?>
- <div class="choose-topic">
- <h3>选择题</h3>
- <div class="batch_topic">
- <div class="topic-content clearfix">
- <div class="words fl"></div>
- <?php if(!isset($send_points)){?>
- <div class="controls fr clearfix"><a href="javascript:;" score="0" topic="0" type="1" class="fr up_score">批量更改分值</a>
- <a href="javascript:;" score="0" topic="0" type="1" class="fr update_answer_batch">批量更改答案</a></div>
- <?php } ?>
- </div>
- </div>
- <!-- 选择题 答案一排 -->
- <?php foreach($type[1] as $k=>$v){
- $k=$k+1;
- ?>
- <div class="topic">
- <div class="topic-content clearfix">
- <div class="words fl">
- <span class="order" order_id="<?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>"><?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>.</span><span class="score">(<input type="text" value="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" disabled />分)</span>[ID:<?php echo $v['topic_id'];?>]<?php echo isset($topic[$v['topic_id']])? $topic[$v['topic_id']]['title']:'' ?>
- </div>
- <div class="controls fr clearfix ">
- <?php if(!$is_third) { ?>
- <?php if (isset(Yii::app()->session['testFlag']) && (Yii::app()->session['testFlag'] == 1)) { ?>
- <a href="javascript:;" class="fr up" paper_id="<?php echo $paper_id ?>"
- topic="<?php echo $v['topic_id'] ?>" type="1">上移</a>
- <a href="javascript:;" class="fr down" paper_id="<?php echo $paper_id ?>"
- topic="<?php echo $v['topic_id'] ?>" type="1">下移</a>
- <?php }
- }?>
- <?php if(!isset($send_points[$v['order']])){?>
- <a href="javascript:;" class="fr change-answer" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="1" >更改试题答案</a>
- <?php }?>
- <?php if($is_third){?>
- <?php if(in_array($subject,array(18,19))):?>
- <a href="javascript:;" class="fr change-topic-subject" subject-name="<?php if(isset($topic_subject_data[$v['order']]) && isset($subjects[$topic_subject_data[$v['order']]])){echo $subjects[$topic_subject_data[$v['order']]];}?>" subject="<?php if(isset($topic_subject_data[$v['order']])){echo $topic_subject_data[$v['order']];}?>" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="1" >更改试题科目</a>
- <?php endif;?>
- <!--<a href="javascript:;" class="fr upload-answer" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="1" >修改校本题库的题</a>-->
- <?php }
- ?>
- <?php if(!isset($send_points[$v['order']])){?>
- <a href="javascript:;" class="fr change-score" paper_id="<?php echo $paper_id ?>"
- topic="<?php echo $v['topic_id'] ?>" type="1">更改分值</a>
- <?php }?>
- <?php
- if(isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)){
- ?>
- <?php
- $sendPointArr=array();
- $sendPointArr[1]='';
- $sendPointArr[2]='';
- if(isset($send_points[$v['order']])){
- if($send_points[$v['order']]['actionType']==1){
- $sendPointArr[1]='fr c-red';
- $sendPointArr[2]='fr ';
- }elseif($send_points[$v['order']]['actionType']==2){
- $sendPointArr[2]='fr c-red';
- $sendPointArr[1]='fr ';
- }
- }else{
- $sendPointArr[1]='fr sendPoints';
- $sendPointArr[2]='fr sendPoints';
- }
- $optionCount=4;
- if(isset($topic[$v['topic_id']]) && !empty($topic[$v['topic_id']]) && isset($topic[$v['topic_id']]['items'][0]['options'])){
- $optionCount=count($topic[$v['topic_id']]['items'][0]['options']);
- }
- ?>
- <a href="javascript:;" option_count="<?php echo $optionCount ?>" class="<?php echo $sendPointArr[1]?>" action_type="1" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="1" >送分题</a>
- <a href="javascript:;" option_count="<?php echo $optionCount ?>" class="<?php echo $sendPointArr[2]?>" action_type="2" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="1" >0分题</a>
- <?php }?>
- </div>
- </div>
- <div class="topic-detail">
- <ul class="options clearfix">
- <?php
- $arr = array(0=>'A',1=>'B',2=>'C',3=>'D',4=>'E',5=>'F',6=>'G');
- $right = '';
- if(isset($topic[$v['topic_id']]) && !empty($topic[$v['topic_id']]) && isset($topic[$v['topic_id']]['items'][0]['options']))
- {
- foreach($topic[$v['topic_id']]['items'][0]['options'] as $ok=>$opt){
- if($opt['option_correct']==1)
- {
- $right =numToLetter($ok+1);
- }
- ?>
- <li class="listType_1 ">
- <?php echo $opt['option_content']?>
- </li>
- <?php } }?>
- </ul>
- <div class="topic-answer clearfix">
- <div class="fl answer-tit">
- 试题答案:<input type="text" value="<?php echo $right ?>" class="right-answer" disabled="">
- <?php
- if(isset($update_answer[$v['order']])){
- echo '更新答案:<span style="color:red">'.$update_answer[$v['order']]['update_answer'].'<input type="hidden" class="update_answer" name="update_answer" value="'.$update_answer[$v['order']]['update_answer'].'"></span>';
- if(isset($sheet_answer[$v['order']])){
- echo '原始答案:<span style="color:red">'.$sheet_answer[$v['order']].'</span>';
- }
- }
- ?>
- </div>
- <!-- <div class="fr answer-btn clearfix">
- <a href="javascript:;" class="fr">修改答案</a>
- </div> -->
- </div>
- <div class="topic-explain">
- 试题解析:
- <?php echo isset($topic[$v['topic_id']]['parse_content']) ? $topic[$v['topic_id']]['parse_content'] :''?>
- </div>
- </div>
- </div>
- <?php }?>
- </div>
- <?php }?>
- <?php if($type && ((isset($type[2]) && !empty($type[2])) )){?>
- <div class="choose-topic" >
- <!--<a href="<?php /*echo Yii::app()->createUrl('paper/recover',array('exam_id'=>$exam_id))*/?>"><h3 style="color:#ff7800">恢复考试状态</h3></a>-->
- <h3>多项选择题</h3>
- <div class="batch_topic">
- <div class="topic-content clearfix">
- <div class="words fl"></div>
- <div class="controls fr clearfix">
- <a href="javascript:;" score="0" topic="0" type="2" class="fr change_multi_answer1">批量更改判分规则</a>
- <a href="javascript:;" score="0" topic="0" type="2" class="fr update_score_batch">批量更改分值</a>
- <a href="javascript:;" score="0" topic="0" type="2" class="fr update_answer_batch">批量更改答案</a>
- </div>
- </div>
- </div>
- <!-- 选择题 答案一排 -->
- <?php foreach($type[2] as $k=>$v){
- $k=$k+1;
- ?>
- <div class="topic" id="<?php echo $v['topic_id']?>">
- <div class="topic-content clearfix">
- <div class="words fl">
- <span class="order" order_id="<?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>"><?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>.</span><span class="score">(<input type="text" value="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" disabled />分)</span>[ID:<?php echo $v['topic_id'];?>]<?php echo isset($topic[$v['topic_id']])? $topic[$v['topic_id']]['title']:'' ?>
- </div>
- <div class="controls fr clearfix ">
- <a href="javascript:;" class="fr change_multi_answer" score="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" exam_id="<?php echo $exam_id?>" topic="<?php echo $v['topic_id']?>" type="2" step="1" >更改判分规则</a>
- <a href="javascript:;" class="fr change_multi_answer" score="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" exam_id="<?php echo $exam_id?>" topic="<?php echo $v['topic_id']?>" type="2" step="2" >更改试题答案</a>
- <a href="javascript:;" class="fr change_multi_answer" score="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" exam_id="<?php echo $exam_id?>" topic="<?php echo $v['topic_id']?>" type="2" step="3" >更改分值</a>
- <!--<a href="javascript:;" class="fr change_multi_answer" score="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" exam_id="<?php echo $exam_id?>" topic="<?php echo $v['topic_id']?>" type="11" >更改报告</a>-->
- <?php if(in_array($subject,array(18,19))):?>
- <a href="javascript:;" class="fr change-topic-subject" subject-name="<?php if(isset($topic_subject_data[$v['order']]) && isset($subjects[$topic_subject_data[$v['order']]])){echo $subjects[$topic_subject_data[$v['order']]];}?>" subject="<?php if(isset($topic_subject_data[$v['order']])){echo $topic_subject_data[$v['order']];}?>" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="1" >更改试题科目</a>
- <?php endif;?>
- </div>
- </div>
- <div class="topic-detail">
- <ul class="options clearfix">
- <?php
- $ruleAnswer='';
- $ruleType=2; //默认规则
- $ruleScoreHalf=0;
- if(isset($new_rules[$v['order']])){
- $ruleAnswer=$new_rules[$v['order']]['rule_answer'];
- if($new_rules[$v['order']]['rule_type']){
- $ruleType=$new_rules[$v['order']]['rule_type'];
- }
- $ruleScoreHalf=$new_rules[$v['order']]['rule_score_half'];
- }
- echo '<input type="hidden" name="rule_answer" class="rule_answer" value="'.$ruleAnswer.'">';
- echo '<input type="hidden" name="rule_type" class="rule_type" value="'.$ruleType.'">';
- echo '<input type="hidden" name="rule_score_half" class="rule_score_half" value="'.$ruleScoreHalf.'">';
- $arr = array(0=>'A',1=>'B',2=>'C',3=>'D',4=>'E',5=>'F',6=>'G');
- $right = '';
- if($subject==8 && isset($topic[$v['topic_id']]['answer'])){
- $right=$topic[$v['topic_id']]['answer'];
- }else{
- if(isset($topic[$v['topic_id']]) && !empty($topic[$v['topic_id']]) && isset($topic[$v['topic_id']]['items'][0]['options']))
- {
- foreach($topic[$v['topic_id']]['items'][0]['options'] as $ok=>$opt){
- if($opt['option_correct']==1)
- {
- if(!$right){
- $right = numToLetter($ok+1);
- }else{
- $right = $right.','.numToLetter($ok+1);
- }
- }
- ?>
- <li class="listType_1">
- <?php echo $opt['option_content']?>
- </li>
- <?php }
- }
- }
- ?>
- </ul>
- <div class="topic-answer clearfix">
- <div class="fl answer-tit">
- 试题答案:<input type="text" value="<?php echo $right ?>" class="right-answer" disabled="">
- <?php
- if(isset($ruleAnswer) && $ruleAnswer){
- echo '更改答案:<span style="color:red">'.$ruleAnswer.'</span>';
- if(isset($sheet_answer[$v['order']])){
- echo ' 原始答案:<span style="color:red">'.$sheet_answer[$v['order']].'</span>';
- }
- }
- ?>
- </div>
- <!-- <div class="fr answer-btn clearfix">
- <a href="javascript:;" class="fr">修改答案</a>
- </div> -->
- </div>
- <div class="topic-explain">
- 试题解析:
- <?php echo isset($topic[$v['topic_id']]['parse_content']) ? $topic[$v['topic_id']]['parse_content'] :''?>
- </div>
- </div>
- </div>
- <?php }?>
- </div>
- <?php }?>
- <?php if($type && ((isset($type[11]) && !empty($type[11])) )){?>
- <div class="choose-topic" >
- <!--<a href="<?php /*echo Yii::app()->createUrl('paper/recover',array('exam_id'=>$exam_id))*/?>"><h3 style="color:#ff7800">恢复考试状态</h3></a>-->
- <h3>多项选择题</h3>
- <div class="batch_topic">
- <div class="topic-content clearfix">
- <div class="words fl"></div>
- <div class="controls fr clearfix">
- <a href="javascript:;" score="0" topic="0" type="11" class="fr change_multi_answer1">批量更改判分规则</a>
- <a href="javascript:;" score="0" topic="0" type="11" class="fr update_score_batch">批量更改分值</a>
- <a href="javascript:;" score="0" topic="0" type="11" class="fr update_answer_batch">批量更改答案</a>
- </div>
- </div>
- </div>
- <!-- 选择题 答案一排 -->
- <?php foreach($type[11] as $k=>$v){
- $k=$k+1;
- ?>
- <div class="topic" id="<?php echo $v['topic_id']?>">
- <div class="topic-content clearfix">
- <div class="words fl">
- <span class="order" order_id="<?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>"><?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>.</span><span class="score">(<input type="text" value="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" disabled />分)</span>[ID:<?php echo $v['topic_id'];?>]<?php echo isset($topic[$v['topic_id']])? $topic[$v['topic_id']]['title']:'' ?>
- </div>
- <div class="controls fr clearfix ">
- <a href="javascript:;" class="fr change_multi_answer" score="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" exam_id="<?php echo $exam_id?>" topic="<?php echo $v['topic_id']?>" type="11" step="1" >更改判分规则</a>
- <a href="javascript:;" class="fr change_multi_answer" score="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" exam_id="<?php echo $exam_id?>" topic="<?php echo $v['topic_id']?>" type="11" step="2" >更改试题答案</a>
- <a href="javascript:;" class="fr change_multi_answer" score="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" exam_id="<?php echo $exam_id?>" topic="<?php echo $v['topic_id']?>" type="11" step="3" >更改分值</a>
- <!--a href="javascript:;" class="fr change_multi_answer" score="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" exam_id="<?php echo $exam_id?>" topic="<?php echo $v['topic_id']?>" type="11" >更改报告</a>-->
- <?php if(in_array($subject,array(18,19))):?>
- <a href="javascript:;" class="fr change-topic-subject" subject-name="<?php if(isset($topic_subject_data[$v['order']]) && isset($subjects[$topic_subject_data[$v['order']]])){echo $subjects[$topic_subject_data[$v['order']]];}?>" subject="<?php if(isset($topic_subject_data[$v['order']])){echo $topic_subject_data[$v['order']];}?>" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="1" >更改试题科目</a>
- <?php endif;?>
- </div>
- </div>
- <div class="topic-detail">
- <ul class="options clearfix">
- <?php
- $ruleAnswer='';
- $ruleType=2; //默认规则
- $ruleScoreHalf=0;
- if(isset($new_rules[$v['order']])){
- $ruleAnswer=$new_rules[$v['order']]['rule_answer'];
- if($new_rules[$v['order']]['rule_type']){
- $ruleType=$new_rules[$v['order']]['rule_type'];
- }
- $ruleScoreHalf=$new_rules[$v['order']]['rule_score_half'];
- }
- echo '<input type="hidden" name="rule_answer" class="rule_answer" value="'.$ruleAnswer.'">';
- echo '<input type="hidden" name="rule_type" class="rule_type" value="'.$ruleType.'">';
- echo '<input type="hidden" name="rule_score_half" class="rule_score_half" value="'.$ruleScoreHalf.'">';
- $arr = array(0=>'A',1=>'B',2=>'C',3=>'D',4=>'E',5=>'F',6=>'G');
- $right = '';
- if($subject==8 && isset($topic[$v['topic_id']]['answer'])){
- $right=$topic[$v['topic_id']]['answer'];
- }else{
- if(isset($topic[$v['topic_id']]) && !empty($topic[$v['topic_id']]) && isset($topic[$v['topic_id']]['items'][0]['options']))
- {
- foreach($topic[$v['topic_id']]['items'][0]['options'] as $ok=>$opt){
- if($opt['option_correct']==1)
- {
- if(!$right){
- $right = numToLetter($ok+1);
- }else{
- $right = $right.','.numToLetter($ok+1);
- }
- }
- ?>
- <li class="listType_1">
- <?php echo $opt['option_content']?>
- </li>
- <?php } }
- }
- ?>
- </ul>
- <div class="topic-answer clearfix">
- <div class="fl answer-tit">
- 试题答案:<input type="text" value="<?php echo $right ?>" class="right-answer" disabled="">
- <?php
- if(isset($ruleAnswer) && $ruleAnswer){
- echo '更改答案:<span style="color:red">'.$ruleAnswer.'</span>';
- if(isset($sheet_answer[$v['order']])){
- echo ' 原始答案:<span style="color:red">'.$sheet_answer[$v['order']].'</span>';
- }
- }
- ?>
- </div>
- <!-- <div class="fr answer-btn clearfix">
- <a href="javascript:;" class="fr">修改答案</a>
- </div> -->
- </div>
- <div class="topic-explain">
- 试题解析:
- <?php echo isset($topic[$v['topic_id']]['parse_content']) ? $topic[$v['topic_id']]['parse_content'] :''?>
- </div>
- </div>
- </div>
- <?php }?>
- </div>
- <?php }?>
- <?php if($type && isset($type[6]) && !empty($type[6])){?>
- <div class="filling-topic">
- <h3>填空题</h3>
- <!-- 填空题 -->
- <?php foreach($type[6] as $k=>$v){
- $k=$k+1;
- ?>
- <div class="topic">
- <div class="topic-content clearfix">
- <div class="words fl">
- <span class="order" order_id="<?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>"><?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>.</span><span class="score">(<input type="text" value="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" disabled />分)</span>[ID:<?php echo $v['topic_id'];?>]<?php echo isset($topic[$v['topic_id']])? $topic[$v['topic_id']]['title']:'' ?>
- </div>
- <div class="controls fr clearfix ">
- <?php if(!isset($is_third) || !$is_third){?>
- <?php if( isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)) { ?>
- <a href="javascript:;" class="fr up" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="6">上移</a>
- <a href="javascript:;" class="fr down" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="6">下移</a>
- <?php }?>
- <?php
- }?>
- <a href="javascript:;" class="fr change-score" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="6" >更改分值</a>
- <?php if(in_array($subject,array(18,19))):?>
- <a href="javascript:;" class="fr change-topic-subject" subject-name="<?php if(isset($topic_subject_data[$v['order']]) && isset($subjects[$topic_subject_data[$v['order']]])){echo $subjects[$topic_subject_data[$v['order']]];}?>" subject="<?php if(isset($topic_subject_data[$v['order']])){echo $topic_subject_data[$v['order']];}?>" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="1" >更改试题科目</a>
- <?php endif;?>
- </div>
- </div>
- <div class="topic-detail">
- <div class="topic-answer clearfix">
- <div class="fl answer-tit">
- 试题答案:<?php if(isset($topic[$v['topic_id']]['items'][0]['options'])){
- foreach($topic[$v['topic_id']]['items'][0]['options'] as $item =>$opt)
- {
- echo $opt['option_content'].';';
- }
- }?>
- </div>
- <!-- <div class="fr answer-btn clearfix">
- <a href="javascript:;" class="fr">修改答案</a>
- </div> -->
- </div>
- <div class="topic-explain">
- 试题解析:
- <?php echo isset($topic[$v['topic_id']]['parse_content']) ? $topic[$v['topic_id']]['parse_content'] :''?>
- </div>
- </div>
- </div>
- <?php }?>
- </div>
- <?php }?>
- <?php if($type && isset($type[5]) && !empty($type[5])){?>
- <div class="filling-topic">
- <h3>填空题</h3>
- <!-- 填空题 -->
- <?php foreach($type[5] as $k=>$v){
- $k=$k+1;
- ?>
- <div class="topic">
- <div class="topic-content clearfix">
- <div class="words fl">
- <span class="order" order_id="<?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>"><?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>.</span><span class="score">(<input type="text" value="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" disabled />分)</span>[ID:<?php echo $v['topic_id'];?>]<?php echo isset($topic[$v['topic_id']])? $topic[$v['topic_id']]['title']:'' ?>
- </div>
- <div class="controls fr clearfix ">
- <?php if(!isset($is_third) || !$is_third){?>
- <?php if( isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)) { ?>
- <a href="javascript:;" class="fr up" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="5">上移</a>
- <a href="javascript:;" class="fr down" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="5">下移</a>
- <?php }?>
- <?php
- }?>
- <a href="javascript:;" class="fr change-score" score_type="<?php if(isset($score_type[$v['order']])){echo $score_type[$v['order']]; }else{ echo 0;} ?>" question_score="<?php if(isset($question_scores[$v['order']])){ echo $question_scores[$v['order']]; }else{echo 0;}?>" question_count="<?php if(isset($question_count[$v['order']])){ echo $question_count[$v['order']]; }else{echo 0;}?>" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="5" >更改分值</a>
- <?php if(in_array($subject,array(18,19))):?>
- <a href="javascript:;" class="fr change-topic-subject" subject-name="<?php if(isset($topic_subject_data[$v['order']]) && isset($subjects[$topic_subject_data[$v['order']]])){echo $subjects[$topic_subject_data[$v['order']]];}?>" subject="<?php if(isset($topic_subject_data[$v['order']])){echo $topic_subject_data[$v['order']];}?>" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="1" >更改试题科目</a>
- <?php endif;?>
- </div>
- </div>
- <div class="topic-detail">
- <div class="topic-answer clearfix">
- <div class="fl answer-tit">
- 试题答案:<?php if(isset($topic[$v['topic_id']]['items'][0]['options'])){
- foreach($topic[$v['topic_id']]['items'][0]['options'] as $item =>$opt)
- {
- echo $opt['option_content'].';';
- }
- }?>
- </div>
- <!-- <div class="fr answer-btn clearfix">
- <a href="javascript:;" class="fr">修改答案</a>
- </div> -->
- </div>
- <div class="topic-explain">
- 试题解析:
- <?php echo isset($topic[$v['topic_id']]['parse_content']) ? $topic[$v['topic_id']]['parse_content'] :''?>
- </div>
- </div>
- </div>
- <?php }?>
- </div>
- <?php }?>
- <?php if($type && isset($type[7]) && !empty($type[7])){?>
- <div class="answer-topic">
- <h3>解答题</h3>
- <?php foreach($type[7] as $k=>$v){
- $k=$k+1;
- ?>
- <!-- 解答题 -->
- <div class="topic">
- <div class="topic-content clearfix">
- <div class="words fl">
- <span class="order" order_id="<?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>"><?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>.</span><span class="score">(<input type="text" value="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" disabled />分)</span>[ID:<?php echo $v['topic_id'];?>]<?php echo isset($topic[$v['topic_id']])? $topic[$v['topic_id']]['title']:'' ?>
- </div>
- <div class="controls fr clearfix ">
- <?php if(!isset($is_third) || !$is_third){?>
- <?php if( isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)) { ?>
- <a href="javascript:;" class="fr up" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="7">上移</a>
- <a href="javascript:;" class="fr down" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="7">下移</a>
- <?php }?>
- <?php
- }?>
- <a href="javascript:;" class="fr change-score" score_type="<?php if(isset($score_type[$v['order']])){echo $score_type[$v['order']]; }else{ echo 0;} ?>" question_score="<?php if(isset($question_scores[$v['order']])){ echo $question_scores[$v['order']]; }else{echo 0;}?>" question_count="<?php if(isset($question_count[$v['order']])){ echo $question_count[$v['order']]; }else{echo 0;}?>" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="7" >更改分值</a>
- <?php if(in_array($subject,array(18,19))):?>
- <a href="javascript:;" class="fr change-topic-subject" subject-name="<?php if(isset($topic_subject_data[$v['order']]) && isset($subjects[$topic_subject_data[$v['order']]])){echo $subjects[$topic_subject_data[$v['order']]];}?>" subject="<?php if(isset($topic_subject_data[$v['order']])){echo $topic_subject_data[$v['order']];}?>" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="1" >更改试题科目</a>
- <?php endif;?>
- </div>
- </div>
- <div class="topic-detail">
- <div class="topic-answer clearfix">
- <div class="fl answer-tit">
- 试题答案:<?php if(isset($topic[$v['topic_id']]['items'][0]['options'])){
- foreach($topic[$v['topic_id']]['items'][0]['options'] as $item =>$opt)
- {
- echo $opt['option_content'].';';
- }
- }?>
- </div>
- <!-- <div class="fr answer-btn clearfix">
- <a href="javascript:;" class="fr">修改答案</a>
- </div> -->
- </div>
- <div class="topic-explain">
- 试题解析:
- <?php echo isset($topic[$v['topic_id']]['parse_content']) ? $topic[$v['topic_id']]['parse_content'] :''?>
- </div>
- </div>
- </div>
- <?php }?>
- </div>
- <?php }?>
- <?php
- for($oi=8;$oi<28;$oi++){
- if($oi==11)
- {
- continue;
- }
- if($type && isset($type[$oi]) && !empty($type[$oi])){?>
- <div class="answer-topic">
- <h3>选做题</h3>
- <?php foreach($type[$oi] as $k=>$v){
- $k=$k+1;
- ?>
- <!-- 解答题 -->
- <div class="topic">
- <div class="topic-content clearfix">
- <div class="words fl">
- <span class="order" order_id="<?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>"><?php if(isset($alias[$v['order']])){ echo $alias[$v['order']] ;}else{echo $v['order'];}?>.</span><span class="score">(<input type="text" value="<?php echo isset($score[$v['topic_id']])? $score[$v['topic_id']]:0 ?>" disabled />分)</span>[ID:<?php echo $v['topic_id'];?>]<?php echo isset($topic[$v['topic_id']])? $topic[$v['topic_id']]['title']:'' ?>
- </div>
- <div class="controls fr clearfix ">
- <?php if(!isset($is_third) || !$is_third){?>
- <?php if( isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)) { ?>
- <a href="javascript:;" class="fr up" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="<?php echo $oi?>">上移</a>
- <a href="javascript:;" class="fr down" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="<?php echo $oi?>">下移</a>
- <?php }?>
- <?php
- }?>
- <a href="javascript:;" class="fr change-score" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="<?php echo $oi?>" >更改分值</a>
- <?php if(in_array($subject,array(18,19))):?>
- <a href="javascript:;" class="fr change-topic-subject" subject-name="<?php if(isset($topic_subject_data[$v['order']]) && isset($subjects[$topic_subject_data[$v['order']]])){echo $subjects[$topic_subject_data[$v['order']]];}?>" subject="<?php if(isset($topic_subject_data[$v['order']])){echo $topic_subject_data[$v['order']];}?>" paper_id="<?php echo $paper_id ?>" topic="<?php echo $v['topic_id']?>" type="1" >更改试题科目</a>
- <?php endif;?>
- </div>
- </div>
- <div class="topic-detail">
- <div class="topic-answer clearfix">
- <div class="fl answer-tit">
- 试题答案:<?php if(isset($topic[$v['topic_id']]['items'][0]['options'])){
- foreach($topic[$v['topic_id']]['items'][0]['options'] as $item =>$opt)
- {
- echo $opt['option_content'].';';
- }
- }?>
- </div>
- <!-- <div class="fr answer-btn clearfix">
- <a href="javascript:;" class="fr">修改答案</a>
- </div> -->
- </div>
- <div class="topic-explain">
- 试题解析:
- <?php echo isset($topic[$v['topic_id']]['parse_content']) ? $topic[$v['topic_id']]['parse_content'] :''?>
- </div>
- </div>
- </div>
- <?php }?>
- </div>
- <?php }}?>
- <?php include_once '_popup.php'?>
- </body>
- </html>
- <script>
- var paper_id='<?php echo $paper_id ?>';
- $('.topic').hover(function(){
- $(this).css('border',"1px solid #0155fe")
- },function(){
- $(this).css('border',"none")
- })
- $('.up_score').click(function(){
- classModal.style.display = 'block';
- });
- $('.icon-close,.exam-close').click(function(){
- $(this).closest('.confirmbox-mask').hide();
- });
- $('.class-modal-body')
- .on('click','.avg',function(){
- var total_score=$('input[name=total_score]').val();
- var topic_count=$('.topic_score').length;
- if(total_score==0 || total_score==''){
- layer.msg('请填写题目总分!');
- }else{
- var avg_score=total_score/topic_count;
- if(checkFloat(avg_score)==false){
- $('.avg_result').html('无法平均分配');
- $('.avg_result').addClass('red');
- }else{
- $('.avg_result').html('');
- for(var i=1;i<=topic_count;i++){
- $('.topic_score').val(avg_score);
- }
- }
- }
- })
- .on('change','.total_score',function(){
- $(this).val($(this).val().replace(/[^0-9|\.]/g,""));
- if(checkFloat($(this).val())==false){
- layer.msg('分数设置不正确!');
- $(this).val(0);
- }
- if( $(this).val()!=''){
- $(this).val(parseFloat($(this).val()));
- }
- $('.topic_score').val(0);
- $('#topic_error').html('');
- })
- .on('change','.topic_score',function(){
- $(this).val($(this).val().replace(/[^0-9|\.]/g,""));
- if(checkFloat($(this).val())==false){
- layer.msg('分数设置不正确!');
- $(this).val(0);
- }
- if( $(this).val()!=''){
- $(this).val(parseFloat($(this).val()));
- }
- var sum=0;
- for(var i=0;i<$('.topic_score').length;i++){
- if($('.topic_score').eq(i).val()!=''){
- sum+=parseFloat($('.topic_score').eq(i).val());
- }
- }
- $('.total_score').val(sum);
- $('#topic_error').html('');
- });
- $('.save_score').click(function(){
- var topicScore={};
- for(var i=0;i<$('.topic_score').length;i++){
- if($('.topic_score').eq(i).val()==0 || $('.topic_score').eq(i).val()==''){
- layer.msg('请填写题目分数!');
- return false;
- }
- if(parseInt($('.topic_score').eq(i).val())>49){
- layer.msg('选择题分数上限为49分!');
- return false;
- }
- var order=$('.topic_score').eq(i).attr('name');
- var score=$('.topic_score').eq(i).val();
- topicScore[order]=score;
- }
- $(this).attr('disabled',true);
- //批量更改分数
- $.ajax({
- url:'<?php echo $this->createUrl('paper/updateScoreBatch')?>',
- type:'POST',
- dataType:'json',
- data:{scores:topicScore,paper_id:paper_id},
- success:function(res){
- if(res.status==1){
- layer.msg('修改成功',{icon:1,time:2000},function () {
- window.location.reload();
- });
- }else{
- if(res.msg!=undefined){
- layer.msg(res.msg)
- }else{
- layer.msg('修改失败',{icon:1,time:2000},function () {
- window.location.reload();
- });
- }
- }
- }
- });
- });
- function checkFloat(num){
- num=String(num);
- arr=num.split(".");
- //console.log(arr[1]);
- if(arr[1]==undefined){
- return true;
- }else if(arr[1]==5){
- return true;
- }
- return false;
- }
- function checkFloat1(num){
- num=String(num);
- arr=num.split(".");
- if(arr.length<3){
- return true;
- }
- return false;
- }
- </script>
|