1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114 |
- <script src="/js/jquery.datetimepicker.js"></script>
- <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
- <link rel="stylesheet" href="/css/modelCreatePaper.css" />
- <link rel="stylesheet" href="/css/jquery.datetimepicker.css" />
- <link rel="stylesheet" href="/css/third/base.css" />
- <style>
- #choose-error{color: #FF0000;}
- #examName-error{color: #FF0000;}
- #classIds-error{color: #FF0000;}
- #type-error{color: #FF0000;}
- #markType-error{color: #FF0000;}
- #subject-error{color: #FF0000;}
- #examDate{color: #FF0000;}
- </style>
- <div class="main-content-inner">
- <ul class="clearfix main-content-inner-ul">
- <?php if((isset(Yii::app()->session['session_duoxueke_subject_id']) && Yii::app()->session['session_duoxueke_subject_id']==3) || (isset(Yii::app()->session['session_duoxueke_subject_id']) && Yii::app()->session['session_duoxueke_subject_id']==6)){?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("print/index",array('type'=>'wp'));?>"' 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 == 'wtb'){echo 'button_active';}?>" data-button="red">下载错题本</button>-->
- <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='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='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("print/student_product");?>"' 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 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("upload/index");?>"' class="button button_normal button_group button_arrow" data-button="red">上传试卷</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php if(isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)){
- ?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("print/restore");?>"' class="button button_normal button_group button_arrow" data-button="red">还原考试</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php
- }?>
- <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("third/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_duo");?>"' class="button button_normal button_group button_arrow " data-button="red">导出报告</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="mcp-title">模板组卷</div>
- <div class="mcp-main-con">
- <div class="mcp-form-list clearfix">
- <div class="mcp-form-menu fl">试卷名称</div>
- <div class="mcp-form-detail fl">
- <input type="text" placeholder="必填" class="test-paper-name" name="examName">
- </div>
- <div id="examName-error"></div>
- </div>
- <div class="mcp-form-list clearfix">
- <div class="mcp-form-menu fl">主阅卷员</div>
- <div class="mcp-form-detail fl">
- <div class="inp-text pointer">选择阅卷员</div>
- <ul class="select-con tac">
- <!--<li class="sel-option pointer" id="1">高三一班</li>-->
- <?php foreach($teacher_arr as $t):?>
- <li class="sel-option pointer" id="<?php echo $t['teacher_id']?>"><?php echo $t['teacher_name']?></li>
- <?php endforeach;?>
- <!--<li class="sel-option pointer" id="2">高三二班</li>-->
- <!--<li class="sel-option pointer" id="3">高三三班</li>-->
- </ul>
- </div>
- <div id="choose-error"></div>
- </div>
- <div class="mcp-form-list clearfix">
- <div class="mcp-form-menu fl">考试班级</div>
- <div class="mcp-form-detail fl">
- <div class="test-classes-desc">默认已选我执教的班级(<span class="">单击移除</span>)<span id="classIds-error"></span></div>
- <div class="sel-classes g1" status="1">
- </div>
- <div class="sel-classes g2" style="display: none;" status="0">
- </div>
- <div class="sel-classes g3" style="display: none;" status="0">
- </div>
- <div class="clearfix">
- <div class="grade-sel fl">
- <div class="grade-top">年级</div>
- <ul>
- <li class="active" grade="1">高一</li>
- <li class="" grade="2">高二</li>
- <li class="" grade="3">高三</li>
- </ul>
- </div>
- <div class="bj-sel fl" id="grade1">
- <div class="class-top">班级</div>
- <ul>
- </ul>
- </div>
- <div class="bj-sel fl" id="grade2" style="display: none;">
- <div class="class-top">班级</div>
- <ul>
- </ul>
- </div>
- <div class="bj-sel fl" id="grade3" style="display: none;">
- <div class="class-top">班级</div>
- <ul>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <div class="mcp-form-list clearfix">
- <div class="mcp-form-menu fl">线上阅卷</div>
- <div class="mcp-form-detail fl clearfix" id ="markType">
- <div class="mcp-radio-sel fl">
- <span class="sel-btn select markType" value="3"></span>
- <span class ="markType" value="3">班级混合阅卷</span>
- </div>
- <div class="mcp-radio-sel fl">
- <span class="sel-btn markType" value="4"></span>
- <span class="markType" value="4">班级单独阅卷</span>
- </div>
- <div id="markType-error"></div>
- </div>
- </div>
- <div class="mcp-form-list clearfix">
- <div class="mcp-form-menu fl">考试时间</div>
- <div class="mcp-form-detail fl clearfix">
- <input type="text" class='core datetimepicker8' style="width: 140px;line-height: 27px;padding-left: 5px;" name="examDate" id="trial_begin_time_test" readonly/>
- </div>
- <div id="examDate"></div>
- </div>
-
- </div>
- <div class="template-flag-box">
- <a href="javascript:;" id="createThird" active="true">保存试卷</a>
- <!--<a href="javascript:;" class="template-flag">创建答题卡</a>-->
- </div>
- <div class="template-flag-box" style="margin-top: 15px;font-size: 14px;color: #999999">
- <?php
- $_num= '';
- $use_version = '';
- if(isset(Yii::app()->session['coachInfo']->use_version))
- {
- $use_version = Yii::app()->session['coachInfo']->use_version;
- }else
- {
- $use_version = Yii::app()->session['coachInfo']['use_version'];
- }
- if(!$use_version)
- {
- $use_version = 100;
- }
- $version_number = implode('',explode('.',$use_version));
- if(strlen($version_number)<7)
- {
- for($i=0;$i<7-strlen($version_number);$i++)
- {
- $_num.='0';
- }
- }
- $version_number=(int)$version_number.$_num;
- ?>
- <span>该试卷是否需要创建新的答题卡?<a href="javascript:;" class="template-flag" style="color: #006cff;border-radius:unset;border-bottom:2px #006cff solid;background: none;font-size: 14px;font-weight: bold;width: 127px;">创建新的答题卡</a></span>
- </div>
- <div class="teamplate-list-box">
- <div class="mcp-form-list clearfix">
- <table class="card-setting">
- <tr>
- <th>答题卡类型</th>
- <td>
- <label><input type="radio" name="layout" checked value="21">A3</label>
- <label><input type="radio" name="layout" value="11">A4横版</label>
- <label><input type="radio" name="layout" value="10">A4竖版</label>
- </td>
- </tr>
- <tr>
- <th>考号板式</th>
- <td>
- <label><input type="radio" name="select_card_type" value="1" checked>准考证号</label>
- <label><input type="radio" name="select_card_type" value="2">条形码</label>
- </td>
- </tr>
- <tr>
- <th>题型(多选)</th>
- <td class="ques-type">
- <div class="ques-type-control">
- <label><input type="checkbox">单选题</label>
- <label class="special-type"><input type="checkbox">不定项选择题</label>
- <label><input type="checkbox">主观题</label>
- <label ><input type="checkbox">选做题</label>
- </div>
- <div class="ques-topic-num">
- <div class="ques-topic ques-topic-one">
- <h3 class="clearfix"><span class="fl">单选题</span></h3>
- <div class="clearfix ques-topic-list">
- <img src="/images/del_2.png" class="ques-item-del">
- <div class="ques-topic-item">题型<span>1</span>:<em>【A】<b></b></em><em>【B】<b></b></em><em>【C】<b></b></em><em>【D】<b></b></em><s></s><a href="javascript:;">选项编辑</a></div>
- <div class="topic-num">题号:<input type="text" value=""></div>
- <p>*多个题号逗号隔开(如1,2,3,4,5);连续题号可用"-"隔开(如:1-5);</p>
- </div>
- <div class="add-type"><a href="javascript:;"><img src="/css/third/img/add_topic.png" alt="">增加题型</a></div>
- </div>
- <div class="ques-topic">
- <h3 class="clearfix"><span class="fl">不定向选择题</span></h3>
- <div class="clearfix ques-topic-list">
- <img src="/images/del_2.png" class="ques-item-del">
- <div class="ques-topic-item">题型<span>1</span>:<em>【A】<b></b></em><em>【B】<b></b></em><em>【C】<b></b></em><em>【D】<b></b></em><s></s><a href="javascript:;">选项编辑</a></div>
- <div class="topic-num">题号:<input type="text" value=""></div>
- <p>*多个题号逗号隔开(如1,2,3,4,5);连续题号可用"-"隔开(如:1-5);</p>
- </div>
- <div class="add-type"><a href="javascript:;"><img src="/css/third/img/add_topic.png" alt="">增加题型</a></div>
- </div>
- <div class="ques-topic ques-topic3">
- <h3 class="clearfix">
- <span class="fl">主观题</span>
- <div class="fl line-type">
- 边框样式:
- <label><input type="radio" name="lineType" checked>无边框</label>
- <label><input type="radio" name="lineType">虚线</label>
- <label><input type="radio" name="lineType">实线</label>
- </div>
- </h3>
- <div class="clearfix ques-topic-list">
- <img src="/images/del_2.png" class="ques-item-del">
- <div class="ques-topic-item">主观题<span>1</span>:
- <em>样式:<img src="/css/third/img/topic_type.png" alt=""></em>
- <label><input type="radio" name="topicType" value="1" checked>空白</label>
- <label><input type="radio" name="topicType" value="2">横线</label>
- <div class="line-control">
- 行数:
- <b class="add">+</b>
- <input type="text" value="1" readonly>
- <b class="del">-</b>
- </div>
- <label><input type="radio" name="topicType" value="3">作文表格</label>
- </div>
- <div class="topic-num">题号:<input type="text" value=""></div>
- <p>*多个题号逗号隔开(如1,2,3,4,5);连续题号可用"-"隔开(如:1-5);</p>
- </div>
- <div class="add-type"><a href="javascript:;" class="main-topic"><img src="/css/third/img/add_topic.png" alt="">增加题型</a></div>
- </div>
- <div class="ques-topic">
- <h3 class="clearfix"><span class="fl">选做题</span></h3>
- <div class="clearfix ques-topic-list choose-topic">
- <img src="/images/del_2.png" class="ques-item-del">
- <div class="ques-topic-item choose-topic-num">题型:<input type="text" value=""> 选 <input type="text" name="bixuan" value="1" readonly></div>
- <div>样式:<label><input type="radio" name="chooseType" value="1" checked>空白</label><label><input type="radio" name="chooseType" value="2">横线</label></div>
- <div class="topic-num">题号:<input type="text" value=""></div>
- <p>*选做题必须为模板最后一题,选做题题型数量与填写的题号要一致,(如题型2选1,则题号:2,3);</p>
- <p>*多个题号逗号隔开(如1,2,3,4,5);连续题号可用"-"隔开(如:1-5);</p>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
- </div>
- <input type="hidden" name="subjectId" value="<?php echo Yii::app()->session['session_duoxueke_subject_id'];?>">
- <input type="hidden" name="textbookId" value="0">
- <input type="hidden" name="tpl_index" value="1050">
- <input type="hidden" name="tpl_index" value="1050">
- <input name="type" value="1" type="hidden"/>
- <input name="teacherId" value="0" type="hidden"/>
- <input name="markType" value="3" type="hidden"/>
- <input name="classIds" value="0" type="hidden"/>
- <input name="topic" value="0" type="hidden"/>
- <input name="is_update" value="0" type="hidden"/>
- <!--<button id="createThird">确定</button>-->
- <div class="mcp-form-list mcp-fl-btns clearfix">
- <input type="button" value="打印预览" class="mcp-sure-btn" id="PrintThird" active="true">
- </div>
- </div>
- </div>
- </div>
- <script>
- var TopicType=new Array(4);
- TopicType[0]=[];
- TopicType[1]=[];
- TopicType[2]=[];
- TopicType[3]=[];
- $(document).ready(function(){
- $('.datetimepicker8').datetimepicker({
- onGenerate:function( ct ){
- $(this).find('.xdsoft_date').toggleClass('xdsoft_disabled');
- $(this).find('.xdsoft_today').removeClass('xdsoft_disabled');
- },
- format:'Y-m-d',
- formatDate:'Y-m-d',
- //minDate:'-1970/01/2',
- maxDate:'+1970/01/2',
- todayBtn : true,
- minDate: '-<?php echo date('Y-m-d', strtotime('Yesterday')); ?>',
- timepicker:false
- });
- //选择考试时间
- //选择教材题源
- var subjects = <?php echo json_encode($teacherSubjectNames); ?>;
- var textbooks = <?php echo json_encode($teacherSubjectMaterialNames); ?>;
- for(var key in subjects){
- $(".choose-grade").append('<option value="'+ key +'">'+ subjects[key] +'</option>');
- }
- $(".choose-grade").change(function(){
- var obj = $(this);
- var val = obj.val();
- var child = $('.choose-book');
- child.html('<option value="0">选择教材</option>');
- for (var key in textbooks) {
- if (key == val) {
- child.html('');
- for (var name in textbooks[key]) {
- child.append('<option value="'+ [name] +'">'+ textbooks[key][name] +'</option>');
- }
- }
- }
- });
- //返回
- $('.mcp-back-btn').click(function(){
- location.href="<?php echo Yii::app()->createUrl('third/index')?>";
- });
- $('input[name="examName"]').keydown(function(event){
- $('#examName-error').html("");
- });
- //阅卷方式
- $('.markType').click(function(){
- var markType = $(this).attr('value');
- if(markType){
- $('#markType-error').html("");
- }
- $('input[name="markType"]').val(markType);
- });
- //考试类型
- $('.examType').click(function(){
- var type = $(this).attr('value');
- if(type){
- $('#type-error').html("");
- }
- $('input[name="type"]').val(type);
- });
- //选择教师
- $('.sel-option').click(function(){
- var teacher_id = $(this).attr('id');
- if(teacher_id){
- $('#choose-error').html("");
- }
- $('input[name="teacherId"]').val(teacher_id);
- $.post(
- "<?php echo Yii::app()->createUrl('third/ajaxchangeclasses')?>",
- {teacher_id:teacher_id},
- function(result){
- if(result.error){
- $('#choose-error').html(result.error);
- }else{
- var htmlg1 = "";
- var htmlg2 = "";
- var htmlg3 = "";
- $.each(result.class_arr_select,function(k,v){
- if(v.grade == 1){
- htmlg1+="<span grade='"+v.grade+"' classid='"+v.class_id+"'>"+v.class_name+"</span>";
- }
- if(v.grade == 2){
- htmlg2+="<span grade='"+v.grade+"' classid='"+v.class_id+"'>"+v.class_name+"</span>";
- }
- if(v.grade == 3){
- htmlg3+="<span grade='"+v.grade+"' classid='"+v.class_id+"'>"+v.class_name+"</span>";
- }
- });
- $('.g1').html(htmlg1);
- $('.g2').html(htmlg2);
- $('.g3').html(htmlg3);
- var htmlidg1 = "";
- var htmlidg2 = "";
- var htmlidg3 = "";
- $.each(result.class_arr_noselect,function(k,v){
- if(v.grade == 1){
- htmlidg1 += '<li class="bjs-lis ellipsis" grade="'+v.grade+'" classid="'+v.class_id+'" ><span class="judge-sel"></span>'+v.class_name+'</li>';
- }
- if(v.grade == 2){
- htmlidg2 += '<li class="bjs-lis ellipsis" grade="'+v.grade+'" classid="'+v.class_id+'" ><span class="judge-sel"></span>'+v.class_name+'</li>';
- }
- if(v.grade == 3){
- htmlidg3 += '<li class="bjs-lis ellipsis" grade="'+v.grade+'" classid="'+v.class_id+'" ><span class="judge-sel"></span>'+v.class_name+'</li>';
- }
- });
- $('#grade1 ul').html(htmlidg1);
- $('#grade2 ul').html(htmlidg2);
- $('#grade3 ul').html(htmlidg3);
- }
- },
- 'json'
- );
- });
- //切换年级
- $('.a-years,.a-province,.paper-type > span, .grade-sel ul li').click(function(){
- if(!$(this).hasClass('active')){
- $(this).addClass('active').siblings().removeClass('active');
- var gradearr=[1,2,3];
- var grade=$(this).attr("grade");
- for(var i=0;i<=gradearr.length;i++){
- if(gradearr[i]==grade){
- $("#grade"+grade).show();
- $('.g'+grade).show();
- $('.g'+grade).attr('status',1);
- }else{
- $("#grade"+gradearr[i]).hide();
- $(".g"+gradearr[i]).hide();
- $(".g"+gradearr[i]).attr('status',0);
- }
- }
- }
- });
- //添加班级
- $(".bj-sel ul").on("click","li", function(){
- $('#classIds-error').html("");
- $(this).find('.judge-sel').addClass('active');
- $(this).remove();
- var grade = $(this).attr('grade');
- $('.g'+grade).append('<span grade="'+$(this).attr("grade")+'" classid="'+$(this).attr("classid")+'">'+$(this).text()+'</span>');
- });
- //移除班级
- $('.sel-classes').delegate('span','click',function(){
- $(this).remove();
- $("#grade"+$(this).attr("grade")).children("ul").append('<li class="bjs-lis" grade="'+$(this).attr("grade")+'" classid="'+$(this).attr("classid")+'"><span class="judge-sel"></span>'+$(this).html()+'</li>');
- });
- if ($('.sel-classes > span').length > 0){
- for (var i = 0;i < $('.sel-classes > span').length; i++){
- for (var k = 0;k < $('.bjs-lis').length; k++){
- if ($('.bjs-lis').eq(k).text().trim()==$('.sel-classes > span').eq(i).text().trim()) {
- $('.bjs-lis').eq(k).find('.judge-sel').addClass('active');
- }
- }
- }
- }
- $('.mcp-radio-sel').click(function(){
- if (!$(this).find('.sel-btn').hasClass('select')) {
- $(this).find('.sel-btn').addClass('select');
- $(this).siblings().find('.sel-btn').removeClass('select');
- }
- });
- $('.grade-sel ul li').click(function(){
- $(this).addClass('active').siblings().removeClass('active');
- });
- // $('.judge-sel').on('click',function(){
- // alert(1);
- // if (!$(this).hasClass('active')) {
- // $(this).addClass('active');
- // $('.sel-classes').append('<span>'+$(this).closest('.bjs-lis').text()+'</span>');
- // } else {
- // $(this).removeClass('active');
- // for (var i = 0;i < $('.sel-classes > span').length; i++) {
- // console.log($('.sel-classes > span').eq(i).text());
- // if ($('.sel-classes > span').eq(i).text().trim() == $(this).closest('.bjs-lis').text().trim()){
- // $('.sel-classes > span').eq(i).remove();
- // }
- // }
- // }
- // });
- $('.sel-classes > span').click(function(){
- $(this).remove();
- for (var i = 0;i < $('.bjs-lis').length; i++) {
- if ($('.bjs-lis').eq(i).text().trim()==$(this).text().trim()){
- $('.bjs-lis').eq(i).find('.judge-sel').removeClass('active');
- }
- }
- });
- // 下拉列表模拟
- $('.inp-text').click(function(){
- if ($(this).next().is(':hidden')){
- $(this).next().show();
- } else {
- $(this).next().hide();
- }
- });
- // 点下拉列表选项
- $('.select-con li').click(function(){
- $(this).closest('.select-con').hide();
- $(this).closest('.mcp-form-detail').find('.inp-text').text($(this).text());
- });
- // 点击空白处下拉列表消失
- $(document).click(function(e){
- var targetNode = $(e.target).closest(".inp-text");
- if (targetNode.length>0){
- return;
- }else{
- $(".select-con").hide();
- }
- });
- $("body").delegate("#createThird[active='true']", "click", function(e) {
- var classIds='';
- $(".sel-classes[status=1]").children("span").each(function(){
- classIds += $(this).attr('classid')+",";
- });
- $('input[name="classIds"]').val(classIds);
- var error = new Array();
- var classIds = $('input[name="classIds"]').val();
- var examName = $('input[name="examName"]').val();
- var is_update = $('input[name="is_update"]').val();
- var type = $('input[name="type"]').val();
- var teacherId = $('input[name="teacherId"]').val();
- // var markType = $('input[name="markType"]').val();
- var markType = $("#markType").find(".select").attr("value");
- var subjectId = $('input[name=subjectId]').val();
- var examDate = $("input[name='examDate']").val();
- if(subjectId == 0 || subjectId == null){
- $('#subject-error').html('请指定题源');
- error.push('没有指定题源');
- }else{
- $('#subject-error').html('');
- }
- if(examName == "" || examName == null){
- $('#examName-error').html('请指定考试名称');
- error.push('没有指定考试名称');
- }else{
- $('#examName-error').html('');
- }
- if(type == "" || type == null){
- $('#type-error').html('请指定考试类型');
- error.push('没有指定考试类型');
- }else{
- $('#type-error').html('');
- }
- if(teacherId == '0' || teacherId == null){
- $('#choose-error').html('请指定阅卷老师');
- error.push('没有指定阅卷老师');
- }else{
- $('#choose-error').html('');
- if(classIds == "" || classIds == null){
- $('#classIds-error').html('请指定考试班级');
- error.push('没有指定考试班级');
- }else{
- $('#classIds-error').html('');
- }
- }
- if(!markType){
- $('#markType-error').html('请指定阅卷方式');
- error.push('没有指定阅卷方式');
- }else{
- $('#markType-error').html('');
- }
- if (examDate == '') {
- $('#examDate').html('请设置考试日期');
- error.push('请设置考试日期');
- } else if (examDate < '<?php echo date('Y-m-d'); ?>') {
- //$('#examDate').html('考试日期设置错误');
- // error.push('考试日期设置错误');
- }else{
- $('#examDate').html('');
- }
- if(error.length == 0){
- var data={
- examName:examName,
- teacherId:teacherId,
- type:type,
- classIds:classIds,
- markType:markType,
- subjectId:subjectId,
- textbookId:0,
- examDate:examDate,
- tpl_index:1050,
- is_update:is_update,
- topic:JSON.stringify(TopicType),
- layout:$("input[name=layout]:checked").val(),
- select_card_type:$("input[name=select_card_type]:checked").val()
- };
- if (!$(".ques-type-control label input").is(':checked')) {
- $.post("<?php echo Yii::app()->createUrl('third/quanCreatethird')?>",data,function (data) {
- var m = JSON.parse(data);
- if(m.status==0)
- {
- layer.msg(m.msg);
- return false;
- }else{
- $('input[name="is_update"]').val(m.exam_group_id);
- location.href = m.result;
- }
- });
- }else{
- $.post("<?php echo Yii::app()->createUrl('third/ajaxCreatethird')?>",data,function (data) {
- var m = JSON.parse(data);
- if(m.status==0)
- {
- layer.msg(m.msg);
- return false;
- }else{
- $('input[name="is_update"]').val(m.exam_group_id);
- // evaluationClient.CreateDiSanFang(JSON.stringify(m.result));
- location.href = m.result;
- }
- });
- }
- }else{
- layer.msg(error.join(','));
- }
- });
- $("#PrintThird").click(function(){
- if (!$(".ques-type-control label input").is(':checked')) {
- layer.msg('请选择题型!');return false;
- }
- for(i = 0 ; i<TopicType.length;i++)
- {
- if(TopicType[i].length>0){
- if( i==3 &&!TopicType[3][0][0]){
- layer.msg('选做题设置有误,题型不能为空!');
- return false;
- }
- for (j = 0;j<TopicType[i].length;j++){
- if(TopicType[i][j][1]=="")
- {
- layer.msg('题号不能为空!');
- return false;
- }
- }
- }
- }
- $('input[name="topic"]').val(JSON.stringify(TopicType)); //题型选择数据赋值
- var classIds='';
- $(".sel-classes[status=1]").children("span").each(function(){
- classIds += $(this).attr('classid')+",";
- });
- $('input[name="classIds"]').val(classIds);
- var examName = $('input[name="examName"]').val();
- var classIds = $('input[name="classIds"]').val();
- var data = {
- examName:examName,
- classIds:classIds,
- layout:$("input[name=layout]:checked").val(),
- select_card_type:$("input[name=select_card_type]:checked").val(),
- topic:JSON.stringify(TopicType)
- };
- $.post("<?php echo Yii::app()->createUrl('third/create_sheet')?>",data,function (rs) {
- var m = JSON.parse(rs);
- if(m.status==0)
- {
- layer.msg(m.msg);
- return false;
- }else{
- evaluationClient.CreateDiSanFang(JSON.stringify(m.result));
- }
- });
- });
- });
- </script>
- <script>
- $(function(){
- $(".template-flag").click(function(){
- $(".teamplate-list-box").toggle();
- })
- // 点击显示隐藏
- $(".ques-type-control label input").click(function(e){
- var index=$(this).parent().index();
- var tempTopic = $(".ques-topic-num .ques-topic").eq(index);
- delTopicType(tempTopic);
- if($(this).is(":checked")){
- tempTopic.show();
- if(index==0 || index==1){
- TopicType[index].push([4,'',0]); //对应数据初始化对应题型,题号,样式三种数据
- }else if(index==2){
- TopicType[index].push([1,'',1]); //对应数据初始化对应题型,题号,样式三种数据
- }else if(index==3){
- TopicType[index].push([0,'',0]); //对应数据初始化对应题型,题号,样式三种数据
- }
- //console.log(TopicType);
- }else{
- tempTopic.hide();
- if(index==0 || index==1){
- tempTopic.find(".ques-topic-list").eq(0).find("input").val("");
- tempTopic.find(".ques-topic-list").find('.topic-num input').val('');
- tempTopic.find(".ques-topic-list").eq(0).find(".ques-topic-item").removeClass("ques-topic-item-edit").find("a").html("选项编辑");
- }else if(index==2){
- console.log(tempTopic.find(".ques-topic-list").find('.topic-num').find('input').val());
- tempTopic.find(".ques-topic-list").find('.topic-num').find('input').val('');
- tempTopic.find(".ques-topic-list").find('.line-control').find('input').val(1);
- tempTopic.find(".ques-topic-list").eq(0).find(".ques-topic-item").find('label input').eq(0).click();
- }else if(index==3){
- tempTopic.find(".ques-topic-list").find('.topic-num input').val('');
- tempTopic.find(".ques-topic-list").eq(0).find("input").val("");
- }
- tempTopic.find(".ques-topic-list").eq(0).find("em").remove();
- for(var i=0;i<4;i++){
- tempTopic.find(".ques-topic-list").eq(0).find("s").before("<em>【"+arr[i]+"】<b></b></em>");
- }
- for(var i=tempTopic.find(".ques-topic-list").length;i>1;i--){
- tempTopic.find(".ques-topic-list:last").remove();
- }
- TopicType[index]=[]; //清空对应数据
- console.log(TopicType);
- }
- $("input[name=bixuan]").val(1)
- });
- // 选项编辑
- $("body").delegate(".ques-topic-item a","click",function(){
- if($(this).closest(".ques-topic-item").hasClass("ques-topic-item-edit")){
- $(this).closest(".ques-topic-item").removeClass("ques-topic-item-edit");
- $(this).html("选项编辑");
- $(this).closest(".ques-topic-item").find("s").hide();
- //装入修改后数据
- var index=$(this).closest('.ques-topic').index(); //第几个大类型
- var topic_index=$(this).closest('.ques-topic-list').index()-1; //该题型下第几个子题型
- TopicType[index][topic_index][0]=$(this).parent().find('em').length;
- console.log(TopicType);
- }else{
- $(this).closest(".ques-topic-item").addClass("ques-topic-item-edit");
- $(this).siblings("s").show();
- if($(this).closest(".ques-topic").hasClass("ques-topic-one")){
- console.log($(this).closest(".ques-topic-item").find("em").length)
- if($(this).closest(".ques-topic-item").find("em").length >3){
- $(this).siblings("s").hide();
- }else{
- $(this).siblings("s").show();
- }
- }else{
- console.log($(this).closest(".ques-topic-item").find("em").length)
- if($(this).closest(".ques-topic-item").find("em").length >6){
- $(this).siblings("s").hide();
- }else{
- $(this).siblings("s").show();
- }
- }
- $(this).html("保存");
- }
- });
- // 删除选项
- $("body").delegate(".ques-topic-item-edit b","click",function(){
- if($(this).closest(".ques-topic-item-edit").find("em").length <= 10){
- $(this).closest(".ques-topic-item-edit").find("s").show();
- }
- var tempParent = $(this).closest(".ques-topic-item-edit");
- $(this).closest("em").remove();
- orderABC(tempParent.find("em"))
- hideDel(tempParent.find("b"))
- });
- function orderABC(obj){
- for(var i=0;i<obj.length;i++){
- obj.eq(i).html("【"+arr[i]+"】<b></b>")
- }
- }
- // 增加选项
- var arr = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N'];
- $("body").delegate(".ques-topic-item-edit s","click",function(){
- if($(this).closest(".ques-topic").hasClass("ques-topic-one")){
- addAbc($(this),4)
- }else{
- addAbc($(this),7)
- }
- });
- function addAbc(obj,count){
- var idx = obj.closest(".ques-topic-item-edit").find("em").length;
- obj.before("<em>【"+arr[idx]+"】<b></b></em>");
- hideDel(obj.closest(".ques-topic-item-edit").find("b"))
- if(obj.closest(".ques-topic-item-edit").find("em").length >= count){
- obj.hide();
- }
- }
- // 增加题型
- $(".add-type a").click(function(){
- var temp = $(this).closest(".add-type").prev().clone(true);
- temp.find("span").html($(this).closest(".add-type").prev().index()+1);
- temp.find("input[type='text']").val("");
- temp.find(".ques-topic-item").removeClass("ques-topic-item-edit").find("a").html("选项编辑");
- temp.find("em").remove();
- for(var i=0;i<4;i++){
- temp.find("s").before("<em>【"+arr[i]+"】<b></b></em>");
- }
- if($(this).hasClass("main-topic")){
- temp.find("input[name^='topicType']").attr("name","topicType_"+($(this).closest(".ques-topic").find(".ques-topic-list").length));
- temp.find(".line-control input").val(1)
- }
- temp.find('input:radio').each(function(i){
- temp.find('input:radio').eq(i).attr('checked',false);
- });
- temp.find('.line-control').hide();
- $(this).closest(".add-type").before(temp);
- var index=$(this).closest('.ques-topic').index(); //第几个大类型
- if(index==0 || index==1){
- TopicType[index].push([4,'',0]); //对应数据初始化对应题型,题号,样式三种数据
- }else if(index==2){
- $style=$('.line-type input:radio:checked').parent().index()+1;
- TopicType[index].push([0,'',$style]); //对应数据初始化对应题型,题号,样式三种数据
- }else if(index==3){
- TopicType[index].push([0,'',0]); //对应数据初始化对应题型,题号,样式三种数据
- }
- temp.find("input[type='radio']").eq(0).click()
- delTopicType($(this).closest(".add-type").siblings(".ques-topic-list"));
- })
- // 显示隐藏主观题横线行数
- initTopicType($(".ques-topic-item input[type='radio']"))
- function initTopicType(obj){
- if(obj.val() == 2){
- obj.closest("label").siblings(".line-control").show();
- }else{
- obj.closest("label").siblings(".line-control").hide();
- }
- }
- // 删除题型
- function delTopicType(obj){
- obj.find(".ques-item-del").show();
- obj.eq(0).find(".ques-item-del").hide();
- }
- $("body").delegate(".ques-item-del","click",function(){
- var index=$(this).closest('.ques-topic').index(); //大题型索引
- var topic_index=$(this).closest('.ques-topic-list').index()-1;//子题型索引
- TopicType[index].splice(topic_index,1);
- console.log(TopicType[index]);
- $(this).closest(".ques-topic-list").remove();
- })
- // 主观题样式切换
- $("body").delegate(".ques-topic-item input[type='radio']","click",function(){
- initTopicType($(this));
- var index=$(this).closest('.ques-topic').index(); //大题型索引
- var topic_index=$(this).closest('.ques-topic-list').index()-1;//子题型索引
- if($(this).val()==2){
- TopicType[index][topic_index][0]=$(this).val()+'///'+$(this).closest('.ques-topic-item').find('.line-control input').val();
- }else{
- TopicType[index][topic_index][0]=$(this).val();
- }
- console.log(TopicType);
- });
- // 主观题样式图片显示隐藏
- $("body").delegate(".ques-topic-item em","mouseenter",function(){
- $(this).find("img").show();
- });
- $("body").delegate(".ques-topic-item em","mouseleave",function(){
- $(this).find("img").hide();
- });
- // 主观题横线行数加减
- $("body").delegate(".line-control .add","click",function(){
- $(this).siblings("input").val(Number($(this).siblings("input").val())+1);
- var index=$(this).closest('.ques-topic').index(); //大题型索引
- var topic_index=$(this).closest('.ques-topic-list').index()-1;//子题型索引
- TopicType[index][topic_index][0]='2///'+$(this).siblings("input").val();
- });
- $("body").delegate(".line-control .del","click",function(){
- if(Number($(this).siblings("input").val()) > 1){
- $(this).siblings("input").val(Number($(this).siblings("input").val())-1);
- var index=$(this).closest('.ques-topic').index(); //大题型索引
- var topic_index=$(this).closest('.ques-topic-list').index()-1;//子题型索引
- TopicType[index][topic_index][0]='2///'+$(this).siblings("input").val();
- }
- });
- // 校验文本框输入
- $("body").delegate(".topic-num input","keyup",function(){
- $(this).val($(this).val().replace(/[^\d-,]+/g,""));
- });
- $(".choose-topic-num input").keyup(function(){
- $(this).val($(this).val().replace(/[^\d]+/g,""));
- })
- //题号变化,修改数据
- $('.ques-topic-num').on('change','.topic-num input',function(){
- var index=$(this).closest('.ques-topic').index(); //大题型索引
- var topic_index=$(this).closest('.ques-topic-list').index()-1;//子题型索引
- var text=0;
- if($(this).val()!='' && $(this).val()!=undefined){
- text=$(this).val();
- }
- TopicType[index][topic_index][1]=text;
- console.log(TopicType);
- });
- //主观题样式变化,修改数据
- $('.line-type label').click(function(){
- //alert($(this).index());
- for(var i=0;i<TopicType[2].length;i++){
- TopicType[2][i][2]=$(this).index()+1;
- }
- console.log(TopicType);
- });
- //选做题
- //题号
- $('.ques-topic').on('change','.choose-topic-num input',function(){
- //alert($(this).index());
- var text='';
- if($(this).index()==0){
- text=$(this).val()+'///'+$(this).next().val();
- }else{
- text=$(this).prev().val()+'///'+$(this).val();
- }
- var index=$(this).closest('.ques-topic').index(); //大题型索引
- var topic_index=$(this).closest('.ques-topic-list').index()-1;//子题型索引
- TopicType[index][topic_index][0]=text;
- console.log(TopicType);
- });
- //样式
- $('.ques-topic').on('click','.choose-topic input:radio',function(){
- var index=$(this).closest('.ques-topic').index(); //大题型索引
- var topic_index=$(this).closest('.ques-topic-list').index()-1;//子题型索引
- TopicType[index][topic_index][2]=$(this).val();
- });
- function hideDel(obj){
- if(obj.length > 2){
- obj.closest(".ques-topic-item-edit").find("b").css("display","inline");
- }else{
- obj.closest(".ques-topic-item-edit").find("b").hide()
- }
- }
- })
- function show_version() {
- layer.msg('你的客户端版本太低,请升最新版本');
- }
- </script>
- <style>
- .template-flag-box{padding-left:50px;}
- .template-flag-box a{display:inline-block;color:#fff;text-decoration:none;border-radius:3px;width: 100px;text-align: center;background: #1FBF86;height: 30px;margin-right:20px;line-height:30px}
- .teamplate-list-box{margin:20px;border:1px solid #ccc;display: none;}
- .teamplate-list-box .mcp-fl-btns{padding-left:50px; text-align: left}
- .card-setting{width: 100%;}
- .card-setting td{padding:0 20px 30px 20px; font-size: 14px;}
- .card-setting td label{display: inline-block; width:100px;font-weight: normal}
- .card-setting td .special-type{width: 150px;}
- .card-setting td input[type="radio"],.ques-type input[type="checkbox"]{margin-right: 3px;margin-bottom: 4px; width: 14px;height: 14px;vertical-align: middle;}
- .card-setting th{vertical-align: top; text-align: right;font-weight: normal;font-size: 14px;width: 110px;}
- .card-setting label{cursor: pointer;}
- .ques-type input[type="text"]{padding-left: 5px; width:80px;height: 34px;border:1px solid #15a55d;border-radius: 3px;outline: none;}
- .topic-num input[type="text"]{width: 380px;}
- .ques-type p{margin-top:3px; color: #888;font-size: 14px;}
- /*.ques-type div{margin-bottom:50px;}*/
- .ques-print{padding-left: 30px;}
- .ques-print a{display: inline-block;margin-left: 30px; width: 100px;line-height: 30px;text-decoration: none;text-align: center;border-radius: 3px;color: #fff;background-color: #15a55d;}
- .ques-print a:hover{background-color: #098346;}
- .ques-topic-num{margin-top:30px;}
- .ques-topic{margin-bottom: 20px; border:1px solid #ccc;border-radius: 5px; display: none;}
- .ques-topic h3{position: relative; padding:0 10px;line-height: 36px;border-bottom: 1px solid #ccc;background-color: #f2f2f2;border-radius: 5px 5px 0 0 ;}
- .ques-topic h3:before{content:"";position: absolute;left: 0;top:50%;width: 0;height: 16px;border-left:4px solid #15a55d;transform:translateY(-50%);}
- .ques-topic-list{position:relative; padding:10px;border-bottom:1px solid #ccc;}
- .ques-topic-item{line-height: 34px;}
- .ques-item-del{position: absolute;right:10px;top:10px;width: 20px;cursor:pointer}
- /*.ques-topic-item label{font-size: 14px;}*/
- .ques-topic-item-edit b{background: url(/css/third/img/del.png) no-repeat;position: absolute;right: 0;top:0;width: 10px;height: 10px;transform: translateX(-40%);-webkit-background-size: cover;background-size: cover;cursor: pointer;}
- .ques-topic-item a{padding:2px 10px;font-size: 12px; text-decoration: none;background-color: #15a55d;color: #fff;border-radius: 3px;}
- .ques-topic-item s{width: 20px;height: 20px;margin-bottom:-5px;margin-right:5px; background: url(/css/third/img/add.png) no-repeat left center;-webkit-background-size: 20px;background-size: 20px;cursor: pointer;display: none;}
- .ques-topic-item-edit s{display: inline-block;}
- .add-type img{margin-right: 10px; width: 50px;}
- .add-type a{margin:10px; display: inline-block;font-size: 14px;text-decoration: none;}
- /*.ques-topic3 .ques-topic-list{border-bottom:0;}*/
- .line-type{margin-left:30px;font-size: 14px;}
- .line-control{display: inline-block;font-size: 12px;margin:0 60px 0 -40px; }
- .line-control input[type="text"]{height: 21px;width: 60px;text-align: center; border-color: #ccc; border-radius: 0;}
- .line-control b{display: inline-block;margin-bottom: -5px; width: 20px;height: 20px;line-height: 20px;text-align: center;font-size: 16px; border:1px solid #ccc;background-color: #eee;overflow: hidden;cursor: pointer;}
- .ques-topic-item em{position: relative;cursor: pointer;}
- .ques-topic-item em img{position: absolute;left: 18px;top:18px;width: 360px; box-shadow: 0 0 15px rgba(0,0,0,.2);display: none;z-index: 2;}
- .ques-topic3 .ques-topic-item em:before{content: "?";display: inline-block;margin-right: 3px; width: 20px;height: 20px;line-height: 20px;text-align: center; background: #aaa;border-radius: 50%;color: #fff;}
- .choose-topic{border:0;}
- .choose-topic div{margin:14px 0;}
- </style>
|