12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366 |
- <style>
- /*切换选择*/
- .tab-con{
- position: relative;
- height: 30px;
- width: 200px;
- background: #F2F2F2;
- border: 1px solid #01B677;
- border-radius: 15px;
- }
- .sel-opt{
- width: 50%;
- position: relative;
- color: #01B677;
- line-height: 30px;
- text-indent: 6px;
- cursor: pointer;
- }
- .sel-opt:after{
- content: '';
- border-left: 6px solid transparent;
- border-right: 6px solid transparent;
- border-top: 8px solid #01B677;
- position: absolute;
- right: 12px;
- top: 12px;
- }
- .xdsoft_datetimepicker{
- z-index:99999999!important;
- }
- // .sel-opt select{
- // width: 100%;
- // height: 30px;
- // background: #F2F2F2;
- // color: #01B677;
- // text-indent: 6px;
- // font-size: inherit;
- // border-top-right-radius: 15px;
- // border-bottom-right-radius: 15px;
- // cursor: pointer;
- // }
- // .sel-opt select option{
- // position: relative;
- // }
- .points{
- position: absolute;
- top: -2px;
- right: 0;
- width: 10px;
- height: 10px;
- background: #F01516;
- border-radius: 50%;
- }
- .sel-cons{
- border: 1px solid #01B677;
- width: 50%;
- position: absolute;
- right: 0;
- top: 30px;
- text-indent: 10px;
- display: none;
- }
- .sc-lis{
- line-height: 30px;
- cursor: pointer;
- }
- .sc-lis span{
- position: relative;
- }
- .sc-lis .points{
- top: 2px;
- right: -16px;
- }
- .click-sc:focus {
- color: #fff;
- }
- .click-sc:hover {
- color: #fff;
- }
- .create-third{
- position: absolute;
- right: 6px;
- top: 10px;
- }
- .tab-con-btn{
- height: 31px;
- width: 210px;
- background: #F2F2F2;
- border: 1px solid #01B677;
- border-radius: 15px;
- display: inline-block;
- text-align: center;
- }
- .tab_btn{
- display: inline-block;
- width:100px;
- padding: 0;
- border: 0;
- outline:none;
- margin:0;
- background: #F2F2F2;
- border-radius: inherit;
- }
- .has-sel{
- background: #01B677;
- color: #fff;
- width: 50%;
- height: 30px;
- border-top-left-radius: 15px;
- border-bottom-left-radius: 15px;
- text-align: center;
- line-height: 30px;
- }
- .has-sel-1{
- background: #01B677;
- color: #fff;
- width: 50%;
- height: 30px;
- border-top-right-radius: 15px;
- border-bottom-right-radius: 15px;
- text-align: center;
- line-height: 30px;
- }
- .layer-upload{padding:10px 20px; display:none;}
- .layer-upload p{line-height:20px;color:#aaa;}
- .upload-btn{color:#76c289}
- .layer-upload ul{padding:10px;line-height:30px; border:1px solid #ccc;}
- .layer-upload li{border-bottom:1px solid #ccc;}
- .layer-upload li span{width:40%;}
- .layer-upload li em{width:20%;font-size:26px;text-align:center;cursor:pointer}
- .tooltip {
- position: absolute;
- display: none;
- z-index: 9900000;
- outline: none;
- padding: 5px;
- border-width: 1px;
- border-style: solid;
- border-radius: 5px;
- -moz-border-radius: 5px 5px 5px 5px;
- -webkit-border-radius: 5px 5px 5px 5px;
- border-radius: 5px 5px 5px 5px;
- }
- .table-hover>tbody>tr:hover {
- background-color: #E6F1EC
- }
- .selectSendType{width:180px;height:100px;border:1px solid #ccc;display: inline-block;text-align: center;line-height: 100px;cursor:pointer;border-radius:5px;}
- .selected{background:#aaa; }
- </style>
- <script src="/js/jquery.datetimepicker.js"></script>
- <link rel="stylesheet" href="/css/jquery.datetimepicker.css" />
- <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
- <link rel="stylesheet" href="/css/alert.css"/>
- <link rel="stylesheet" href="/fonts/shangchuan/iconfont.css" />
- <script language="javascript" src="<?php echo Yii::app()->params['static_url_js']; ?>/js/MaskUtil.js?<?php echo Yii::app()->params['static_version']; ?>"></script>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="page-content">
- <div class="row" style="margin:0px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
- <div class="row">
- <form method="get" id="form1" action="<?php echo $this->createUrl("third/index");?>">
- <div class="col-xs-12">
- <div class="dataTables_length margin-zy">
- <div class="tab-con-btn">
- <?php
- if(isset($list_type) && $list_type==1):
- ?>
- <button class="tab_btn " >阅卷试卷</button>
- <button class="tab_btn has-sel-1" >导入成绩试卷</button>
- <?php
- else:
- ?>
- <button class="tab_btn has-sel" >阅卷试卷</button>
- <button class="tab_btn " >导入成绩试卷</button>
- <?php
- endif;
- ?>
- </div>
- <input type="hidden" name="list_type" value="<?php if(isset($list_type)){echo $list_type;}else{echo 0;}?>" />
- <input type="hidden" name="type" value="<?php echo $printType;?>" />
- <input type="checkbox" name="display" style="margin: -1px 2px 0 0;display:inline-block;vertical-align: middle;width:15px;height:15px;" value="1" <?php if($display === '1') echo "checked";?>>显示隐藏试卷
- <?php if(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(41,42)))
- {
- ?>
- <select class="form-control" id="labelled" name="labelled">
- <option value="">标注状态</option>
- <option value="0" <?php if($labelled === '0') echo "selected";?> >未发送</option>
- <option value="2" <?php if($labelled == 2) echo "selected";?> >已发送</option>
- <option value="1" <?php if($labelled == 1) echo "selected";?>>已标注</option>
- <option value="3" <?php if($labelled === 3) echo "selected";?> >标注中</option>
- <option value="4" <?php if($labelled == 4) echo "selected";?> >已取消</option>
- <option value="5" <?php if($labelled == 5) echo "selected";?>>补题中</option>
- </select>
- <?php } ?>
- <input type="text" class="form-control input-sm" placeholder="请输入打印任务名称" name="name" value="<?php echo $printName;?>">
- <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
- </div>
- </div>
- </form>
- <button class="label-primary-s bth-s create-third" data-button="red">创建试卷</button>
- </div>
- <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
- <thead>
- <tr>
- <th>名称</th>
- <th>创建日期</th>
- <th>考试日期</th>
- <th>是否创建答题卡</th>
- <th>选择题量</th>
- <th>填空题量</th>
- <th>解答题量</th>
- <th>选做题量</th>
- <th>阅卷方式</th>
- <th>主阅老师</th>
- <?php if(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(41))): ?>
- <th >状态</th>
- <?php endif;?>
- <th >操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($printList)):foreach($printList as $cl):?>
- <tr>
- <td style="max-width:260px">
- <?php
- if($cl['is_new']==0)
- {
- echo "<span style='color: #ff0000;font-weight: bold;'>【New】</span>";
- }
- if($cl['homework']==1)
- {
- echo "<span style='color: #fff;font-weight: bold;display:inline-block;background: #337ab7;padding:0 5px;'> 作业 </span>";
- }
- ?>
- <a href="<?php echo Yii::app()->createUrl('paper/index',array('eid'=>$cl['exam_id'],'is_third'=>1))?>"><?php echo $cl['exam_name'];?></a>
- </td>
- <td><?php if(!empty($cl['create_time'])){ echo date('Y-m-d',$cl['create_time']);}?></td>
- <td><?php if(!empty($cl['examDate'])){ echo date('Y-m-d',$cl['examDate']);}?></td>
- <td>
- <?php
- if(isset($exam_sheets[$cl['exam_group_id']]) ){
- echo '已创建';
- if($exam_sheets[$cl['exam_group_id']]==1){
- echo '(在线答题卡)';
- }
- }else{
- echo "未创建";
- }
- ?>
- </td>
- <td><?php if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
- echo $sheet_rs[$cl['exam_group_id']]->ke_topic_num;
- }else{echo 0;}?></td>
- <td><?php if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
- echo $sheet_rs[$cl['exam_group_id']]->tian_topic_num;
- }else{echo 0;}?></td>
- <td><?php if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
- echo $sheet_rs[$cl['exam_group_id']]->zu_topic_num;
- }else{echo 0;}?></td>
- <td><?php if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
- echo $sheet_rs[$cl['exam_group_id']]->xuan_topic_num;
- }else{echo 0;}?></td>
- <td>
- <?php
- $txt='';
- if($cl['import_score_type']>0){
- $txt='导入成绩';
- }elseif ($cl['mark_type'] == 0) {
- $txt='线下阅卷';
- }elseif($cl['mark_type'] == 4){
- $txt='班级单独阅卷';
- }elseif($cl['mark_type']==3){
- $txt='混合阅卷';
- }
- if ($cl['upload_status'] > 0 || $cl['homework']==1 || $cl['import_score_type']) {
- echo $txt;
- }else{
- echo '<a href="javascript::void()" class="maskType" is_show="' . $cl['upload_status'] . '" examId="' . $cl["exam_group_id"] . '" tpl_index="' . $cl["tpl_index"] . '" mark_type="' . $cl["mark_type"] . '" >'.$txt.'</a>';
- }
- ?>
- </td>
- <td><?php if($teachers && isset($teachers[$cl['teacher_id']])){ echo $teachers[$cl['teacher_id']];}else{echo "";}?></td>
- <?php if(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(41)))
- {
- ?>
- <td>
- <?php if($cl['is_answersheet']==1){
- if($cl["is_labelled"] == 1){
- echo "<span style='color:green;font-weight:normal;'>已标注</span>";
- }else if($cl["is_labelled"] == 2 ){
- echo "<span style='color:orange;font-weight:normal;'>已发送</span>";
- }else if($cl["is_labelled"] == 3 ){
- echo "<span style='color:orange;font-weight:normal;'>标注中</span>";
- }else if($cl["is_labelled"] == 4 ){
- echo "<span style='color:orange;font-weight:normal;'>已取消</span>";
- }else if($cl["is_labelled"] == 5){
- echo "<span style='color:orange;font-weight:normal;'>补题中</span>";
- }
- if($cl["is_labelled"] == 0 && $cl['tw_status']==2){?>
- <span class="iconfont click-sc addbx sendLabelTask" isAnswerSheet="1" type="send" examId="<?php echo $cl["exam_id"];?>" examName="<?php echo $cl["exam_name"];?>" subjectId="<?php echo $cl["subject_id"];?>" createTime="<?php echo $cl["examDate"];?>" aria-hidden="true" title="发送试题标注"></span>
- <?php }elseif($cl['is_labelled']==4){?>
- <span class="iconfont click-sc addbx sendLabelTask"
- examId="<?php echo $cl["exam_id"];?>"
- examName="<?php echo $cl["exam_name"];?>"
- subjectId="<?php echo $cl["subject_id"];?>"
- createTime="<?php echo $cl["create_time"];?>"
- status = '2'
- <?php
- if (isset($exam_sheets[$cl['exam_group_id']]) ) {
- echo ' isAnswerSheet=1 ';
- }else{
- echo ' isAnswerSheet=0 ';
- }
- ?>
- type="resend"
- aria-hidden="true" title="重新发送"></span>
- <?php }elseif($cl['is_labelled']==2 || $cl['is_labelled']==3){
- ?>
- <span class="iconfont click-sc addbx sendLabelTask" isAnswerSheet="1" status="4" type="cancel" examId="<?php echo $cl["exam_id"];?>" examName="<?php echo $cl["exam_name"];?>" subjectId="<?php echo $cl["subject_id"];?>" createTime="<?php echo $cl["examDate"];?>" aria-hidden="true" title="取消试题标注"><i class="fa fa-reply"></i></span>
- <?php
- }
- }else{
- if($cl['tw_status']==2){
- echo "<span style='color:orange;font-weight:normal;'>解析成功</span>";
- }elseif($cl['tw_status']==3){
- ?>
- <a style='color:orange;font-weight:normal;cursor:pointer' title="<?php echo $cl['wrong_reason'] ?>">解析失败</a>
- <?php
- }elseif($cl['word_path']){
- echo "<span style='color:orange;font-weight:normal;'>等待解析</span>";
- }else{
- echo "<span style='color:orange;font-weight:normal;'>未上传</span>";
- }
- }?>
- </td>
- <?php }else{
- // $examStatus = array(0=>'未上传',1=>'答案未上传',3=>'题目未上传',4=>'已上传');
- // if(isset($examStatus[$cl['uploadExamStatus']])){
- // $_status = $cl['uploadExamStatus'];
- // if($_status == 4){
- // echo '<td>'.$examStatus[$cl['uploadExamStatus']].'</td>';
- // }else{
- // echo '<td style="color:red">'.$examStatus[$cl['uploadExamStatus']].'</td>';
- // }
- // }else{
- // echo '<td></td>';
- // }
- } ?>
- <td style="width:300px;">
- <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生" onclick="javascript:location.href='<?php echo $this->createUrl('third/exam_list',array('exam_group_id'=>$cl['exam_group_id'],'branch'=>$cl['branch'],'grade'=>$class_grade[$cl['class_id']],'upload_status'=>$cl['upload_status']));?>'"></span>
- <?php if($cl['homework']==0):?>
- <a class="iconfont click-sc addbx create_sheet_subject" aria-hidden="true" tw_status="<?php echo $cl['tw_status']?>" labelled="<?php echo $cl['is_labelled']?>" title="<?php if(isset($exam_sheets[$cl['exam_group_id']]) && !empty($exam_sheets[$cl['exam_group_id']])){ echo '修改关联答题卡';}else{echo "关联答题卡";}?>" mark_type="<?php echo $cl['mark_type'];?>" exam_group_id="<?php echo $cl['exam_group_id']?>" sheet_id ="<?php if(isset($exam_sheets[$cl['exam_group_id']]) && !empty($exam_sheets[$cl['exam_group_id']])){ echo $exam_sheets[$cl['exam_group_id']];}else{echo 0;}?>"></a>
- <?php if(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(41))): ?>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="上传试卷" onclick="uploadTemplate('<?php echo $cl['exam_group_id'];?>','<?php echo $cl['exam_name'];?>')"></span>
- <?php elseif($exportExam):?>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="上传试卷题目" onclick="uploadExamTopic('<?php echo $cl['exam_group_id'];?>',<?php echo Yii::app()->session['session_duoxueke_subject_id']?>,<?php if(isset($cl['uploadExamTemplateId'])){ echo $cl['uploadExamTemplateId']; }else{ echo 0;}?>,<?php echo $cl['tpl_index'];?>)"></span>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="上传试卷答案" onclick="uploadExamAnswer('<?php echo $cl['exam_group_id'];?>',<?php echo Yii::app()->session['session_duoxueke_subject_id']?>,<?php if(isset($cl['uploadAnswerTemplateId'])){ echo $cl['uploadAnswerTemplateId']; }else{ echo 0;}?>)">答</span>
- <?php endif;?>
- <?php if( $cl['is_scan_changed'] != 1 && $cl['homework']==0 && isset($exam_sheets[$cl['exam_group_id']])):?>
- <?php if($exam_sheets[$cl['exam_group_id']]==1):?>
- <span class="iconfont" aria-hidden="true" title="扫描在线答题卡" onclick="createTemplateScanOnline('<?php echo $cl['exam_group_id'];?>',this,'<?php echo $cl['exam_name']; ?>',<?php echo $cl['import_score_type'];?>)"><img src="/images/online_scan.svg"></span>
- <?php else:?>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="扫描答题卡" onclick="createTemplateSubject('<?php echo $cl['exam_group_id'];?>',<?php echo Yii::app()->session['session_duoxueke_subject_id']?>,<?php echo $cl['import_score_type'];?>)">扫</span>
- <?php endif;?>
- <?php endif;?>
- <?php if($cl['is_display'] == 1):?>
- <span class="iconfont click-sc click-tc addbx" aria-hidden="true" title="恢复试卷" onclick="oprateExam('<?php echo $cl['exam_group_id'];?>',0)"></span>
- <?php else:?>
- <span class="iconfont click-sc click-delete addbx" aria-hidden="true" title="隐藏试卷" onclick="oprateExam('<?php echo $cl['exam_group_id'];?>',1)"></span>
- <?php endif;?>
- <a href="<?php echo $this->createUrl("third/modifyThirdExam",array('exam_group_id'=>$cl['exam_group_id']));?>" class="iconfont click-sc addbx" aria-hidden="true" title="编辑考试信息" >编</a>
- <?php endif;?>
- <?php if($exportExam && $cl['is_feedback']==1):?>
- <span class="iconfont click-sc addbx exam_export" eid="<?php echo $cl['exam_group_id'] ?>" aria-hidden="true" title="导出考试数据" >导出</span>
- <?php endif;?>
- </td>
- </tr>
- <?php endforeach;else:?>
- <tr><td colspan="10">暂无数据!</td></tr>
- <?php endif;?>
- </tbody>
- </table>
- <?php if(!empty($page_total)):?>
- <div class="row">
- <div class="col-xs-6">
-
- </div>
- <div class="col-xs-6">
- <div class="dataTables_paginate paging_simple_numbers">
- <?php
- $this->widget('CLinkPager', array(
- 'header' => '',
- 'firstPageLabel'=> '首页',
- 'lastPageLabel' => '末页',
- 'prevPageLabel' => '上一页',
- 'nextPageLabel' => '下一页',
- 'pages' => $pages,
- 'maxButtonCount'=> 5,
- ));
- echo '共:'.$page_total.'条';
- ?>
- </div>
- </div>
- </div>
- <?php endif;?>
- </div>
- <!--上传模板弹窗-->
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <!-- 复用考试列表弹窗 -->
- <div class="confirmbox-mask" style="display:none ;" id="fieldModalStudent">
- <div class="class-modal" style="padding: 0;height:580px;width:800px;">
- <div class="class-modal-head" style="background-color: #2977ff;color: white;height: 30px;font-size: 16px;font-weight: initial;"><span style="float: left;padding: 5px;">复用试卷</span><span class="student-list-close" style="float: right;padding: 5px;cursor: pointer;">X</span></div>
- <form id="examSelect">
- <div class="" style="height:520px;padding:10px;">
- <div class="class_area" id="class_area">
- <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer student-list" style="font-size:12px">
- <thead>
- <tr>
- <th>名称</th>
- <th>创建时期</th>
- <th>考试日期</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <tr><td colspan="8">暂无数据</td></tr>
- </tbody>
- </table>
- <div class="row">
- <div class="col-xs-6">
- <div class="dataTables_paginate paging_simple_numbers student_list_page">
- </div>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- <script src="/js/jquery.ajaxfileupload.js"></script>
- <script type="text/javascript">
- $(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");
- 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==1)
- {
- layer.msg('已上传成绩,无法修改!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==4)
- {
- layer.msg('您当前已发送答题卡后台协助任务,为避免您产生与后台重复的操作,以造成数据混乱,已禁止您操作。请等待后台处理结果。\n' +
- '\n' +
- '\n' +
- '\n' +
- '您也可在后台协助详情页中撤回任务,自行操作!',{
- icon:5,time:5000
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==2)
- {
- layer.msg('非法考试!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==5)
- {
- msg="";
- if((tw_status==2 || tw_status==1) && labelled==0){
- msg="当前考试存在在线答题卡数据,如果继续使用并保存【制作模板】,则会清空在线答题卡;<br>当前考试已发送解析,修改答题卡需要重新上传解析,请确认!";
- }else{
- msg="当前考试存在在线答题卡数据,如果继续使用并保存【制作模板】,则会清空在线答题卡,请确认!";
- }
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- evaluationClient.createAnswerSheet(0+","+exam_group_id);
- }
- });
- }
- if(m.status==0)
- {
- msg="当前考试已发送解析,修改答题卡需要重新上传解析,请确认!";
- if((tw_status==2 || tw_status==1) && labelled==0){
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id);
- }
- });
- }else{
- evaluationClient.createAnswerSheet(sheet_id+","+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");
- 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==1)
- {
- layer.msg('已上传成绩,无法修改!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- */
- if(m.status==4)
- {
- layer.msg('您当前已发送答题卡后台协助任务,为避免您产生与后台重复的操作,以造成数据混乱,已禁止您操作。请等待后台处理结果。\n' +
- '\n' +
- '\n' +
- '\n' +
- '您也可在后台协助详情页中撤回任务,自行操作!',{
- icon:5,time:5000
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==2)
- {
- layer.msg('非法考试!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==5)
- {
- msg="";
- if((tw_status==2 || tw_status==1) && labelled==0){
- msg="当前考试存在在线答题卡数据,如果继续使用并保存【制作模板】,则会清空在线答题卡;<br>当前考试已发送解析,修改答题卡需要重新上传解析,请确认!";
- }else{
- msg="当前考试存在在线答题卡数据,如果继续使用并保存【制作模板】,则会清空在线答题卡,请确认!";
- }
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- evaluationClient.createAnswerSheet(0+","+exam_group_id+",<?php echo Yii::app()->session['session_duoxueke_subject_id']?>");
- }
- });
- }
- if(m.status==0 || m.status==1)
- {
- if((tw_status==2 || tw_status==1) && labelled==0){
- layer.msg('当前考试已发送解析,修改答题卡需要重新上传解析,请确认!', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- evaluationClient.createAnswerSheet(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']?>");
- }
- }
- });
- }
- });
- 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 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();
- 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);
- layer.msg(data.message);
- if (data.success == 1) {
- setTimeout(function () {
- location.reload();
- }, 1300);
- }
- }
- );
- layer.closeAll();
- });
- },
- end: function () {
- }
- });
- });
- //打印
- $(".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 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))){
- echo "href='".$this->createUrl("third/thirdview")."';";
- }else{
- echo "href='".$this->createUrl("third/thirdview_duo")."';";
- }
- }
- ?>
- 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>';
- }else if(subject_id==41){
- // html += '<div><a style="color:#0e8e54" href="/assets/data/math_exam.doc">下载试卷模板</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 == 41 ) {
- 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 = $('#mpEGid').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){
- 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)
- {
- 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
- }
- $.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+','+subject);
- }else{
- 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'] //还可配置颜色
- });
- });
- $('.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: '-<?php echo date('Y-m-d H:i', strtotime('Yesterday')); ?>',
- maxDate:'+1970/01/2',
- timepicker:true,
- step:10,
- });
- 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?>;
- if(productSwitch==3 && type!='cancel' && (subjectId==3 || subjectId==6 || subjectId==51)){
- 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},
- 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;
- }
- 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},
- 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('尚未创建在线答题卡,请创建');
- }
- });
- }
- $('.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);
- }
- });
- });
- </script>
|