123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519 |
- <link rel="stylesheet" href="/fonts/fpdf/iconfont.css"/>
- <link rel="stylesheet" href="/css/alert.css"/>
- <?php $imgUrl = Yii::app()->request->hostInfo.'/images/disable.png';?>
- <style>
- .color-red{
- color: red;
- }
- .en-tfb-grade-1 .date>span{
- margin-right: 40px;
- }
- .option-wrap{
- margin-top: 20px;
- min-width: 600px;
- }
- .option-name{
- display: inline-block;
- width: 100px;
- vertical-align: top;
- margin-top: 10px;
- }
- .option-con{
- display: inline-block;
- width: 80%;
- min-width: 490px;
- padding: 10px;
- border: 1px solid #ccc;
- }
- .option-con>span{
- display: inline-block;
- margin-right: 20px;
- margin-top:10px;
- line-height: 1rem;
- cursor: pointer;
- }
- .select-grade{
- width: 150px;
- line-height: 30px;
- margin-bottom: 10px;
- }
- .option-con-class label{
- display: inline-block;
- margin-right: 20px;
- }
- .active{
- color: #697aff;
- }
- .btn-start{
- display: inline-block;
- margin-top: 20px;
- margin-left: 100px;
- padding: 10px 30px;
- color: #fff;
- background-color: #2977ff;
- cursor: pointer;
- }
- .en-tfb-grade-1{
- margin-left: 20px;
- }
- .layered-training .describe{width: 150px;margin-bottom: 10px;display: inline-block;}
- .layered-training .number{margin-bottom: 10px;display: inline-block; margin-left: 20px;}
- .layered-training .number input{width: 80px;text-align:center;}
- .layered-training .number .prompt{color: #6300BF;font-weight: 700;font-size: 16px;}
- </style>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_production_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="en-tfb-grade-1">
- <h2><?php echo $productName; ?>生成</h2>
- <p class="color-red">* 假期作业每个班级一个学期仅能生成一次!</p>
- <h4>学期:<?php echo $semesterName; ?></h4>
- <div class="option-wrap">
- <span class="option-name"><span class="color-red">*</span>班级:</span>
- <div class="option-con">
- <div>
- <select name="grade" class="select-grade">
- <option value="1" selected>高一</option>
- <option value="2">高二</option>
- <option value="3">高三</option>
- </select>
- </div>
- <div class="option-con-class" id="optionClass">
- </div>
- </div>
- </div>
- <div class="option-wrap" style="display: none;">
- <span class="option-name">得分率范围:</span>
- <div class="option-con">
- <div>
- <select name="scoring-rate" class="scoring-rate">
- <option value="C" selected>50%以下</option>
- <option value="B" selected>50%-70%</option>
- <option value="A">70%以上</option>
- </select>
- <span class="color-red">(注:得分率设置仅适用于无考试数据班级,有数据者,以系统统计数据为准)</span>
- </div>
- <div class="option-con-class" id="optionClass">
- </div>
- </div>
- </div>
- <div class="option-wrap">
- <span class="option-name"><span class="color-red">*</span>高考类型:</span>
- <div class="option-con">
- <span><input type="radio" name="exam-type" class="exam-type" value="1" <?php echo $type==1?'checked':'' ?>>新高考</span>
- <span><input type="radio" name="exam-type" class="exam-type" value="2" <?php echo $type==0?'checked':'' ?>>老高考</span>
- </div>
- </div>
- <!-- 新高考开始-->
- <div class="option-wrap layered-training layered-training-new-exam" style="display:<?php echo $type==1?'':'none' ?>">
- <!-- mhk -->
- <span class="option-name"><span class="color-red">*</span>分层训练:</span>
- <div class="option-con">
- <div class="item">
- <div class="describe">
- <span>听力</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="hearing" min="0" max="1" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>1){value=1}"></span>
- <span class="prompt">(题数限制为0-1)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe">
- <span>阅读理解</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="reading-comprehension" min="0" max="8" type="number" value="4" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>8){value=8}"></span>
- <span class="prompt">(题数限制为0-8)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe">
- <span>七选五</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="seven-choose-five" min="0" max="3" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>3){value=3}"></span>
- <span class="prompt">(题数限制为0-3)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe completion-fill-in-describe">
- <span>完形填空(15小题)</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="completion-fill-in" min="0" max="3" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>3){value=3}"></span>
- <span class="prompt">(题数限制为0-3)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe">
- <span>语法填空</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="grammatical-fill-in" min="0" max="5" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>5){value=5}"></span>
- <span class="prompt">(题数限制为0-5)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe practical-writing-describe">
- <span>应用文(80词)</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="practical-writing" min="0" max="1" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>1){value=1}"></span>
- <span class="prompt">(题数限制为0-1)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe">
- <span>读后续写</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="reading-prior-written" min="0" max="1" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>1){value=1}"></span>
- <span class="prompt">(题数限制为0-1)</span>
- </div>
- </div>
- <div class="item">
- <span class=" color-red">*数量限制:分层训练题数不少于3个</span>
- </div>
- </div>
- </div>
- <!-- 新高考结束-->
- <!-- 老高考开始-->
- <div class="option-wrap layered-training layered-training-old-exam" style="display:<?php echo $type==0?'':'none' ?>">
- <!-- mhk -->
- <span class="option-name"><span class="color-red">*</span>分层训练:</span>
- <div class="option-con">
- <div class="item">
- <div class="describe">
- <span>听力</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="hearing" min="0" max="1" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>1){value=1}"></span>
- <span class="prompt">(题数限制为0-1)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe">
- <span>阅读理解</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="reading-comprehension" min="0" max="8" type="number" value="4" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>8){value=8}"></span>
- <span class="prompt">(题数限制为0-8)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe">
- <span>七选五</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="seven-choose-five" min="0" max="3" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>3){value=3}"></span>
- <span class="prompt">(题数限制为0-3)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe completion-fill-in-describe">
- <span>完形填空(20小题)</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="completion-fill-in" min="0" max="3" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>3){value=3}"></span>
- <span class="prompt">(题数限制为0-3)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe">
- <span>语法填空</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="grammatical-fill-in" min="0" max="5" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>5){value=5}"></span>
- <span class="prompt">(题数限制为0-5)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe">
- <span>短文改错</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="passages-change-wrong" min="0" max="5" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>5){value=5}"></span>
- <span class="prompt">(题数限制为0-5)</span>
- </div>
- </div>
- <div class="item">
- <div class="describe practical-writing-describe">
- <span>应用文(100词)</span>
- </div>
- <div style="" class="number">
- <span><input style="" class="practical-writing" min="0" max="1" type="number" value="1" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=0} if(value>1){value=1}"></span>
- <span class="prompt">(题数限制为0-1)</span>
- </div>
- </div>
- <div class="item">
- <span class=" color-red">*数量限制:分层训练题数不少于3个</span>
- </div>
- </div>
- </div>
- <!-- 老高考结束-->
- <div class="option-wrap">
- <span class="option-name"><span class="color-red">*</span>下载方式:</span>
- <div class="option-con">
- <span><input type="radio" name="is-answer-merge" value="0" checked="checked">合并题目和答案</span>
- <span><input type="radio" name="is-answer-merge" value="1" >分离题目和答案</span>
- </div>
- </div>
- <span class="btn-start" id="confirm" active="true" style="margin-left: 10px;">开始生成</span>
- </div>
- </div>
- <script src="/js/jquery.ajaxfileupload.js"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- var productType=<?php echo $productType; ?>;
- getClassByGrade(1);
- // 选择年级
- $(".select-grade").change(function() {
- console.log($(this).val())
- });
- // 单选按钮
- $("input[name='option-class']").change(function() {
- getsClassSelected();
- });
- function getsClassSelected() {
- optionData.class=[];
- var selectedData = $("input[name='option-class']:checked"); //获取所以选中学生
- for (var i = 0; i < selectedData.length; i++) {
- code = $(selectedData[i]).val();
- optionData.class.push(code);
- }
- };
- $('.select-grade').change(function(){
- var grade = $(this).val();
- getClassByGrade(grade);
- });
- $("body").delegate("#confirm[active='true']", "click", function() {
- var This = $(this);
- This.attr("active","false");
- var error = [];
- var selectClassIds = [];
- var grade = parseInt(parseInt($('.select-grade').val()));
- var scoringRate=$('.scoring-rate').val();
- var examType = parseInt($("input[name='exam-type']:checked").val());
- var isAnswerMerge =parseInt($("input[name='is-answer-merge']:checked").val());
- $('#optionClass input:checked').each(function(k,v){
- if($(this).attr("status") == 0){
- selectClassIds.push($(this).val());
- }
- });
- if(selectClassIds.length == 0){
- error.push("请选择班级");
- }
- if(grade <= 0 || !grade){
- error.push("请选择年级");
- }
- var hearing=readingComprehension=sevenChooseFive=completionFillIn=grammaticalFillIn=practicalWriting=readingPriorWritten=passagesChangeWrong=0;
- if(examType==1) {
- hearing = $('.layered-training-new-exam .hearing').val();//听力
- readingComprehension = $('.layered-training-new-exam .reading-comprehension').val();//阅读理解
- sevenChooseFive = $('.layered-training-new-exam .seven-choose-five').val();//七选五
- completionFillIn = $('.layered-training-new-exam .completion-fill-in').val();//完型填空(15小题)
- grammaticalFillIn = $('.layered-training-new-exam .grammatical-fill-in').val();//语法填空
- practicalWriting = $('.layered-training-new-exam .practical-writing').val();//应用文(80词) *
- readingPriorWritten = $('.layered-training-new-exam .reading-prior-written').val();//读后续写 *
- }else{
- hearing = $('.layered-training-old-exam .hearing').val();//听力
- readingComprehension = $('.layered-training-old-exam .reading-comprehension').val();//阅读理解
- sevenChooseFive = $('.layered-training-old-exam .seven-choose-five').val();//七选五
- completionFillIn = $('.layered-training-old-exam .completion-fill-in').val();//完型填空(15小题)
- grammaticalFillIn = $('.layered-training-old-exam .grammatical-fill-in').val();//语法填空
- passagesChangeWrong = $('.layered-training-old-exam .passages-change-wrong').val();//短文改错 *
- practicalWriting = $('.layered-training-old-exam .practical-writing').val();//应用文(100词) *
- }
- if (!isPositiveNumber(hearing) || parseInt(hearing)<0 || parseInt(hearing)>1) {
- error.push("听力数量范围在0-1的整数");
- }
- if (!isPositiveNumber(readingComprehension) || parseInt(readingComprehension)<0 || parseInt(readingComprehension)>8) {
- error.push("阅读理解数量范围在0-8的整数");
- }
- if (!isPositiveNumber(sevenChooseFive) || parseInt(sevenChooseFive)<0 || parseInt(sevenChooseFive)>3) {
- error.push("七选五数量范围在0-3的整数");
- }
- if (!isPositiveNumber(completionFillIn) || parseInt(completionFillIn)<0 || parseInt(completionFillIn)>3) {
- error.push("完型填空(15小题)数量范围在0-3的整数");
- }
- if (!isPositiveNumber(grammaticalFillIn) || parseInt(grammaticalFillIn)<0 || parseInt(grammaticalFillIn)>5) {
- error.push("语法填空数量范围在0-5的整数");
- }
- if(examType==1) {
- if (!isPositiveNumber(practicalWriting) || parseInt(practicalWriting) < 0 || parseInt(practicalWriting) > 1) {
- error.push("应用文(80词)数量范围在0-1的整数");
- }
- if (!isPositiveNumber(readingPriorWritten) || parseInt(readingPriorWritten)<0 || parseInt(readingPriorWritten)>1) {
- error.push("读后续写数量范围在0-1的整数");
- }
- }else{
- if (!isPositiveNumber(passagesChangeWrong) || parseInt(passagesChangeWrong)<0 || parseInt(passagesChangeWrong)>5) {
- error.push("短文改错数量范围在0-5的整数");
- }
- if (!isPositiveNumber(practicalWriting) || parseInt(practicalWriting) < 0 || parseInt(practicalWriting) > 1) {
- error.push("应用文(100词)数量范围在0-1的整数");
- }
- }
- var hearing=parseInt(hearing);
- var readingComprehension=parseInt(readingComprehension);
- var sevenChooseFive=parseInt(sevenChooseFive);
- var completionFillIn=parseInt(completionFillIn);
- var grammaticalFillIn =parseInt(grammaticalFillIn);
- var practicalWriting =parseInt(practicalWriting);
- var readingPriorWritten = parseInt(readingPriorWritten);
- var passagesChangeWrong = parseInt(passagesChangeWrong);
- if(examType==1) {
- var total = hearing + readingComprehension + sevenChooseFive + completionFillIn + grammaticalFillIn + practicalWriting + readingPriorWritten;
- }else{
- var total = hearing + readingComprehension + sevenChooseFive + completionFillIn + grammaticalFillIn + passagesChangeWrong + practicalWriting;
- }
- if(total<3){
- error.push("分层训练题数不少于3个");
- }
- var settingJson={};
- var layeredTraining={};
- layeredTraining.hearing=hearing;
- layeredTraining.readingComprehension=readingComprehension;
- layeredTraining.sevenChooseFive=sevenChooseFive;
- layeredTraining.completionFillIn=completionFillIn;
- layeredTraining.grammaticalFillIn=grammaticalFillIn;
- layeredTraining.practicalWriting=practicalWriting;
- if(examType==1) {
- layeredTraining.readingPriorWritten = readingPriorWritten;
- }else{
- layeredTraining.passagesChangeWrong = passagesChangeWrong;
- }
- settingJson.layeredTraining=layeredTraining;
- settingJson.isAnswerMerge=isAnswerMerge;
- settingJson.scoringRate=scoringRate;
- settingJson.examType=examType;
- if(error.length == 0){
- $.ajax({
- url: "<?php echo $this->createUrl('generalproduct/ajaxSaveSetting');?>",
- type: "POST",
- dataType: "json",
- data: {
- grade: grade,
- selectClassIds:selectClassIds,
- settingJson:JSON.stringify(settingJson),
- productType:productType
- },
- success: function (data) {
- if(data.status == 1){
- layer.msg('已发送到后台,预计24小时左右生成!', {
- time: 2000,
- });
- setTimeout(function(){window.location.href = "<?php echo Yii::app()->createUrl('generalproduct/index');?>";}, 2000);
- }else{
- if($.isArray(data.error)) {
- layer.msg(data.error.join('</br>'));
- }else{
- layer.msg(data.error);
- }
- This.attr("active","true");
- }
- }
- });
- }else{
- This.attr("active","true");
- layer.msg(error[0]);
- }
- });
- function isPositiveNumber(s){//是否为整数
- var reg = /^[0-9]\d*$/;
- return reg.test(s)
- }
- function getClassByGrade(grade){
- if(grade){
- $.ajax({
- url: "<?php echo $this->createUrl('generalproduct/ajaxGetClasses');?>",
- type: "POST",
- dataType: "json",
- data: {
- grade: grade,
- productType:productType
- },
- success: function (data) {
- var html = '';
- if(data && data.length > 0){
- for(var i in data){
- html +='<label>';
- if(data[i].status == 1){
- html += '<span title="该班级已达每周生成的最大次数"><img src="<?php echo $imgUrl;?>">'+data[i].class_name+'</span>';
- }else{
- html += '<input type="checkbox" name="option-class" value="'+data[i].class_id+'" status="0">'+data[i].class_name;
- }
- html +='</label>';
- }
- }
- $('#optionClass').html(html);
- }
- });
- }
- }
- $('.exam-type').click(function(){
- var examType=$(this).val();
- if(examType==1){
- $('.layered-training-new-exam .hearing').val(1);//听力
- $('.layered-training-new-exam .reading-comprehension').val(4);//阅读理解
- $('.layered-training-new-exam .seven-choose-five').val(1);//七选五
- $('.layered-training-new-exam .completion-fill-in').val(1);//完型填空(15小题)
- $('.layered-training-new-exam .grammatical-fill-in').val(1);//语法填空
- $('.layered-training-new-exam .practical-writing').val(1);//应用文(80词) *
- $('.layered-training-new-exam .reading-prior-written').val(1);//读后续写 *
- $('.layered-training-new-exam').show();
- $('.layered-training-old-exam').hide();
- }else{
- $('.layered-training-old-exam .hearing').val(1);//听力
- $('.layered-training-old-exam .reading-comprehension').val(4);//阅读理解
- $('.layered-training-old-exam .seven-choose-five').val(1);//七选五
- $('.layered-training-old-exam .completion-fill-in').val(1);//完型填空(15小题)
- $('.layered-training-old-exam .grammatical-fill-in').val(1);//语法填空
- $('.layered-training-old-exam .passages-change-wrong').val(1);//短文改错 *
- $('.layered-training-old-exam .practical-writing').val(1);//应用文(100词) *
- $('.layered-training-new-exam').hide();
- $('.layered-training-old-exam').show();
- }
- })
- });
- </script>
|