12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513 |
- <script src="/js/jquery.ajaxfileupload.js"></script>
- <script src="/js/jquery.datetimepicker.js"></script>
- <link rel="stylesheet" href="/css/jquery.datetimepicker.css" />
- <script type="text/javascript">
- function in_array(search, array){
- for(var i in array){
- if(array[i]==search){
- return true;
- }
- }
- return false;
- }
- testFlag = "<?php echo $this->testFlag;?>";
- customTplsIds = new Array();
- var i = 0;
- <?php foreach(Yii::app()->params["custom_tpls_ids"] as $tplId){?>
- customTplsIds[i] = "<?php echo $tplId;?>";
- i++;
- <?php }?>
- filePaper = 1;
- fileAnswer = 1;
- jQuery(document).ready(function(){
- // 打印答案解析
- $(".answerAnalysis").click(function(){
- var element = this;
- layer.msg('您确定下载答案解析嘛?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- var wpCode = jQuery(element).attr("examId");
- if (!wpCode) {
- layer.msg('周周练id有误!');return false;
- }
- jQuery.post(
- '<?php echo $this->createUrl('print/createtempelate');?>',
- {"eid":wpCode},
- function(data){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- /*alert(obj.message);
- alert(obj);*/
- evaluationClient.printDAJX(JSON.stringify(obj.object));
- } else {
- layer.msg(obj.message);
- }
- }
- );
- }
- });
- });
- jQuery(".paperType").click(function(){
- if(testFlag != 1)
- return false;
- var examId = jQuery(this).attr("examId");
- var tpl_index = jQuery(this).attr("tpl_index");
- if(in_array(jQuery(this).attr("tpl_index"), customTplsIds)){
- if(in_array(jQuery(this).attr("tpl_index"), [10,1011,11])){
- var style = "width:200px;color:gray;";
- var state = "disabled";
- }else{
- var style = "width:200px;";
- var state = "enabled";
- }
- }
- else{
- var style = "width:200px;color:gray;";
- var state = "disabled";
- }
- html = ""+
- '<div style="padding:10px 30px">'+
- '<div style="margin:5px 0; float: left">选择纸张:</div>'+
- '<div style="float: left"><select id="paperSize" style="'+style+'" '+state+' >'+
- '<option value="A3" ';
- if(jQuery(this).attr("paper_size")=='A3'){ html=html+'selected';}
- html=html+'>A3</option>'+
- '<option value="A4" ';
- if(jQuery(this).attr("paper_size")=='A4'){ html=html+'selected';}
- html=html+'>A4</option>'+
- '<option value="8K" ';
- if(jQuery(this).attr("paper_size")=='8K'){ html=html+'selected';}
- html=html+'>8K</option>'+
- '<option value="16K" ';
- if(jQuery(this).attr("paper_size")=='16K'){ html=html+'selected';}
- html=html+'>16K</option>'+
- '</select></div>'+
- '<div style="padding-top:10px;clear: left"></div>'+
- '<div style="margin:5px 0; float: left">阅卷方式:</div>'+
- '<div style="float: left"><select id="mark_type" style="width:200px">'+
- '<option value="0" ';
- if(jQuery(this).attr("mark_type")=='0'){ html=html+'selected';}
- html=html+'>线下阅卷</option>'+
- '<option value="1" ';
- if(jQuery(this).attr("mark_type")=='1'){ html=html+'selected';}
- html=html+'>在线阅卷(题)</option> <option value="3" ';
- if(jQuery(this).attr("mark_type")=='3'){ html=html+'selected';}
- html=html+'>班级混合阅卷</option> <option value="4" ';
- if(jQuery(this).attr("mark_type")=='4'){ html=html+'selected';}
- html=html+'>班级单独阅卷</option> '+
- '</select></div>'+
- '<div class="row" style="margin:30px auto;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>'+
- '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>'+
- '</div>'+
- '</div>'+
- "";
- layer.open({
- type: 1,
- area: ['350px', '220px'],
- title: "更改试卷",
- content: html,
- success: function(index, layerObj){
- jQuery("#cancel").on("click", function(){
- layer.closeAll();
- });
- jQuery("#confirm").on("click", function(){
- var paperSize = jQuery("#paperSize").val();
- var mark_type = jQuery("#mark_type").val();
- jQuery.post(
- "<?php echo $this->createUrl("print/setpapersize");?>",
- {"examId": examId, "paperSize": paperSize,"mark_type":mark_type,"tpl_index":tpl_index},
- function(data){
- data = JSON.parse(data);
- layer.msg(data.message);
- if(data.success == 1){
- setTimeout(function(){location.reload();}, 1300);
- }
- }
- );
- layer.closeAll();
- });
- },
- end: function(){
- }
- });
- });
- // 根据年级筛选班级
- jQuery("#grade").change(function(){
- var grade = $(this).val();
- if (!grade) return false;
- jQuery.post(
- '<?php echo $this->createUrl("print/getGradeClass");?>',{"grade": grade},function(data){
- data = JSON.parse(data);
- if(data.success == 1){
- var classObj = $("#class");
- var html = "<option value=''>全部班级</option>";
- classObj.empty();
- $.each(data.message,function(i,n){
- html += "<option value='"+n.class_id+"'>" + n.class_name + "</option>";
- });
- classObj.append(html);
- }
- }
- );
- });
- jQuery(".maskType").click(function () {
- var is_show = jQuery(this).attr("is_show");
- if (is_show > 0) {
- return false;
- }
- var _display = '';
- var exam_group_id = jQuery(this).attr("examId");
- var tpl_index = jQuery(this).attr("tpl_index");
- var marking_papers=$(this).attr('marking_papers');
- var online_card=$(this).attr('online');
- var mar = 'margin:30px auto;';
- html = "" +
- '<div style="padding:10px 30px">' +
- '<div style="padding-top:10px;clear: left"></div>' +
- '<div style="margin:5px 0; float: left;';
- html = html + '">阅卷方式:</div>' +
- '<div style="float: left"><select id="mark_type" style="width:200px;';
- html = html + '">' +
- '<option value="0" ';
- if (jQuery(this).attr("mark_type") == '0') {
- html = html + 'selected';
- }
- html = html + '>线下阅卷</option>';
- html = html + ' <option value="3" ';
- if (jQuery(this).attr("mark_type") == '3') {
- html = html + 'selected';
- }
- html = html + '>班级混合阅卷</option> ';
- html = html + ' <option value="4" ';
- if (jQuery(this).attr("mark_type") == '4') {
- html = html + 'selected';
- }
- html = html + '>班级单独阅卷</option> ' +
- '</select></div>' +
- '<div class="row" style="' + mar + 'text-align: center;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>' +
- '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>' +
- '</div>' +
- "";
- layer.open({
- type: 1,
- area: ['350px', '300px'],
- title: "更改试卷",
- content: html,
- success: function (index, layerObj) {
- jQuery("#cancel").on("click", function () {
- layer.closeAll();
- });
- jQuery("#confirm").on("click", function () {
- var mark_type = jQuery("#mark_type").val();
- console.log('markpapers:'+marking_papers+',marktyp:'+mark_type+',online:'+online_card);
- if(online_card==1 && marking_papers==2 && mark_type==0){
- layer.msg("当前在线答题卡的评阅方式为网阅,不支持修改为线下阅卷,请进入在线答题卡修改评阅方式为手批后再更改阅卷方式!", {
- time: 0,
- btn: ['我已知晓'],
- yes: function (index) {
- layer.closeAll();
- }
- })
- }else{
- jQuery.post(
- "<?php echo $this->createUrl("print/Setmasktype");?>",
- {"exam_group_id": exam_group_id, "mark_type": mark_type, "tpl_index": tpl_index},
- function (data) {
- data = JSON.parse(data);
- if (data.success == 1) {
- layer.msg(data.message);
- setTimeout(function () {
- location.reload();
- }, 1300);
- }else{
- layer.msg(data.message,{time:10000});
- }
- }
- );
- }
- });
- },
- end: function () {
- }
- });
- });
- jQuery(".studentCard").click(function () {
- var is_show = jQuery(this).attr("is_show");
- var cardLength=jQuery(this).attr("cardLength");
- if (is_show > 0) {
- return false;
- }
- var _display = '';
- var exam_group_id = jQuery(this).attr("examId");
- var mar = 'margin:30px auto;';
- html = "" +
- '<div style="padding:10px 30px">' +
- '<div style="padding-top:10px;clear: left"></div>' +
- '<div style="margin:5px 0; float: left;';
- html = html + '">考号类型:</div>' +
- '<div style="float: left"><select id="schoolCard" style="width:200px;';
- html = html + '">' +
- '<option value="1" ';
- if (jQuery(this).attr("school_card_status") == '1') {
- html = html + 'selected';
- }
- html = html + '>学校准考证</option>';
- html = html + ' <option value="0" ';
- if (jQuery(this).attr("school_card_status") == '0') {
- html = html + 'selected';
- }
- html = html + '>系统准考证</option> '+
- '</select></div>';
- html+='<div style="margin:5px 0; float: left;">考号位数:</div>';
- html+='<div style="margin:5px 0; float: left"><input type="text" id="schoolCardLength" length="'+cardLength+'" name="schoolCardLength" value="'+cardLength+'"></div>'+
- '<div class="row" style="' + mar + 'text-align: center;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>' +
- '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>' +
- '</div>' +
- "";
- layer.open({
- type: 1,
- area: ['350px', '300px'],
- title: "更改考号类型",
- content: html,
- success: function (index, layerObj) {
- jQuery("#cancel").on("click", function () {
- layer.closeAll();
- });
- jQuery("#confirm").on("click", function () {
- var schoolCard = jQuery("#schoolCard").val();
- var schoolCardLength = parseInt(jQuery("#schoolCardLength").val());
- if(schoolCard==1 && schoolCardLength==0){
- layer.msg('请输入准考证位数');
- return false;
- }else if(schoolCard==1 && (jQuery("#schoolCardLength").val()%1 !== 0 || schoolCardLength>14)){
- layer.msg('准考证位数不正确');
- return false;
- }
- jQuery.post(
- "<?php echo $this->createUrl("print/changeStudentCardType");?>",
- {"examGroupId": exam_group_id, "schoolCard": schoolCard, "schoolCardLength": schoolCardLength},
- function (data) {
- data = JSON.parse(data);
- layer.msg(data.message);
- if (data.success == 1) {
- setTimeout(function () {
- location.reload();
- }, 1300);
- }
- }
- );
- layer.closeAll();
- });
- },
- end: function () {
- }
- });
- });
- $('body').on('change','#schoolCard',function(){
- console.log($(this).val());
- studentCard= $('#schoolCardLength').attr('length');
- if($(this).val()==0){
- $('#schoolCardLength').val('');
- $('#schoolCardLength').attr('disabled',true);
- }else{
- $('#schoolCardLength').val(studentCard);
- $('#schoolCardLength').attr('disabled',false);
- }
- })
- });
- $(document).ready(function(){
- /*var str = '<div class="points"></div>';
- $(".sc-lis").each(function(){
- if($(this).find(".points").length>0){
- $(".sel-opt").append(str);
- }
- });*/
- $('body').on('click','.selectSendType',function(){
- $('.selectSendType').removeClass('selected');
- $('input[name=sendType]').val($(this).index());
- $(this).addClass('selected');
- })
- $(".layshow-btn").click(function(){
- var isAnswerSheet = $(this).attr("isAnswerSheet");
- var examGroupId = $(this).attr("examGroupId");
- if(isAnswerSheet != 1){
- layer.msg('尚未创建答题卡,请创建');
- return false;
- }
- $('.english_paper_id').val(examGroupId);
- layer.open({
- type: 1,
- title: '上传试卷',
- btn:['发送标注'],
- area: ['560px', '350px'], //宽高
- content: $(".layer-upload"),
- yes:function(index){
- sendPaperAndAnswer(examGroupId);
- layer.close(index);
- },
- });
- })
- $(".sel-opt,.sel-cons").mouseover(function(){
- $(".sel-cons").show();
- }).mouseout(function(){
- $(".sel-cons").hide();
- });
- $(".sc-lis").click(function(){
- var data = {
- subjectId : $(this).attr('val')
- };
- $.post("<?php echo Yii::app()->createUrl('third/setSubjectId')?>",data,function(flags){
- if(flags)
- {
- location.reload();
- }else
- {
- alert('网络异常');
- }
- });
- $('.has-sel').text($(this).text());
- $(".sel-cons").hide();
- });
- $(".ruanyun").click(function(){
- var exam_id = $(this).attr('exam_id');
- layer.msg("确定发送吗?学生是否全部上传成绩", {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('print/send_ruanyun_pdf');?>",
- type: "POST",
- dataType: "json",
- data:{ examId: exam_id
- },
- success: function (data){
- if(data.status == 1){
- layer.msg('发送成功',{
- icon: 1
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }else if(data.status == 2){
- layer.msg('发送失败,未上传成绩',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }else{
- layer.msg('发送失败',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- });
- $(".create_sheet").click(function(){
- var exam_group_id = $(this).attr("exam_group_id");
- var sheet_id = $(this).attr("sheet_id");
- var mark_type = $(this).attr("mark_type");
- var tw_status = $(this).attr("tw_status");
- var labelled = $(this).attr("labelled");
- var feedback = $(this).attr("feedback");
- var version_number='<?php echo $version_number?>';
- var qxk=$(this).attr("qxk");
- if(mark_type==0){
- layer.msg('当前考试为线下阅卷,暂不支持切割模板,请使用在线答题卡功能进行考试。',{
- icon:5,time:5000
- }, function(){
- layer.closeAll();
- location.reload();
- });
- return false;
- }
- if(exam_group_id>0){
- $.post("<?php echo Yii::app()->createUrl('third/set_new')?>",{exam_group_id:exam_group_id});
- $.post("<?php echo Yii::app()->createUrl('third/verify_exam_rs')?>",{exam_group_id:exam_group_id},function(rs){
- var m = JSON.parse(rs);
- if(m.status==2)
- {
- layer.msg('非法考试!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==5)
- {
- $('input[name=tpl_exam_group_id]').val(exam_group_id);
- $('input[name=tpl_qxk]').val(qxk);
- if(feedback==1 || labelled>0){
- $('.tpl_new').attr('feedback',1);
- }else{
- $('.tpl_new').attr('feedback',0);
- }
- $('#fieldModalTopic').show();
- }
- if(m.status==0)
- {
- msg="当前考试已发送解析,修改答题卡需要重新上传解析,请确认!";
- if((tw_status==2 || tw_status==1) && labelled==0){
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- if(qxk=='1'){
- evaluationClient.createAnswerSheetNewQuestion(0+","+exam_group_id);
- }else{
- evaluationClient.createAnswerSheet(0+","+exam_group_id);
- }
- }
- });
- }else{
- if(qxk=='1'){
- evaluationClient.createAnswerSheetNewQuestion(0+","+exam_group_id);
- }else{
- evaluationClient.createAnswerSheet(0+","+exam_group_id);
- }
- }
- }
- });
- }
- });
- $(".create_sheet_subject").click(function(){
- var exam_group_id = $(this).attr("exam_group_id");
- var sheet_id = $(this).attr("sheet_id");
- var mark_type = $(this).attr("mark_type");
- var tw_status = $(this).attr("tw_status");
- var labelled = $(this).attr("labelled");
- var qxk=$(this).attr("qxk");
- var feedback = $(this).attr("feedback");
- var version_number='<?php echo $version_number?>';
- if(mark_type==0){
- layer.msg('当前考试为线下阅卷,暂不支持切割模板,请使用在线答题卡功能进行考试。',{
- icon:5,time:5000
- }, function(){
- layer.closeAll();
- location.reload();
- });
- return false;
- }
- if(exam_group_id>0){
- $.post("<?php echo Yii::app()->createUrl('third/set_new')?>",{exam_group_id:exam_group_id});
- $.post("<?php echo Yii::app()->createUrl('third/verify_exam_rs')?>",{exam_group_id:exam_group_id},function(rs){
- var m = JSON.parse(rs);
- if(m.status==2)
- {
- layer.msg('非法考试!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==5)
- {
- $('input[name=tpl_exam_group_id]').val(exam_group_id);
- $('input[name=tpl_qxk]').val(qxk);
- if(feedback==1 || labelled>0){
- $('.tpl_new').attr('feedback',1);
- }else{
- $('.tpl_new').attr('feedback',0);
- }
- $('#fieldModalTopic').show();
- }
- if(m.status==0 || m.status==1)
- {
- if((tw_status==2 || tw_status==1) && labelled==0){
- layer.msg('当前考试已发送解析,修改答题卡需要重新上传解析,请确认!', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- if(qxk=='1'){
- evaluationClient.createAnswerSheetNewQuestion(sheet_id+","+exam_group_id+",<?php echo Yii::app()->session['session_duoxueke_subject_id']?>");
- }else{
- evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id+",<?php echo Yii::app()->session['session_duoxueke_subject_id']?>");
- }
- }
- });
- }else{
- if(qxk=='1'){
- evaluationClient.createAnswerSheetNewQuestion(sheet_id+","+exam_group_id+",<?php echo Yii::app()->session['session_duoxueke_subject_id']?>");
- }else{
- evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id+",<?php echo Yii::app()->session['session_duoxueke_subject_id']?>");
- }
- }
- }
- });
- }
- });
- //打印
- $(".print_sheet").click(function(){
- var exam_group_id = $(this).attr('exam_group_id');
- if(!exam_group_id)
- {
- layer.msg('非法考试!');
- return false;
- }
- $.post("<?php echo Yii::app()->createUrl('third/print_paper')?>",{exam_group_id:exam_group_id},function(rs){
- var m = JSON.parse(rs);
- if(m.status)
- {
- evaluationClient.CreateDiSanFang(m.result);
- }
- });
- });
- $('.tab_btn').click(function(){
- $('input[name="list_type"]').val($(this).index());
- });
- $('.create-third').click(function(){
- var textbook_set_alert=0;
- var href='';
- <?php
- if(isset($list_type) && $list_type==1){
- echo "href='".$this->createUrl("third/thirdview_under_line")."';";
- } else{
- if(Yii::app()->params['section']==0){
- echo "href='".$this->createUrl("third/thirdview_section")."';";
- }elseif(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(3,6))){
- if(!Yii::app()->params['school_textbook_setting']){
- echo 'textbook_set_alert=1;';
- }
- echo "href='".$this->createUrl("third/thirdview")."';";
- }else{
- echo "href='".$this->createUrl("third/thirdview_duo")."';";
- }
- }
- ?>
- if(textbook_set_alert==1){
- layer.msg('请先在教材管理模块设置高一、高二的教材版本');
- return false;
- }
- window.location=href;
- });
- $('.upload-btn-paper').click(function(){
- var This = $(this);
- $($(this).parent().find("input")).each(function(){
- if(!$(this).val()){
- $(this).remove();
- }
- });
- // var length = parseInt($('.upload-ul-paper li').length);
- var html = '<input type="file" name="paper_exam'+filePaper+'" id="paper_exam'+filePaper+'" style="display:none" class="upload-paper-types">';
- This.after(html);
- This.parent().find("#paper_exam"+filePaper).click();
- filePaper++;
- });
- $("body").delegate(".upload-paper-types","change",function(){
- var idName = $(this).attr('id');
- var filename = $(this).val();
- var nameStart = filename.lastIndexOf('\\');
- var fileNameRe = filename.substring(nameStart,filename.length);
- fileNameRe = fileNameRe.substr(1);
- var extStart = filename.lastIndexOf('.');
- var extName = filename.substring(extStart,filename.length).toLowerCase();
- if (extName != ".docx" && extName != ".doc" && extName != ".pdf" && extName != ".gif" && extName != ".bmp" && extName != ".jpg" && extName != ".jpeg" && extName != ".png") {
- layer.msg('试卷格式错误');
- $(this).remove();
- return false;
- }
- var length = $(".upload-btn-paper").parent().find("input").length;
- var html = "";
- html += '<li class="clearfix">';
- html += ' <span class="fl paper-no">第'+length+'页</span>';
- html += ' <span class="fl">'+fileNameRe+'</span>';
- html += ' <em class="fr red remove-file-paper" idName="'+idName+'">×</em>';
- html += '</li>';
- $('.upload-ul-paper').append(html);
- });
- $('.upload-btn-answer').click(function(){
- var This = $(this);
- $($(this).parent().find("input")).each(function(){
- if(!$(this).val()){
- $(this).remove();
- }
- });
- // var length = parseInt($('.upload-ul-answer li').length);
- var html = '<input type="file" name="paper_answer'+fileAnswer+'" id="paper_answer'+fileAnswer+'" style="display:none" class="upload-answer-types">';
- This.after(html);
- This.parent().find("#paper_answer"+fileAnswer).click();
- fileAnswer++;
- });
- $("body").delegate(".upload-answer-types","change",function(){
- var idName = $(this).attr('id');
- var filename = $(this).val();
- var nameStart = filename.lastIndexOf('\\');
- var fileNameRe = filename.substring(nameStart,filename.length);
- fileNameRe = fileNameRe.substr(1);
- var extStart = filename.lastIndexOf('.');
- var extName = filename.substring(extStart,filename.length).toLowerCase();
- if (extName != ".docx" && extName != ".doc" && extName != ".pdf" && extName != ".gif" && extName != ".bmp" && extName != ".jpg" && extName != ".jpeg" && extName != ".png") {
- layer.msg('答案解析格式错误');
- $(this).remove();
- return false;
- }
- var length = $(".upload-btn-answer").parent().find("input").length;
- var html = "";
- html += '<li class="clearfix">';
- html += ' <span class="fl answer-no">第'+length+'页</span>';
- html += ' <span class="fl">'+fileNameRe+'</span>';
- html += ' <em class="fr red remove-file-answer" idName="'+idName+'">×</em>';
- html += '</li>';
- $('.upload-ul-answer').append(html);
- });
- $("body").delegate(".remove-file-paper","click",function(){
- var idName = $(this).attr("idName");
- $(this).parent().remove();
- $('#'+idName).remove();
- var no = 1;
- $(".upload-ul-paper li").each(function(){
- $(this).find(".paper-no").html("第"+no +"页");
- no++;
- });
- });
- $("body").delegate(".remove-file-answer","click",function(){
- var idName = $(this).attr("idName");
- $(this).parent().remove();
- $('#'+idName).remove();
- var no = 1;
- $(".upload-ul-answer li").each(function(){
- $(this).find(".answer-no").html("第"+no +"页");
- no++;
- });
- });
- });
- function showError(str)
- {
- layer.msg(str,{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- function objToJson(obj){
- var json = "{ ";
- for(var item in obj){
- json += "'"+item+"':'"+obj[item]+"',";
- }
- json += " }";
- return json;
- }
- function ccc(){
- layer.msg('敬请期待!', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- return false;
- }
- });
- }
- function delExam(odj){
- if (!odj) return false;
- var classId = odj.getAttribute("w_class_id");
- var examId = odj.getAttribute("w_exam_id");
- if (!classId || !examId) return false;
- var msg = '您确定要删除此班的考试吗?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('print/delexam');?>",
- type: "POST",
- dataType: "json",
- data: {
- examId: examId,
- classId:classId
- },
- success: function (data){
- if(data.status == 1){
- layer.msg('删除成功',{
- icon: 1
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }else{
- layer.msg('删除失败',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- }
- // 确认上传成绩
- function uploadConfirm(classId, examId,className,is_uploaded_count,students_count) {
- //if (confirm('您确定已上传成绩了吗?')) {
- msg = "<div style='text-align:left;'>("+className+")已上传(<span style=' font-size:20px;color:#15ae68 ;font-weight: bold'>"+is_uploaded_count+"</span>)份试卷,还有(<span style='font-size:20px;color: red;font-weight: bold'>"+(students_count-is_uploaded_count)+"</span>)份试卷未上传!是否确认本班级试卷都已上传?<br/><br/><span style='color: red'>请注意!试卷上传确认后将不能再次上传本班的试卷!!!</span></div>";
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index, layerObj){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('print/uploadConfirm');?>",
- type: "POST",
- data: {
- classId: classId,
- examId: examId
- },
- beforeSend:function(){
- // 发送请求显示打印中
- layer.msg('确认中...', {time: 20000});
- },
- dataType: "JSON",
- success: function(data) {
- if (data.status == 1) {
- layer.msg('确认成功!');
- setTimeout(function(){location.reload();}, 1300);
- } else {
- layer.msg(data.error);
- }
- },
- complete:function(){
- },
- error:function(){
- }
- });
- }
- });
- //}
- }
- // 打印错题本
- function printBook(cid,eid,type){
- if (!cid || !eid || !type) {
- layer.msg("打印参数有误");return;
- }
- var message = '';
- var objUrl = '';
- if (type == 1) {
- message = "您确定要下载该班级纠错本吗?";
- objUrl = "<?php echo $this->createUrl('print/downloadwrongtopic');?>";
- divTitle = "下载错题本";
- improveName = "错题本";
- } else if (type == 2){
- message = "您确定要下载该班级个性化学习方案吗?";
- objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
- divTitle = "下载个性化学习方案";
- improveName = "个性化学习方案";
- }else if (type == 3){
- message = "您确定要下载该班级个性化学习宝吗?";
- objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
- divTitle = "下载个性化学习宝";
- improveName = "个性化学习宝";
- }
- else{
- layer.msg("打印参数有误");return;
- }
- html = ""+
- '<div style="padding:20px 30px 0px 30px">'+
- '<div style="padding:8px 0;">请复制下方链接下载'+improveName+'。</div>'+
- '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
- '<div class="row" style="margin:30px auto 0px auto;text-align:center"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;background:gray;border-color:gray;">关闭</button>'+
- '</div>'+
- '</div>'+
- "";
- layer.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- msgIndex = layer.msg("下载中请稍后...", {"time": 3600000});
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: cid, eid: eid,type:type } );
- /*if(type == 1)
- location.href = objUrl+"/cid/"+cid+"/eid/"+eid;
- else
- location.href = objUrl+"/cid/"+cid+"/eid/"+eid+"/type/"+type;*/
- startTime = (new Date()).getTime();
- showTip = true;
- tipShowed = false;
- toPromptTime = 3000;
- window.interval = setInterval(function(){
- execTime = (new Date()).getTime() - startTime;
- if(execTime > toPromptTime && showTip && !tipShowed){
- // msgIndex = layer.msg("该文件较大,请耐心等待...", {"time": 3600000});
- // tipShowed = true;
- }
- }, 1000);
- jQuery.get(
- "<?php echo $this->createUrl("print/getImproveFile");?>",
- {"examId": eid, "classId": cid, "type": type},
- function(data){
- data = JSON.parse(data);
- if(data.success == 1||data.success == 2){
- layer.open({
- type: 1,
- area: ['550px', '220px'],
- title: divTitle,
- content: html,
- success: function(index, layerObj){
- clearInterval(window.interval);
- msgIndex = layer.msg(data.limitinfo, {"time": 3000});
- clearInterval(window.interval);
- layer.close(msgIndex);
- jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+data.downloadPath+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
- jQuery("#confirm, #cancel").on("click", function(){
- layer.close(layerObj);
- });
- jQuery("#copy").on("click", function(){
- jQuery("#url").select();
- });
- },
- end: function(){
- }
- });
- }
- else if(data.success == 0){
- clearInterval(window.interval);
- msgIndex = layer.msg(data.message, {"time": 3000});
- }
- }
- );
- }
- });
- }
- // 上传试卷模板
- function uploadTemplate(eid,name,grade){
- if (!eid) {
- layer.msg('操作失败!');
- return false;
- }
- forCheckUrl = "<?php echo $this->createUrl('third/checkanswercard');?>";
- $.post(forCheckUrl,{eid:eid},function(data){
- var obj = JSON.parse(data);
- var subject_id = '<?php echo Yii::app()->session['session_duoxueke_subject_id']?>';
- if(obj.success==1)
- {
- var html ='<div class="layer_notice" style="padding:5px;">';
- if(subject_id == 12){
- html += '<div><a style="color:#0e8e54" href="/assets/data/physics_topic_mould.docx">下载试卷模板</a></div>';
- }
- html +='<table class="table table-striped table-bordered table-hover ">';
- html +='<thead class="thin-border-bottom">';
- html +='<tr>';
- html +='<th>试卷名称</th>';
- html +='<th>操作</th>';
- html +='</tr>';
- html +='</thead>';
- html +='<tbody class="content_tbody">';
- if(subject_id == 3 ||subject_id == 6 ) {
- html += '<td>' + name + '</td><td><input type="radio" value="1" name="upload_type" class="upload_type" checked><input type="file" style="display: inline" name="word_file" id="word_file" />';
- html += ' <input type="radio" name="upload_type" class="upload_type" value="2" >复用试卷</td></tr>';
- }else{
- html += '<td>' + name + '</td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
- }
- html +='</tbody>';
- html +='</table>';
- html +='<span style="width:582px;display:inline-block;text-align:center;">';
- html +='<button class="btn btn-success btn-sm upload-word" onclick="uploadWord()"><i class="ace-icon fa fa-check bigger-110"></i>确定</button>';
- html +='<button class="btn btn-success btn-sm select-exam" onclick="selectExam('+grade+',\''+eid+'\')" style="display:none"><i class="ace-icon fa fa-check bigger-110"></i>确定</button>';
- html +='</span>';
- html +='<input type="hidden" id="mpEGid" value="'+eid+'">';
- html +='</div>';
- layer.open({
- type: 1,
- skin: 'layui-layer-rim', //加上边框
- area: ['600px', '300px'], //宽高
- content: html
- });
- }else
- {
- layer.msg(obj.message,{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- //layer.msg(obj.message);
- }
- });
- }
- $('body').on('click','.upload_type',function(){
- console.log($(this).val());
- if($(this).val()==1){
- $('.upload-word').show();
- $('.select-exam').hide();
- }else{
- $('.upload-word').hide();
- $('.select-exam').show();
- }
- });
- //复用试卷
- var copyExamArr=[];
- function selectExam(grade,examGroupId){
- copyExamArr=[];
- $.ajax({
- url:'<?php echo $this->createUrl('third/loadCopyPaper')?>',
- type:'POST',
- dataType:'json',
- data:{grade:grade,examGroupId:examGroupId},
- success:function(res){
- if(res.status==1){
- rs=res.data;
- if(rs.length>0){
- $.each(rs,function(k,v){
- copyExamArr.push(v)
- })
- showCopyExam(1,examGroupId)
- }else{
- layer.msg('暂时没有可以复用的考试');
- }
- }
- }
- });
- }
- function showCopyExam(page,examGroupId){
- var pageLimit=10;
- start=(page-1)*pageLimit
- end =start+pageLimit
- console.log(examGroupId);
- maxPage= Math.ceil(copyExamArr.length/pageLimit);
- var nowPageData=copyExamArr.slice(start,end)
- console.log(nowPageData)
- var html='';
- pageHtml='';
- // layer.closeAll()
- $.each(nowPageData,function(i,v){
- html+='<tr>';
- html+='<td>'+v['name']+'</td>';
- html+='<td>'+v['create_time']+'</td>';
- html+='<td>'+v['exam_date']+'</td>';
- html+='<td><a href="#" targetExamId="'+examGroupId+'" class="copyPaperTopic" id="'+v['exam_group_id']+'">复用</a></td>';
- html+='</tr>';
- });
- if(maxPage>1){
- pageHtml+='<ul class="yiiPager">';
- if(page>1){
- pageHtml+='<li class="previous" id="'+examGroupId+'" pageNum="'+(page-1)+'"><a href="#" >上一页</a></li>';
- }
- for(var i=1;i<=maxPage;i++){
- if(page==i){
- pageHtml+='<li class="page selected"><a href="#" >'+i+'</a></li>';
- }else{
- pageHtml+='<li class="page"><a href="#" id="'+examGroupId+'" class="gotoPage">'+i+'</a></li>';
- }
- }
- if(page<maxPage){
- pageHtml+='<li class="next" id="'+examGroupId+'" pageNum="'+(page+1)+'"><a href="#" >下一页</a></li>';
- }
- pageHtml+='<li >共:'+copyExamArr.length+'条</li>';
- pageHtml+='</ul>';
- }
- $('.student_list_page').html(pageHtml);
- $('.student-list').find('tbody').html(html)
- // $('#fieldModalStudent').show();
- }
- $('.student-list-close').click(function(){
- $('#fieldModalStudent').hide();
- });
- //复用按钮状态
- var copyBtn=true;
- $('.class_area')
- .on('click','.gotoPage',function(){
- page=parseInt($(this).html());
- eid=$(this).attr('id');
- showCopyExam(page,eid)
- })
- .on('click','.next',function(){
- page=parseInt($(this).attr('pageNum'))
- eid=$(this).attr('id');
- showCopyExam(page,eid);
- })
- .on('click','.previous',function(){
- page=parseInt($(this).attr('pageNum'))
- eid=$(this).attr('id');
- showCopyExam(page,eid);
- })
- .on('click','.copyPaperTopic',function(){
- targetExamGroupId=$(this).attr('targetExamId');
- copyExamGroupId=$(this).attr('id');
- if(copyBtn){
- var waiting=layer.msg('正在处理,请稍候。。。。。。',{time:0})
- copyBtn=false;
- $.ajax({
- url:'<?php echo $this->createUrl('third/copyPaperTopic')?>',
- type:'POST',
- dataType:'json',
- data:{examGroupId:targetExamGroupId,copyExamGroupId:copyExamGroupId},
- success:function(res){
- layer.close(waiting)
- if(res.status==1){
- layer.msg('复用成功',{time:2000},function(){
- window.location.reload();
- });
- }else{
- if(res.msg!=undefined){
- layer.msg(res.msg);
- // layer.closeAll();
- //alert(res.msg);
- }else{
- layer.msg('复用失败');
- }
- copyBtn=true;
- }
- }
- })
- }
- return false;
- })
- //复用
- function uploadWord() {
- var paramEid = $('input[name=upload_template_eid]').val();
- if (!paramEid) {
- layer.msg('没找到考试ID!');
- return false;
- }
- var obj_file = $("#word_file").val();
- if (!obj_file) {
- layer.msg('请选择上传文件');
- return false;
- }
- var extStart = obj_file.lastIndexOf('.');
- var extName = obj_file.substring(extStart,obj_file.length).toLowerCase();
- if (extName != ".docx" && extName != ".dotx" && extName != ".dotm") {
- layer.msg('模板格式有误,请上传dotx格式word!');
- return false;
- }
- $.ajaxFileUpload({
- url: "<?php echo $this->createUrl('third/uploadTpl');?>", //用于文件上传的服务器端请求地址
- secureuri: false, //是否需要安全协议,一般设置为false
- fileElementId: 'word_file', //文件上传域的ID
- dataType: 'text', //返回值类型 一般设置为json
- data:{"eid":paramEid},
- success: function (data, status){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- layer.msg(obj.message,{
- icon: 1,
- }, function(){
- layer.closeAll();
- location.reload();
- });
- $("#alreadUpload").html('<span style="color:red;">已上传</span>');
- } else {
- layer.msg(obj.message,{
- icon: 2,
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 1,
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- });
- return false;
- }
- // 搜索事件
- $("#search").click(function(){
- $("#form1").submit();
- });
- function print(cid,eid,tid,fg){
- if (!cid || !eid) return false;
- var msg = '';
- if (tid == 0) {
- if (fg == 1) {
- msg = '打印答题卡';
- } else {
- msg = '您确定要打印该试卷嘛?';
- }
- } else if (tid == 1) {
- msg = '您确定要打印该错题本嘛?';
- } else if (tid == 2) {
- msg = '您确定要打印该个性化学习宝吗?';
- }
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- ajaxPrint(cid, eid, tid);
- }
- });
- }
- function ajaxPrint(cid, eid, tid) {
- $.ajax({
- url:"<?php echo $this->createUrl('print/ajaxupdate');?>",
- type:"post",
- data:{cid:cid,eid:eid,tid:tid},
- dataType: "json",
- beforeSend:function(){
- // 发送请求显示打印中
- layer.msg('打印中', {icon: 16,time: 20000});
- },
- success:function(obj){
- var index = layer.msg();
- layer.close(index);
- if (obj.success == 1) {
- if (tid == 0) {//console.log(JSON.stringify(obj.message));
- evaluationClient.printPaper(JSON.stringify(obj.message));
- //alert('提交打印试卷成功!');
- } else if (tid == 1) {
- evaluationClient.printCTB(JSON.stringify(obj.message));
- //alert('提交打印错题本成功!');
- } else if (tid == 2) {
- evaluationClient.printTFFA(JSON.stringify(obj.message));
- //alert('提交打印提分册成功!');
- } else {
- layer.msg('操作错误!');
- }
- location.reload();
- } else {//alert(obj.message);
- layer.msg(obj.message);
- }
- },
- complete:function(){
- //layer.msg('打印失败!');
- //var index = layer.msg();
- //layer.close(index);
- },
- error:function(){
- //var index = layer.msg();
- //layer.close(index);
- }
- });
- }
- // 生成试卷模板
- function createTemplate (exam_group_id,import_type){
- if (!exam_group_id) {
- layer.msg('未找到试卷ID');
- }
- var data={
- exam_group_id:exam_group_id
- }
- $.post("<?php echo Yii::app()->createUrl("third/paper")?>",data,function(rs){
- var m = JSON.parse(rs);
- if(m.status==1)
- {
- if(import_type>0){
- evaluationClient.ImportLoadThirdParty(exam_group_id);
- }else{
- evaluationClient.loadThirdParty(exam_group_id);
- }
- }else {
- layer.msg('尚未创建答题卡,请创建');
- }
- });
- }
- // 生成试卷模板
- function createTemplateSubject (exam_group_id,subject,import_type){
- if (!exam_group_id||!subject) {
- layer.msg('未找到试卷ID');
- }
- var data={
- exam_group_id:exam_group_id
- }
- console.log(import_type);
- $.post("<?php echo Yii::app()->createUrl("third/paper")?>",data,function(rs){
- var m = JSON.parse(rs);
- if(m.status==1)
- {
- if(import_type>0){
- console.log('导入');
- evaluationClient.ImportLoadThirdParty(exam_group_id+','+subject);
- }else{
- console.log('非导入');
- evaluationClient.loadThirdParty(exam_group_id+','+subject);
- }
- }else {
- layer.msg('尚未创建答题卡,请创建');
- }
- });
- }
- function wb_html(odj){
- if (!odj) return false;
- var classId = odj.getAttribute("w_class_id");
- var examId = odj.getAttribute("w_exam_id");
- if (!classId || !examId) return false;
- var msg = '您确定要生成该班级的错题本吗?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('client/wbhtml');?>",
- type: "POST",
- dataType: "json",
- data: {
- examId: examId,
- classId:classId
- },
- success: function (data){
- if(data > 0){
- layer.msg('操作成功,重新生成错题本',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }else if(data==0){
- layer.msg('操作失败,此班无错题本',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- else{
- layer.msg('操作失败,重新生成错题本',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- }
- function isp2_html(odj){
- if (!odj) return false;
- var classId = odj.getAttribute("w_class_id");
- var examId = odj.getAttribute("w_exam_id");
- if (!classId || !examId) return false;
- var msg = '您确定要生成该班级的二步提分方案吗?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('client/isp2html');?>",
- type: "POST",
- dataType: "json",
- data: {
- examId: examId,
- classId:classId
- },
- success: function (data){
- if(data > 0){
- layer.msg('操作成功,重新生成提分方案',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }else if(data==0){
- layer.msg('操作失败,此班无提分方案',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- else{
- layer.msg('操作失败,重新生成提分方案',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- }
- function isp3_html(odj){
- if (!odj) return false;
- var classId = odj.getAttribute("w_class_id");
- var examId = odj.getAttribute("w_exam_id");
- if (!classId || !examId) return false;
- var msg = '您确定要生成该班级的个性化学习宝吗?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('client/isp3html');?>",
- type: "POST",
- dataType: "json",
- data: {
- examId: examId,
- classId:classId
- },
- success: function (data){
- if(data > 0){
- layer.msg('操作成功,重新生成提分方案',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }else if(data==0){
- layer.msg('操作失败,此班无提分方案',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- else{
- layer.msg('操作失败,重新生成提分方案',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- }
- // 隐藏试卷
- function oprateExam(examGroupId,flag){
- if (examGroupId) {
- layer.msg('未找到周周练id',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- var msg = '您确定要隐藏该试卷吗?';
- if (flag == 0) {
- msg = '您确定要恢复该试卷吗?';
- }
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.post('<?php echo $this->createUrl("third/oprateexam");?>',{exam_group_id:examGroupId,flag:flag},function(data){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- location.reload();
- } else {
- layer.msg(obj.message,{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- // layer.msg(obj.message);
- }
- });
- }
- });
- }
- function uploadExamTopic(ExamGroupId,Subject,Sheet,tplIndex){
- if (!ExamGroupId||!Subject) {
- layer.msg('未找到试卷ID');
- return false;
- }
- $.ajax({
- url:"<?php echo $this->createUrl('third/getthirdsheet');?>",
- type:"POST",
- dataType:"json",
- data:{exam_group_id:ExamGroupId},
- success:function (res) {
- if(res.success==1){
- evaluationClient.loadExamPaper(Sheet+','+ExamGroupId+','+Subject+','+tplIndex);
- }else if(res.success==4){
- layer.msg('您当前已发送试卷后台协助任务,为避免您产生与后台重复的操作,以造成数据混乱,已禁止您操作。请等待后台处理结果。\n' +
- '\n' +
- '\n' +
- '\n' +
- '您也可在后台协助详情页中撤回任务,自行操作!',{icon:5,time:5000});
- }else{
- layer.msg('请先关联答题卡');
- }
- }
- });
- }
- function uploadExamAnswer(ExamGroupId,Subject,Sheet){
- if (!ExamGroupId||!Subject) {
- layer.msg('未找到试卷ID');
- return false;
- }
- $.ajax({
- url:"<?php echo $this->createUrl('third/getthirdsheet');?>",
- type:"POST",
- dataType:"json",
- data:{exam_group_id:ExamGroupId,get_type:2},
- success:function (res) {
- if(res.success==1){
- evaluationClient.loadAnswerParsing(Sheet+','+ExamGroupId+','+Subject);
- }else if(res.success==4){
- layer.msg('您当前已发送答案解析后台协助任务,为避免您产生与后台重复的操作,以造成数据混乱,已禁止您操作。请等待后台处理结果。\n' +
- '\n' +
- '\n' +
- '\n' +
- '您也可在后台协助详情页中撤回任务,自行操作!',{icon:5,time:5000});
- }else{
- layer.msg('请先关联答题卡');
- }
- }
- });
- }
- // tips
- $(".open-tips").on("mouseenter", function () {
- var tips_text = $(this).attr("tipstext");
- layer.tips(tips_text, this, {
- tips: [1, '#14AE68'] //还可配置颜色
- });
- });
- function sendPaperAndAnswer(examGroupId){
- var print_time = $('input[name="english-print-time"]').val();
- var printTime = 0;
- if(print_time){
- var now_time = parseInt(new Date().getTime() / 1000);
- printTime = new Date(print_time).getTime() / 1000;
- if(now_time > printTime){
- layer.msg('期望时间不得小于当前时间');
- return false;
- }
- }else{
- layer.msg('请选择期望时间');
- return false;
- }
- var paperLength = $('.upload-btn-paper').parent().find("input").length;
- var answerLength = $('.upload-btn-answer').parent().find("input").length;
- var paperUrl = {};
- var answerUrl = {};
- var notice = '';
- if(paperLength == 0 && answerLength == 0){
- layer.msg('请上传试卷及答案解析');
- return false;
- }else if(paperLength == 0){
- layer.msg('请上传试卷');
- return false;
- }else if(answerLength == 0){
- layer.msg('请上传答案解析');
- return false;
- }else{
- var uploadFiles = [];
- $(".upload-btn-paper").parent().find("input").each(function(){
- if($(this).val()){
- if($("#"+$(this).attr("id"))[0].files[0].size >8388608){
- // layer.msg("文件过大");
- notice = "文件不能超过8M";
- // alert("文件不能超过8M");
- // return false;
- // location.reload();
- }else{
- uploadFiles.push($(this).attr("id"));
- }
- }
- });
- $(".upload-btn-answer").parent().find("input").each(function(){
- if($(this).val()){
- if($("#"+$(this).attr("id"))[0].files[0].size >8388608){
- notice = "文件不能超过8M";
- // layer.msg("文件过大");
- // alert("文件不能超过8M");
- // return false;
- // location.reload();
- }else{
- uploadFiles.push($(this).attr("id"));
- }
- }
- });
- if(notice != ""){
- layer.msg(notice,{time:2000});
- location.reload();
- return false;
- }
- layer.msg('正在上传,请稍候......',{time:60000});
- uploadFiles.reverse();
- for(var i = 0;i<uploadFiles.length;i++){
- var uploadOne = uploadFiles[i];
- $.ajaxFileUpload({
- url: "<?php echo $this->createUrl('third/uploadEnglishPaper');?>", //用于文件上传的服务器端请求地址
- secureuri: false, //是否需要安全协议,一般设置为false
- fileElementId: uploadOne, //文件上传域的ID
- dataType: 'text', //返回值类型 一般设置为json
- data:{"examGroupId":examGroupId,"uploadOne":uploadOne},
- success: function (data){
- console.log(data);
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- if(obj.answer_url != ''){
- //answerUrl.push(obj.answer_url);
- var idAnswer = obj.uploadOne.replace("paper_answer","");
- answerUrl[idAnswer] = obj.answer_url;
- }
- if(obj.paper_url != ''){
- //paperUrl.push(obj.paper_url);
- var idPaper = obj.uploadOne.replace("paper_exam","");
- paperUrl[idPaper] = obj.paper_url;
- }
- if(Object.keys(answerUrl).length + Object.keys(paperUrl).length == uploadFiles.length){
- jQuery.post(
- '<?php echo $this->createUrl('third/uploadEnglishPaperInsert');?>',
- {"examGroupId":examGroupId,"answerUrl":answerUrl,"paperUrl":paperUrl,"printTime":printTime},
- function(data1){
- var obj1 = JSON.parse(data1);
- console.log(obj1);
- if (obj1.success == 1) {
- layer.msg('上传成功');
- location.reload();
- return false;
- } else {
- layer.msg(obj1.message);
- location.reload();
- return false;
- }
- }
- );
- }
- } else {
- layer.msg(obj.message,{
- icon: 1,
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- },
- // error: function (data, status, e){ //服务器响应失败处理函数
- // layer.msg('返回失败!',{
- // icon: 1,
- // }, function(){
- // layer.closeAll();
- // location.reload();
- // });
- // }
- });
- }
- // console.log(answerUrl,paperUrl);
- //
- // answerUrl.push(1);
- // console.log(answerUrl.length);
- // return false;
- // MaskUtil.unmask();
- // location.reload();
- return false;
- }
- }
- // 生成试卷模板
- function createTemplateEnglish (eid,flag){
- if (!eid) {
- layer.msg('未找到考试信息');
- }
- var msg = '';
- if (flag == 12) {
- msg = '您确定要下载答题卡嘛?';
- } else if(flag == 11){
- msg = '您确定要下载试卷嘛?';
- }
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.post('<?php echo $this->createUrl('print/createtempelate');?>',{"eid":eid,"flag":flag},function(data){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- if(flag == 11){
- evaluationClient.CreateSubjectPaperTiGan(JSON.stringify(obj.object));
- }else if(flag == 12){
- evaluationClient.CreateSubjectWordTiKa(JSON.stringify(obj.object));
- }else{
- layer.msg("参数错误");
- }
- } else {
- layer.msg(obj.message);
- }
- });
- }
- });
- }
- //发送/取消/重新发送标注
- var flag = true;
- $(".sendLabelTask").bind("click", function () {
- var examId = jQuery(this).attr("examId");
- var examName = jQuery(this).attr("examName");
- var subjectId = jQuery(this).attr("subjectId");
- var createTime = jQuery(this).attr("createTime");
- var type = jQuery(this).attr("type");
- var status = jQuery(this).attr("status");
- var _this = jQuery(this);
- var isAnswerSheet=$(this).attr('isAnswerSheet');
- var productSwitch=<?php echo $productSwitch?>;
- var isTagging=$(this).attr('isTagging');
- if(productSwitch==3 && type!='cancel' && (subjectId==3 || subjectId==6 || subjectId==51) && isTagging!=1){
- sendLabelForSelectType(examId,examName,subjectId,createTime,type,status,_this);
- return false;
- }
- if (type=='cancel') {
- //取消标注
- layer.msg('本次考试不需要后台老师标注吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function (index) {
- _this.removeClass('sendlabeltask');
- _this.unbind();
- layer.close(index);
- if (flag){
- flag = false;
- jQuery.post(
- "<?php echo $this->createUrl("print/sendlabeltask");?>",
- {"examId": examId, "examName": examName, "createTime": createTime, 'type': type,'status':status,'isTagging':isTagging},
- function (data) {
- data = JSON.parse(data);
- if (data.success == 1) {
- layer.alert('取消成功', {'icon': 1,'closeBtn':0}, function () {
- location.reload();
- });
- }else if (data.success == 2){
- layer.alert(data.message, {'icon': 1,'closeBtn':0}, function () {
- location.reload();
- });
- }
- else {
- flag = true;
- layer.msg(data.message);
- }
- }
- );
- }
- }
- });
- }else{
- if(isAnswerSheet!=1){
- layer.msg('请先关联答题卡');
- return false;
- }
- str=$('#label_win');
- $('.label_remark').val('');
- layer.open({
- title:'发送标注',
- type: 1,
- skin: 'layui-layer-rim', //加上边框
- area: '450px',
- content: str,
- shade: 0.6, //不显示遮罩
- offset: 'auto',
- btn: ['确定','取消'],
- yes:function(){
- estimate=$('.estimate').val();
- remark=$('.label_remark').val();
- if(estimate==''){
- layer.msg('请选择期望完成时间');
- return false;
- }
- if(remark.length>100){
- layer.msg('备注内容不大于100个字符');
- return false;
- }
- if (flag){
- flag = false;
- indexSend=layer.msg('正在发送,请稍候......',{time:0});
- jQuery.post(
- "<?php echo $this->createUrl("print/sendlabeltask");?>",
- {"examId": examId, "examName": examName, "createTime": createTime,'type': type,'status':status,'isTagging':isTagging,remark:remark,estimate:estimate},
- function (data) {
- layer.close(indexSend);
- data = JSON.parse(data);
- if (data.success == 1) {
- layer.msg('发送成功');
- setTimeout(function () {
- location.reload();
- }, 2000);
- }else if (data.success == 2){
- layer.alert(data.message, {'icon': 1,'closeBtn':0}, function () {
- location.reload();
- });
- }
- else {
- flag = true;
- layer.msg(data.message);
- }
- }
- );
- }
- }
- });
- }
- });
- //选择发送发注类型
- function sendLabelForSelectType(examId,examName,subjectId,createTime,type,status,_this){
- var str = '<div id="hgc_editor" style="padding:20px 35px;">\
- <p>选择标注类型</p>\
- <span class="selectSendType selected">题库后台标注</span>\
- <span class="selectSendType">学校自主标注</span>\
- <input type="hidden" name="sendType" value="1">\
- </div>';
- layer.open({
- title:'选择标注类型'
- ,area:'740px'
- ,type: 1
- ,offset: 'auto'
- ,content: str
- ,btn: ['确定','取消']
- ,btnAlign: 'c' //按钮居中
- ,shade: 0.6 //不显示遮罩
- ,yes:function(){
- //确定回调
- var sendType=$('input[name=sendType]').val();
- if(sendType==undefined){
- layer.msg('请选择标注类型')
- }else if(sendType==1){
- var sub_id = $('input[name="subject_id"]').val();
- if (sub_id == 3 || sub_id == 6) {
- var str = '<div id="hgc_editor" style="padding:20px 35px;">\
- <p>请慎重填写该份试卷的备注(可不写)。例如,该年级头几次使用需重视,马上放假需要快速标记等。</p>\
- <textarea style="width:100%;height:200px;resize:vertical;" placeholder="请输入该份试卷的标注要求" class="label-remark"></textarea>\
- </div>';
- layer.open({
- title:'发送标注'
- ,area:'740px'
- ,type: 1
- ,offset: 'auto'
- ,content: str
- ,btn: ['确定','取消']
- ,btnAlign: 'c' //按钮居中
- ,shade: 0.6 //不显示遮罩
- ,yes:function(){
- //确定回调
- sendLabel(examId,examName,createTime,type,status);
- }
- });
- }else{
- sendLabel(examId,examName,createTime,type,status);
- }
- }else if(sendType==2){
- sendLabelToTeacher(examId,type,status)
- }
- }
- });
- }
- //发送标注到题库
- function sendLabel(examId,examName,createTime,type,status) {
- if (flag){
- flag = false;
- indexSend=layer.msg('正在发送,请稍候......',{time:0});
- jQuery.post(
- "<?php echo $this->createUrl("print/sendlabeltask");?>",
- {"examId": examId, "examName": examName, "createTime": createTime,'type': type,'status':status,remark:$(".label-remark").val()},
- function (data) {
- layer.close(indexSend);
- data = JSON.parse(data);
- if (data.success == 1) {
- layer.msg('发送成功');
- setTimeout(function () {
- location.reload();
- }, 2000);
- }else if (data.success == 2){
- layer.alert(data.message, {'icon': 1,'closeBtn':0}, function () {
- location.reload();
- });
- }
- else {
- flag = true;
- layer.msg(data.message);
- }
- }
- );
- }
- }
- //发送标注到教师端
- function sendLabelToTeacher(examId,type,status) {
- if (flag){
- flag = false;
- indexSend=layer.msg('正在发送,请稍候......',{time:0});
- jQuery.post(
- "<?php echo $this->createUrl("print/sendLabelToTeacher");?>",
- {"examId": examId,'type': type,'status':status},
- function (data) {
- layer.close(indexSend);
- data = JSON.parse(data);
- if (data.success == 1) {
- layer.msg('发送成功');
- setTimeout(function () {
- location.reload();
- }, 2000);
- }else if (data.success == 2){
- layer.alert(data.message, {'icon': 1,'closeBtn':0}, function () {
- location.reload();
- });
- }
- else {
- flag = true;
- layer.msg(data.message);
- }
- }
- );
- }
- }
- //扫描在线答题卡
- function createTemplateScanOnline(exam_group_id,obj,exam_name,import_type){
- if (!exam_group_id) {
- layer.msg('未找到试卷ID');
- }
- if($(obj).hasClass('disabled')){
- return false;
- }
- var data={
- exam_group_id:exam_group_id
- }
- $.post("<?php echo Yii::app()->createUrl("print/getOnlineCard")?>",data,function(rs){
- var m = JSON.parse(rs);
- if(m.status==1)
- {
- $(obj).addClass('disabled');
- if(import_type>0){
- evaluationClient.ImportOnLineAnswerCard_M_Subject(exam_group_id+","+exam_name+","+<?php echo Yii::app()->session['session_duoxueke_subject_id']?>);
- }else{
- evaluationClient.OnLineAnswerCard_M_Subject(exam_group_id+","+exam_name+","+<?php echo Yii::app()->session['session_duoxueke_subject_id']?>);
- }
- }else {
- layer.msg('尚未创建在线答题卡,请创建');
- }
- });
- }
- //选择上传试卷类型
- function uploadTemplateForSelectType(eid,name,grade){
- forCheckUrl = "<?php echo $this->createUrl('third/checkanswercard');?>";
- $.post(forCheckUrl,{eid:eid},function(data){
- var obj = JSON.parse(data);
- var subject_id = '<?php echo Yii::app()->session['session_duoxueke_subject_id']?>';
- if(subject_id==12) {
- $('#parse_area').find('.select_upload_mode').eq(0).closest('span').show();
- $('#parse_area').find('.select_upload_mode').eq(1).closest('span').hide();
- $('#parse_area').find('.select_upload_mode').eq(2).closest('span').hide();
- $('#parse_area').find('.select_upload_mode').eq(0).click();
- $('#parse_area').find('.p_txt_1').show();
- $('#parse_area').find('.p_txt_2').hide();
- }else if(subject_id==8){
- $('#parse_area').find('.select_upload_mode').eq(0).closest('span').hide();
- $('#parse_area').find('.select_upload_mode').eq(1).closest('span').show();
- $('#parse_area').find('.select_upload_mode').eq(2).closest('span').hide();
- $('#parse_area').find('.select_upload_mode').eq(1).click();
- $('#parse_area').find('.p_txt_1').hide();
- $('#parse_area').find('.p_txt_2').show();
- }else{
- $('#parse_area').find('.select_upload_mode').eq(0).closest('span').show();
- // if(obj.math_ai==1){
- // $('#parse_area').find('.select_upload_mode').eq(1).closest('span').show();
- // }else{
- // $('#parse_area').find('.select_upload_mode').eq(1).closest('span').hide();
- // }
- $('#parse_area').find('.select_upload_mode').eq(1).closest('span').hide();
- $('#parse_area').find('.select_upload_mode').eq(2).closest('span').show();
- $('#parse_area').find('.select_upload_mode').eq(2).attr('eid',eid);
- $('#parse_area').find('.select_upload_mode').eq(2).attr('grade',grade);
- $('#parse_area').find('.select_upload_mode').eq(0).click();
- $('#parse_area').find('.p_txt_1').show();
- $('#parse_area').find('.p_txt_2').hide();
- }
- $('input[name=upload_template_eid]').val(eid);
- if(obj.success==1)
- {
- if(obj.data=='ai' || subject_id==8){
- $('#parse_area').find('.select_upload_mode').eq(1).attr('disabled',false);
- }else{
- $('#parse_area').find('.select_upload_mode').eq(1).attr('disabled',true);
- }
- var str=$('#parse_area');
- layer.open({
- title:'上传试卷',
- type: 1,
- skin: 'layui-layer-rim', //加上边框
- area: '750px',
- content: str,
- shade: 0.6, //不显示遮罩
- offset: 'auto',
- btn: ['确定','取消'],
- yes:function(){
- console.log('1');
- //newUploadWord();
- var uploadType=$('input[name=upload_template_type]').val();
- if(subject_id==12 || subject_id==8 || uploadType==1){
- newUploadWord();
- }else{
- uploadWord();
- }
- }
- });
- }else{
- layer.msg(obj.message,{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- //layer.msg(obj.message);
- }
- })
- }
-
- //清空答题卡数据
- function clearAnswerCardData(examGroupId,type){
- var data={
- examGroupId:examGroupId,
- type:type
- }
- $.post("<?php echo Yii::app()->createUrl("print/clearAnswerCard")?>",data,function(rs){
- var m = JSON.parse(rs);
- if(m.status==1)
- {
- $(obj).addClass('disabled');
- evaluationClient.OnLineAnswerCard_M_Subject(exam_group_id+","+exam_name+","+<?php echo Yii::app()->session['session_duoxueke_subject_id']?>);
- }else {
- layer.msg('尚未创建在线答题卡,请创建');
- }
- });
- }
- $('body')
- .on('click','#paper_file_button',function(){
- $('#paper_file').click();
- $('input[name=upload_template_type]').val(1);
- $('.word_file_path').html('');
- $('.word_file').val('');
- })
- .on('click','#parse_file_button',function(){
- $('#parse_file').click();
- $('input[name=upload_template_type]').val(1);
- $('.word_file_path').html('');
- $('.word_file').val('');
- })
- .on('click','#word_file_button',function(){
- $('#word_file').click();
- $('input[name=upload_template_type]').val(2);
- $('.paper_file_path').html('');
- $('.paper_file').val('');
- $('.parse_file_path').html('');
- $('.parse_file').val('');
- })
- .on('change','#paper_file',function(){
- $('.paper_file_path').html($(this).val())
- })
- .on('change','#parse_file',function(){
- $('.parse_file_path').html($(this).val())
- })
- .on('change','#word_file',function(){
- $('.word_file_path').html($(this).val())
- })
- function newUploadWord() {
- var paramEid = $('input[name=upload_template_eid]').val();
- var uploadType=$('input[name=upload_template_type]').val();
- if (!paramEid) {
- layer.msg('没找到考试ID!');
- return false;
- }
- if(uploadType==2){
- var obj_file = $("#word_file").val();
- if (!obj_file) {
- layer.msg('请选择上传文件1');
- return false;
- }
- var extStart = obj_file.lastIndexOf('.');
- var extName = obj_file.substring(extStart,obj_file.length).toLowerCase();
- if (extName != ".docx" && extName != ".dotx" && extName != ".dotm") {
- layer.msg('模板格式有误,请上传dotx格式word!');
- return false;
- }
- fileElementId='word_file';
- }else{
- var paper_file = $("#paper_file").val();
- var parse_file = $("#parse_file").val();
- if (!paper_file) {
- layer.msg('请选择上传文件');
- return false;
- }
- fileElementId=['paper_file','parse_file'];
- var extStart = paper_file.lastIndexOf('.');
- var extName = paper_file.substring(extStart,paper_file.length).toLowerCase();
- if (extName != ".docx" && extName != ".dotx" && extName != ".dotm" && extName != ".pdf") {
- layer.msg('模板格式有误,请上传PDF、WORD!');
- return false;
- }
- if(parse_file){
- var extStart = parse_file.lastIndexOf('.');
- var extName = parse_file.substring(extStart,parse_file.length).toLowerCase();
- if (extName != ".docx" && extName != ".dotx" && extName != ".dotm" && extName != ".pdf" ) {
- layer.msg('模板格式有误,请上传PDF、WORD!');
- return false;
- }
- }
- }
- $.ajaxFileUpload({
- url: "<?php echo $this->createUrl('third/newUploadTpl');?>", //用于文件上传的服务器端请求地址
- secureuri: false, //是否需要安全协议,一般设置为false
- fileElementId: fileElementId, //文件上传域的ID
- dataType: 'text', //返回值类型 一般设置为json
- data:{"eid":paramEid,'uploadType':uploadType},
- success: function (data, status){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- layer.msg(obj.message,{
- icon: 1,
- }, function(){
- layer.closeAll();
- location.reload();
- });
- $("#alreadUpload").html('<span style="color:red;">已上传</span>');
- } else {
- layer.msg(obj.message,{
- icon: 2,
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 1,
- }, function(){
- // layer.closeAll();
- // location.reload();
- });
- }
- });
- return false;
- }
- //上传试卷切换
- $('.select_upload_mode').click(function(){
- //console.log($(this).val());
- var checkValue=$(this).val();
- $('.copy_exam_list').hide();
- $('.pa_list').show();
- if(checkValue==1){
- $('.upload_btn_1').show();
- $('.upload_btn_2').hide();
- $('input[name=upload_template_type]').val(2);
- }else if(checkValue==2){
- $('.upload_btn_1').hide();
- $('.upload_btn_2').show();
- $('input[name=upload_template_type]').val(1);
- }else if(checkValue==3){
- //复用试卷
- eid=$(this).attr('eid');
- grade=$(this).attr('grade');
- selectExam(grade,eid);
- $('.copy_exam_list').show();
- $('.pa_list').hide();
- }
- });
- $('.datetimepicker8').datetimepicker({
- onGenerate:function( ct ){
- $(this).find('.xdsoft_date')
- .toggleClass('xdsoft_disabled');
- $(this).find(".xdsoft_today").removeClass('xdsoft_disabled');
- },
- format:'Y-m-d H:i',
- formatDate:'Y-m-d H:i',
- formatTime:'H:i',
- // minDate:'-1970/01/2',
- minDate: '-2022-08-10 00:00',
- maxDate:'+1970/01/2',
- timepicker:true,
- step:10,
- });
- $('.exam_export').click(function(){
- eid=$(this).attr('eid');
- data={examGroupId:eid}
- $.post("<?php echo Yii::app()->createUrl('print/exportExamData')?>",data,function(flags){
- var m = JSON.parse(flags);
- if(m.status==1)
- {
- var html = ""+
- '<div style="padding:20px 30px 0px 30px">'+
- '<div style="padding:8px 0;">请复制下方链接打印包。</div>'+
- '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
- '<div class="row" style="margin:30px auto 0px auto;text-align:center"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;background:gray;border-color:gray;">关闭</button>'+
- '</div>'+
- '</div>'+
- "";
- //
- layer.open({
- type: 1,
- area: ['550px', '220px'],
- title: '下载',
- content: html,
- success: function(index, layerObj){
- $(".loading-pop").hide();
- jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+m.data+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
- jQuery("#confirm, #cancel").on("click", function(){
- layer.close(layerObj);
- });
- jQuery("#copy").on("click", function(){
- jQuery("#url").select();
- });
- },
- end: function(){
- }
- });
- return;
- }else if(m.status==2) {
- layer.msg('数据正在生成中,请稍侯点击导出下载');
- }else{
- layer.msg(m.result);
- }
- });
- });
- $('.show_wrong_reason').click(function(){
- txt=$(this).attr('txt');
- layer.msg(txt);
- });
- $('.change-tpl-close').click(function(){
- $('#fieldModalTopic').hide();
- });
- $('.tpl_change').click(function(){
- exam_group_id=$('input[name=tpl_exam_group_id]').val();
- qxk=$('input[name=tpl_qxk]').val();
- subjectid='<?php echo Yii::app()->session['session_duoxueke_subject_id']?>';
- if(qxk=='1'){
- if(subjectid==3 || subjectid==6 || subjectid==51){
- evaluationClient.CreateWholeDisciplineAnswerSheetShuxueNew(0+","+exam_group_id);
- }else{
- evaluationClient.CreateWholeDisciplineAnswerSheetShuxueNew(0+","+exam_group_id+","+subjectid);
- }
- }else{
- $.post("<?php echo Yii::app()->createUrl("third/checkSelectTopicGroup")?>",{exam_group_id:exam_group_id},function(rs){
- var m = JSON.parse(rs);
- if(m.status==1)
- {
- layer.msg('本场考试选做题含有小题,暂不支持切换切割模板!');
- return false;
- }else {
- if(qxk=='1'){
- if(subjectid==3 || subjectid==6 || subjectid==51){
- evaluationClient.CreateWholeDisciplineAnswerSheetShuxueNew(0+","+exam_group_id);
- }else{
- evaluationClient.CreateWholeDisciplineAnswerSheetShuxueNew(0+","+exam_group_id+","+subjectid);
- }
- }else{
- if(subjectid==3 || subjectid==6 || subjectid==51){
- evaluationClient.CreateWholeDisciplineAnswerSheetShuxue(0+","+exam_group_id);
- }else{
- evaluationClient.CreateWholeDisciplineAnswerSheetShuxue(0+","+exam_group_id+","+subjectid);
- }
- }
- }
- });
- }
- });
- $('.tpl_new').click(function(){
- exam_group_id=$('input[name=tpl_exam_group_id]').val();
- qxk=$('input[name=tpl_qxk]').val();
- feedback=$(this).attr('feedback');
- if(feedback==1){
- layer.msg('本场考试不满足重新制作条件!');
- return false;
- }
- subjectid=<?php echo Yii::app()->session['session_duoxueke_subject_id']?>;
- //清空数据
- var data={
- examGroupId:exam_group_id,
- type:1
- }
- layer.msg('正在处理,请稍候。。。。。。');
- $.post("<?php echo Yii::app()->createUrl("third/clearAnswerCard")?>",data,function(rs){
- var m = JSON.parse(rs);
- if(m.status==1)
- {
- layer.closeAll();
- if(qxk=='1'){
- if(subjectid==3 || subjectid==6 || subjectid==51){
- evaluationClient.createAnswerSheetNewQuestion(0+","+exam_group_id);
- }else{
- evaluationClient.createAnswerSheetNewQuestion(0+","+exam_group_id+","+subjectid);
- }
- }else{
- if(subjectid==3 || subjectid==6 || subjectid==51){
- evaluationClient.createAnswerSheet(0+","+exam_group_id);
- }else{
- evaluationClient.createAnswerSheet(0+","+exam_group_id+","+subjectid);
- }
- }
- }else {
- layer.msg('本场考试不满足重新制作条件!');
- return false;
- }
- });
- });
- <?php
- if(YII_ENV=='production'){
- echo 'cardurl="http://zcard.zhixinhuixue.com/";';
- echo 'appId="946004280126791680";';
- }else{
- echo 'cardurl="http://pandora-card.testing.xueping.com/";';
- echo 'appId="939792767984566272";';
- }
- ?>
- $('.card-tools').click(function(){
- eid=$(this).attr('eid');
- $.post("/index.php/third/createSign",{eid:eid},function(rs){
- var m = JSON.parse(rs);
- if(m.status==1)
- {
- url=cardurl+"get_access_token.html?appId="+appId+"&sign="+m.sign+"×tamp="+m.time+"&certificate="+m.certificate;
- // url=cardurl+"get_access_token.html?appId=946004280126791680&sign="+m.sign+"×tamp="+m.time+"&certificate="+m.certificate;
- window.location.href=url
- }
- });
- });
- </script>
|