123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798 |
- <style>
- /*切换选择*/
- .tab-con{
- position: relative;
- height: 30px;
- width: 200px;
- background: #F2F2F2;
- border: 1px solid #01B677;
- border-radius: 15px;
- }
- .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;
- }
- .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;
- }
- // .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;
- }
- .loading-pop{position: fixed;left: 0;top: 0;bottom: 0;right: 0;background: rgba(0,0,0,0.5);z-index: 200;}
- .loading-pop-msg{color: #fff;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);font-size: 22px;letter-spacing: 4px;}
- </style>
- <div class="main-content-inner">
- <ul class="clearfix main-content-inner-ul">
- <?php if((isset(Yii::app()->session['session_subject_id']) && Yii::app()->session['session_subject_id']==3) || (isset(Yii::app()->session['session_subject_id']) && Yii::app()->session['session_subject_id']==6)){?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("print/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">打印试卷</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'wtb'));?>"' class="button button_normal button_group button_arrow " data-button="red">下载错题本</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <!--<button onclick='ccc()' class="button button_normal button_group button_arrow <?php if($printType == 'isp'){echo 'button_active';}?>" data-button="red">下载个性化学习方案</button>-->
- <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'isp'));?>"' class="button button_normal button_group button_arrow " data-button="red">下载个性化学习方案</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <!--<button onclick='ccc()' class="button button_normal button_group button_arrow <?php if($printType == 'studytrend'){echo 'button_active';}?>" data-button="red">下载个性化学习宝</button>-->
- <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'studytrend'));?>"' class="button button_normal button_group button_arrow " data-button="red">下载个性化学习宝</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <!--<li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("vacationhomework/classes?type=vh");?>"' class="button button_normal button_group button_arrow <?php if($printType == 'vh'){echo 'button_active';}?>" data-button="red">下载暑假作业</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>-->
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("print/student_product",array('type'=>'section'));?>"' class="button button_normal button_group button_arrow" data-button="red">阶段复习个性化学习宝</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("third/index");?>"' class="button button_normal button_group button_arrow" data-button="red">第三方试卷</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow " data-button="red">导出报告</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("upload/index");?>"' class="button button_normal button_group button_arrow" data-button="red">上传试卷</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("record/importscore"); ?>"'
- class="button button_normal button_group button_arrow " data-button="red">导入成绩
- </button>
- <img src="/images/line.jpg" style="height:45px;"/>
- </li>
- <?php }else{ ?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("print/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">打印试卷</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow <?php if($printType == ''){echo 'button_active';}?>" data-button="red">导出报告</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("print/do_ruanyun_pdf");?>"' class="button button_normal button_group button_arrow" data-button="red">下载PDF</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php }?>
- <!--<div class="tab-con clearfix pull-right" style="margin:8px 11px 0 0">
- <div class="has-sel fl"><?php /*echo isset(Yii::app()->params["subjectId"][Yii::app()->session['session_subject_id']])?Yii::app()->params["subjectId"][Yii::app()->session['session_subject_id']]:'数学'*/?></div>
- <div class="sel-opt fl">
- 切换学科
- <?php /*if($subject){*/?>
- <div class="points"></div>
- <?php /*}*/?>
- </div>
- <div class="sel-cons" style="z-index:6;background-color: #fff;">
- <div class="sc-lis" val="3"><span>数学<?php /*if($subject && isset($subject[3]) && !empty($subject[3])){*/?><div class="points"></div><?php /*}*/?></span></div>
- <div class="sc-lis" val="12"><span>物理<?php /*if($subject && isset($subject[12]) && !empty($subject[12])){*/?><div class="points"></div><?php /*}*/?></span></div>
- <div class="sc-lis" val="13"><span>化学<?php /*if($subject && isset($subject[13]) && !empty($subject[13])){*/?><div class="points"></div><?php /*}*/?></span></div>
- <div class="sc-lis" val="14"><span>生物<?php /*if($subject && isset($subject[14]) && !empty($subject[14])){*/?><div class="points"></div><?php /*}*/?></span></div>
- </div>
- </div>-->
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("cylet/index");?>"' class="button button_normal button_group button_arrow" data-button="red">全学科统考</button>
- </li>
- </ul>
- <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">
- <div class="col-xs-4">
- <form method="get" id="form1" action="<?php echo $this->createUrl("print/change");?>">
- <div class="dataTables_length" style="margin: 6px 0px;">
- <div class="dataTables_length">
- <label><input type="text" class="form-control input-sm" placeholder="请输入学生姓名" name="sname" value="<?php echo $sname;?>"></label>
- <!--<button class="btn btn-minier btn-primary" id="search">搜索</button>-->
- <button style="padding:4px 12px;"class="label-primary-s bth-s">搜索</button>
- </div>
- </div>
- <input type="hidden" name="cid" class="clid" value="<?php echo $class_id;?>" />
- <input type="hidden" name="eid" class="emid" value="<?php echo $exam_id;?>" />
- <input type="hidden" name="tid" value="<?php echo $type_id;?>" />
- </form>
- </div>
- <div class="col-xs-8">
- <div class="dataTables_filter" id="dynamic-table_filter" style="padding-top:15px;text-align: right;">
- <?php if(isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)){?>
- <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="updatePaperStatus" style="display: none">
- <i style="font-style: normal;" ></i>是否使用学校准考证
- </a>
- <?php }?>
- <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="addPaperStudent">
- <i style="font-style: normal;" ></i>添加考试学生
- </a>
- <a href="javascript:void(0);" class="btn click-delete btn-sm" id="delPaperStudent">
- <i style="font-style: normal;" ></i>选择删除考试学生
- </a>
- <a href="javascript:void(0);" class="btn click-delete btn-sm" id="delPaperStudentAll">
- <i style="font-style: normal;" ></i>删除全部未考试学生
- </a>
- <?php if(!$isCustomTpl){?><a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="selectPrint">
- <i style="font-style: normal;" class="fa fa-print"></i>
- <?php if ($tplTwo == 1){echo '打印答题卡';}else{echo '打印试卷';}?>
- </a>
- <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="selectPrintPack">
- <i style="font-style: normal;" class="fa fa-print"></i>
- 打包打印
- </a>
- <!--<a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="printAnswer">
- <i style="font-style: normal;" class="fa fa-print"></i>下载答案解析
- </a>--><?php }?>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-12" style="font-weight:bold;padding:0px 15px">
- <?php echo $className;?> <?php echo $paperName;?>(使用<?php if($examInfo->school_card_status==0){echo '系统准考证号,长度为8位';}else{echo '学校准考证号,长度为'.$examInfo->school_card_length.'位';}?>)
- </div>
- </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 class="center">
- <!--<label class="pos-rel">
- <input type="checkbox" class="selectAll">
- <span class="lbl"></span>
- </label>-->
- <input type="checkbox" class="ace selectAll">
- </th>
- <th>学生名称</th>
- <th>学生编号</th>
- <th>系统准考证号</th>
- <th>学校准考证号</th>
- <th>试卷是否已上传</th>
- <th>成绩是否已生成</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($result)):foreach($result as $rt):?>
- <tr>
- <td class="center">
- <!--<label class="pos-rel">
- <input type="checkbox" class="ace myselect" value="<?php echo $rt['studentCode'];?>" stnm="<?php echo $rt['studentName'];?>">
- <span class="lbl"></span>
- </label>-->
- <input type="checkbox" class="ace myselect" value="<?php echo $rt['studentCode'];?>" stnm="<?php echo $rt['studentName'];?>">
- </td>
- <td><?php echo $rt['studentName'];?></td>
- <td><?php echo $rt['studentCode'];?></td>
- <td><?php echo $rt['student_card'];?></td>
- <td><?php echo $rt['school_student_card'];?></td>
- <td><?php echo $rt['is_feedback'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
- <td><?php echo $rt['is_complete'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
- </tr>
- <?php endforeach;else:?>
- <tr><td colspan="7">暂无数据!</td></tr>
- <?php endif;?>
- </tbody>
- </table>
- <input type="hidden" name="paperId" id="paperId" value="<?php echo $paper_id;?>" />
- <input type="hidden" name="wpCode" id="wpCode" value="<?php echo $exam_id;?>" />
- <input type="hidden" name="schoolId" id="schoolId" value="<?php echo Yii::app()->session['school_id'];?>" />
- <input type="hidden" name="wpType" id="wpType" value="<?php echo $wp_type;?>" />
- <input type="hidden" name="className" id="className" value="<?php echo $className;?>" />
- <input type="hidden" name="paperName" id="paperName" value="<?php echo $paperName;?>" />
- </div>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <div class="loading-pop" style="display:none;">
- <div class="loading-pop-msg">正在打包,请稍候···</div>
- </div>
- <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);
- }
- });*/
- $(".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('print/setSubjectId')?>",data,function(flags){
- if(flags)
- {
- location.reload();
- }else
- {
- alert('网络异常');
- }
- });
- $('.has-sel').text($(this).text());
- $(".sel-cons").hide();
- });
- })
- function ccc(){
- layer.msg('敬请期待!', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- return false;
- }
- });
- }
- $(function(){
- var school_card_status =<?php echo $examInfo->school_card_status;?>;
- // 全选\反选
- $(".selectAll").click(function(){
-
- if ($(this).prop("checked")) {
- $(".myselect").prop("checked",true);
- } else {
- $(".myselect").prop("checked",false);
- }
- });
- $("body").delegate("#stu_select_all","click",function(){
- $(this).closest("table").find("tbody .myselect").prop("checked",$(this).prop("checked"))
- })
- $("#addPaperStudent").click(function(){
- var studentsIds;
- var html1="";
- var html = ""+'<table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px"><thead><tr><th><input type="checkbox" class="stu selectAll" id="stu_select_all"></th><th>学生名称</th><th>学生编号</th></tr></thead><tbody>';
- <?php if($no_paper_student){
- foreach($no_paper_student as $v)
- {
- ?>
- html1=html1+'<tr><td><input type="checkbox" class="stu myselect" value="<?php echo $v['student_id']?>"></td><td><?php echo $v['realname']?></td><td><?php echo $v['student_id']?></td></tr>'
- <?php } }else{?>
- html1='<tr><td colspan="3">没有新的学生</td></tr>';
- <?php }?>
- html=html+html1;
- html=html+'</tbody></table>'+'<div class="row" style="margin:15px auto; 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>';
- layer.open({
- type: 1,
- area: ['450px', '280px'],
- title: "为本次考试添加本班学生",
- content: html,
- success: function(index, layerObj){
- jQuery("#cancel").on("click", function(){
- layer.closeAll();
- });
- jQuery("#confirm").on("click", function(){
- if (!$("input[class='stu myselect']").is(':checked'))
- {
- layer.msg('请至少选择一个学生!');return false;
- }
- jQuery("input[class='stu myselect']").each(function()
- {
- if(jQuery(this).is(":checked") && typeof(jQuery(this).val())!= "undefined")
- {
- studentsIds += ","+jQuery(this).val();
- }
- });
- if(studentsIds)
- {
- studentsIds = studentsIds.replace("undefined,",'');
- }
- var data={
- "studentsIds":studentsIds,
- "exam_id":"<?php echo $exam_id ?>",
- "paper_id":"<?php echo $paper_id ?>",
- "class_id":"<?php echo $class_id?>",
- };
- jQuery.post(
- "<?php echo $this->createUrl("print/addPaperStudent");?>",
- data,
- function(data){
- var m =JSON.parse(data);
- if(m.status==1)
- {
- var icon = 6;
- layer.alert("添加成功", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else if(m.status==2){
- var icon = 5;
- layer.alert("添加失败,学生已在本次考试中", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else if(m.status==3){
- var icon = 5;
- layer.alert("添加失败,学生:"+m.result+"已参加其它考试", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else{
- var icon = 5;
- layer.alert("添加失败", {icon: icon}, function(){
- location.replace(location.href);
- });
- }
- }
- );
- layer.closeAll();
- });
- },
- end: function(){
- }
- });
- });
- $("#updatePaperStatus").click(function(){
- var studentsIds;
- var html1="";
- var html = ""+'<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><?php if($examInfo->school_card_length){echo $examInfo->school_card_length;}else{ if(Yii::app()->session['school_id']>999){echo 9;}else{ echo 8;}}?></th></tr><tr><th>状态</th><th><input type="radio" class="ace1" name="school_card_status" value="0" <?php if($examInfo->school_card_status==0){echo 'checked';}?>>系统准考证号<input type="radio" class="ace1" name="school_card_status" value="1" <?php if($examInfo->school_card_status==1){echo 'checked';}?>>学校准考证号</th></tr></thead><tbody>';
- html=html+html1;
- html=html+'</tbody></table>'+'<div class="row" style="margin:0px auto; 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>';
- layer.open({
- type: 1,
- area: ['450px', '190px'],
- title: "是否使用学校准考证",
- content: html,
- success: function(index, layerObj){
- jQuery("#cancel").on("click", function(){
- layer.closeAll();
- });
- jQuery(".ace1").on("click", function(){
- school_card_status = jQuery(this).attr('value');
- });
- jQuery("#confirm").on("click", function(){
- var data={
- exam_id:"<?php echo $exam_id ?>",
- school_card_status:school_card_status
- };
- jQuery.post(
- "<?php echo $this->createUrl("print/setExamStudentCard");?>",
- data,
- function(data){
- var m =JSON.parse(data);
- if(m.status==1)
- {
- var icon = 6;
- layer.alert("添加成功", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else if(m.status==2){
- var icon = 5;
- layer.alert("添加失败,学生已在本次考试中", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else if(m.status==3){
- var icon = 5;
- layer.alert("添加失败,学生:"+m.result+"已参加其它考试", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else{
- var icon = 5;
- layer.alert("添加失败", {icon: icon}, function(){
- location.replace(location.href);
- });
- }
- }
- );
- layer.closeAll();
- });
- },
- end: function(){
- }
- });
- });
- $("#delPaperStudent").click(function(){
- // 判断是否有选中
- var studentsIds;
- layer.msg('确定删除选中的学生吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- if (!$("input[class='ace myselect']").is(':checked'))
- {
- layer.msg('请至少选择一个学生!');return false;
- }
- jQuery("input[class='ace myselect']").each(function()
- {
- if(jQuery(this).is(":checked") && typeof(jQuery(this).val())!= "undefined")
- {
- studentsIds += ","+jQuery(this).val();
- }
- });
- if(studentsIds)
- {
- studentsIds = studentsIds.replace("undefined,",'');
- }
- var data={
- "studentsIds":studentsIds,
- "exam_id":"<?php echo $exam_id ?>",
- "paper_id":"<?php echo $paper_id ?>",
- "class_id":"<?php echo $class_id?>",
- };
- jQuery.post(
- "<?php echo $this->createUrl("print/delPaperStudent?");?>",data,function(data){
- var m =JSON.parse(data);
- if(m.status==1)
- {
- var icon = 6;
- layer.alert("删除成功", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else if(m.status==2){
- var icon = 5;
- layer.alert("不能删除已上传成绩的学生", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else{
- var icon = 5;
- layer.alert("删除失败", {icon: icon}, function(){
- location.replace(location.href);
- });
- }
- });
- }
- });
- });
- $("#delPaperStudentAll").click(function(){
- // 判断是否有选中
- var studentsIds;
- layer.msg('确定删除全部未考试的学生吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- var data={
- "exam_id":"<?php echo $exam_id ?>",
- "paper_id":"<?php echo $paper_id ?>",
- "class_id":"<?php echo $class_id?>",
- };
- jQuery.post(
- "<?php echo $this->createUrl("print/delPaperStudentAll?");?>",data,function(data){
- var m =JSON.parse(data);
- if(m.status==1)
- {
- var icon = 6;
- layer.alert("删除成功", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else if(m.status==2){
- var icon = 5;
- layer.alert("不能删除已上传成绩的学生", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else{
- var icon = 5;
- layer.alert("删除失败", {icon: icon}, function(){
- location.replace(location.href);
- });
- }
- });
- }
- });
- });
- // 打印答案解析
- $("#printAnswer").click(function(){
- layer.msg('您确定下载答案解析嘛?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
-
- var wpCode = $("#wpCode").val();
- 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);
- }
- }
- );
- }
- });
- });
-
-
- $("#selectPrint").click(function(){
- var tpl = "<?php echo $tpl;?>";
- var paperType = "<?php echo $paperType;?>";
- document.paperData = <?php echo $paperData;?>;
-
- if (tpl == "2") {
- layer.msg('请先上传试题模板!');return false;
- }
-
- var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
-
- if(paperType == 2 && answerCardUploaded == 0){
- layer.msg('请先上传答题卡模板!');return false;
- }
-
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
-
- layer.msg('您确定打印嘛?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
-
- var result = [];
- var paperId = $("#paperId").val();
- var wpCode = $("#wpCode").val();
- var schoolId = $("#schoolId").val();
- var wpType = $("#wpType").val();
- var paperName = $("#paperName").val();
- var className = $("#className").val();
- var markType = <?php echo $markType;?>;
- if (!paperId || !wpCode || !schoolId || !wpType || !paperName || !className) {
- layer.msg('打印信息错误!');return false;
- }
-
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if ($(this).val() && $(this).attr("stnm")) {
- result.push('{'+'"clazzName":"'+className+'","paperId":"'+paperId+'","paperName":"'+paperName+'","selectQTNub":'+document.paperData.object.topicsCount.singleChoice+',"completionNub":'+document.paperData.object.topicsCount.blankFilling+',"questionSNub":'+document.paperData.object.topicsCount.shortAnswer+',"schoolId":"'+schoolId+'","studentCode":"'+$(this).val()+'","studentName":"'+$(this).attr("stnm")+'","wpCode":"'+wpCode+'","wpType":"'+wpType+'","markType":"'+markType+'"}');
- }
- }
- });
-
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
- evaluationClient.printPaper("["+result+"]");
- }
- });
- });
- $("#selectPrintPack").click(function(){
- var tpl = "<?php echo $tpl;?>";
- var paperType = "<?php echo $paperType;?>";
- document.paperData = <?php echo $paperData;?>;
- if (tpl == "2") {
- layer.msg('请先上传试题模板!');return false;
- }
- var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
- if(paperType == 2 && answerCardUploaded == 0){
- layer.msg('请先上传答题卡模板!');return false;
- }
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- $(".loading-pop").show();
- var student_ids = '';
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if ($(this).val() && $(this).attr("stnm")) {
- student_ids = student_ids +$(this).val()+',';
- }
- }
- });
- var data = {
- exam_id:"<?php echo $exam_id ?>",
- student_id:student_ids
- };
- $.post("<?php echo Yii::app()->createUrl('print/print_pack')?>",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.result+'" /></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
- {
- layer.msg(m.result);
- $(".loading-pop").hide();return;
- }
- });
- });
- })
- </script>
|