123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748 |
- <?php
- /**
- * 产品设置.
- * User: chenye
- * Date: 2017/11/22
- * Time: 11:10
- */
- class SProductSetting extends MyActiveRecord {
- private $englishConfig_4=array(
- 'moduleName'=>'晨读词汇',
- 'moduleType'=>'english_4',
- 'setting'=>array(
- 'vocabularySelfTest' =>array( //词汇自测
- "coreVocabulary"=>array( //核心词汇开关
- "onOff" =>1,
- "vocabularyUse" =>1 //词汇运用
- ),
- "keyPhrases" =>1 //重点短语
- ),
- "focusOnGrammar" =>array(//语法聚焦
- "singleSentenceGrammar" =>1, //单句语法填空
- "grammaticalFillIn" =>1 //语法填空
- ),
- "writingTraining" =>array(//写作训练
- "commentsOnGoodSentences" =>1, // 佳句点拨
- "actualCombatDrill" =>1 //实战演练
- ),
- "extensiveReadingOfForeignJournals" =>array( //外刊泛读
- "accumulationOfNewWords" =>1, //新词积累
- "appreciationOfGoldenSentences" =>1, //金句赏析
- "fullTextTranslation" =>1, //全文翻译
- ),
- )
- );
- private $englishConfig_5=array(
- 'moduleName'=>'词汇宝',
- 'moduleType'=>'english_5',
- 'setting'=>array(
- 'isWhole' => 0,
- 'training' => array( //a-词汇集训
- 'wordReview' => 0, //词汇回顾
- 'wordExplain' => 1, // 词汇精讲
- 'practiceExact' => array( // 精准训练
- 'translate' => 1, //英汉互译
- 'wordApply' => 1, //词汇运用
- 'discourse' => 0, //语篇训练
- 'wordSpell' => 1, //单词拼写
- 'sentenceFill' => 1, //单句语法填空
- 'sentenceTranslate' => 0, //单句翻译
- ) //
- ),
- 'checkCard' => 1, //词汇集训检测卡
- 'wrongPractice' => 1, //错词再练
- 'wrongPracticeTimes' => 3, //第几次推送错词再练
- )
- );
-
- private $englishConfig_6=array(
- 'moduleName'=>'写作宝',
- 'moduleType'=>'english_6',
- 'setting'=>array(
- 'qcbdSwitch'=>1,//取长补短开关
- 'qcbd'=>array(//取长补短
- 'myEssay'=>1,//我的作文
- 'goodEssay'=>0//优秀范文
- ),
- 'ocr'=>1,//OCR图像识别结果
- 'wdfx'=>1,//维度分析
- 'py'=>1,//评语
- 'ajdp'=>1,//按句点评
- 'ldsmSwitch'=>1,//亮点说明开关
- 'ldsm'=>array(//亮点说明
- 'grld'=>1,//个人亮点
- 'bjld'=>1,//班级亮点
- ),
- 'cdtn'=>1,//错点提能
- 'lddyCount'=>10,//亮点短语
- 'ldjxCount'=>5//亮点句型
- )
- );
- public static function model($className = __CLASS__)
- {
- return parent::model($className);
- }
- public function tableName()
- {
- return 'product_setting';
- }
- /**
- * @return array|null
- * 获取所有默认设置数据
- */
- public function getDefaultPro(){
- $criteria = new CDbCriteria();
- $criteria->select = 'ps_id,product_type';
- $criteria->addCondition('is_default=1');
- $result = $this->findAll($criteria);
- if($result){
- $info = getAttributes($result);
- }else{
- $info = array();
- }
- return $info;
- }
- /**
- * @return array|null
- * 获取产品设置列表
- */
- public function getProductList($subjectId=3){
- $criteria = new CDbCriteria();
- $criteria->select = 'ps_id,name,product_type,is_default,subject_id,custom_config';
- $criteria->addCondition('subject_id='.$subjectId);
- $criteria->order = 'product_type,ps_id ASC';
- $result = getAttributes($this->findAll($criteria));
- return $result;
- }
- /**
- * @param int $id
- * @return static
- * 获取设置详情
- */
- public function getSetInfo($id=0,$subjectId=3){
- if($id>0 && $id!='NULL'){
- $result = $this->findByPk($id);
- }else{
- $criteria = new CDbCriteria();
- if($subjectId==8){
- $criteria->addCondition('product_type=6 AND is_default=1 AND subject_id='.$subjectId);
- }else{
- $criteria->addCondition('product_type=1 AND is_default=1 AND subject_id='.$subjectId);
- }
- $result = $this->find($criteria);
- }
- return $result;
- }
- /**
- * @param $type
- * @return array
- * 通过产品类型获取默认设置详情
- */
- public function getDefaultByType($type){
- $criteria = new CDbCriteria();
- $criteria->select = "product_type,ps_id";
- $criteria->addCondition("product_type={$type} AND is_default=1");
- $result = $this->find($criteria);
- return $result->getAttributes();
- }
- /**
- * @param $psType
- * @param $name
- * @return array
- * 添加新的产品
- */
- public function addNew($psType,$name,$subjectId=3){
- $criteria = new CDbCriteria();
- $criteria->select = 'ps_id';
- $criteria->addCondition("product_type={$psType} AND name='{$name}' AND subject_id='{$subjectId}'");
- $result = $this->find($criteria);
- if($result){
- //重名
- return array('status'=>0,'msg'=>"重名");
- }else{
- $criteria = new CDbCriteria();
- $criteria->addCondition("product_type={$psType} AND is_default=1");
- $oldResult = $this->find($criteria);
- $new = $oldResult->getAttributes();
- $ps = new SProductSetting();
- $ps->name = $name;
- $ps->product_type = $new['product_type'];
- $ps->show_map = $new['show_map'];
- $ps->show_kp = $new['show_kp'];
- $ps->show_top = $new['show_top'];
- $ps->show_wrg_origin = $new['show_wrg_origin'];
- $ps->show_wrg_analyze = $new['show_wrg_analyze'];
- $ps->show_guide = $new['show_guide'];
- $ps->st_tuozhan = $new['st_tuozhan'];
- $ps->st_wrong = $new['st_wrong'];
- $ps->st_reduce = $new['st_reduce'];
- $ps->show_level = $new['show_level'];
- $ps->create_time = time();
- $ps->is_default = 0;
- $ps->subject_id=$subjectId;
- $ps->custom_config=$new['custom_config'];
- $bool = $ps->save();
- if($bool){
- return array('status'=>1,'msg'=>$ps->primaryKey);
- }else{
- return array('status'=>0,'msg'=>"保存失败");
- }
- }
- }
- /**
- * @param $psType
- * @param $name
- * @return string
- * 重命名
- */
- public function rename($psType,$name){
- $ti = explode('_',$psType);
- $criteria = new CDbCriteria();
- $criteria->select = 'ps_id';
- $criteria->addCondition("product_type={$ti[0]} AND ps_id!={$ti[1]} AND name='{$name}'");
- $result = $this->find($criteria);
- if($result){
- //重名
- return '2';
- }else{
- //更新
- $bool = $this->updateByPk($ti[1],array('name'=>$name));
- if($bool!==false){
- return '1';
- }else{
- return '0';
- }
- }
- }
- /**
- * @return bool
- * 初始化预设产品设置
- */
- public function initProductSetting($subjectId=3,$custom=false,$provinceId=0){
- $criteria = new CDbCriteria();
- if($subjectId==8){
- $criteria->addCondition('product_type=4 AND is_default=1 AND subject_id='.$subjectId);
- }else{
- $criteria->addCondition('product_type=1 AND is_default=1 AND subject_id='.$subjectId);
- }
- $result = $this->find($criteria);
- if($result){
- return true;
- }
- //插入product_setting数据
- $productVer = $this->getPerVersion($subjectId,$custom,$provinceId);
- foreach($productVer as $key => $value){
- foreach($value as $k => $v){
- $valueStr = "('{$v['name']}',{$v['product_type']},{$v['show_map']},{$v['show_kp']},{$v['show_wrg_origin']},{$v['show_wrg_analyze']},{$v['show_guide']},'{$v['st_tuozhan']}','{$v['st_wrong']}','{$v['st_reduce']}',{$v['show_level']},{$v['create_time']},{$v['is_default']},{$subjectId},'{$v['custom_config']}')";
- $sql = "INSERT INTO `product_setting` (`name`,`product_type`,`show_map`,`show_kp`,`show_wrg_origin`,`show_wrg_analyze`,`show_guide`,`st_tuozhan`,`st_wrong`,`st_reduce`,`show_level`,`create_time`,`is_default`,`subject_id`,`custom_config`) VALUES ".$valueStr;
- $bool = $this->getDbConnection()->createCommand($sql)->execute();
- //$versionRelPsId[$key.'_'.$k] = (int)$this->getDbConnection()->getLastInsertID();
- }
- }
- return true;
- }
- //预设版本
- public function getPerVersion($subjectId=3,$custom=false,$provinceId=0){
- //1-错题本 2-个性化学习方案 3-个性化学习宝
- $time = time();
- $productVer = array(
- 1 => array(
- 0 => array(
- 'name' => '默认',
- 'product_type' => 1,//1-错题本 2-个性化学习方案 3-个性化学习宝
- 'show_map' => 1,//显示成长轨迹 1-是 0-否
- 'show_top' => 0, //显示 题组训练个性化学习宝 1-是 0-否
- 'show_kp' => 1,//显示薄弱知识点掌握分析 1-是 0-否
- 'show_wrg_origin' => 1,//显示错题原型 1-是 0-否
- 'show_wrg_analyze' => 1,//显示错因分析 1-是 0-否
- 'show_guide' => 1,//显示名师指导 1-是 0-否
- 'st_tuozhan' => '1|2|3|4',//拓展训练题使用的学生 1--尖子生 2--优秀生 3--中等生 4--学困生
- 'st_wrong' => '',//错题本过滤难题
- 'st_reduce' => '',//减少提分题
- 'show_level' => 0,//提分题分层 1-是 0-否
- 'create_time' => $time,//创建时间
- 'is_default' => 1,//是否默认设置 1-是 0-否
- 'top_kps' => '5|5',//知识点数量
- 'custom_config'=>'',
- )
- )
- );
- //英语模块默认配置
- $defaultSetting=array(
- 'moduleName'=>'晨读词汇',
- 'setting'=>array(
- 'lexicalClassification' =>1, //词汇分类
- 'exampleSentenceWriting' =>1, //例句填词
- 'associativeMemory' =>1, //联想记忆
- 'lexicalUse' =>1, //词汇运用
- 'grammaticalFocus' =>1, //语法聚焦
- 'extraCredit' =>1, //美文赏析
- 'vocabularyConsolidation' =>1, //语汇巩固
- 'grammaticalEnhancement' =>1, //语法强化
- 'discourseEnhancement' =>1, //语篇提升
- 'finishingBreakthrough' =>1, //完型突破
- 'achievementAnalysisAndGoalSetting' =>1, //成绩分析定目标
- 'analyzeAndFindTheCause' =>1, //分析错题找原因
- 'readingTrainingLevel' =>1, //阅读训练分等级
- 'writingInstructionSkills' =>1, //写作指导学技巧
- 'numberOfWrongQuestions' =>array( //错题数量
- //晨读词汇部分设置
- 'exampleSentenceWriting' =>10, //例句填词 5,10,15
- 'lexicalUse' =>array(
- 'wordSpelling' =>10, //单词拼写 5,10,15
- 'singleSentenceGrammar' =>10, //单句语法填空 5,10,15
- 'singleSentenceTranslation' =>10, //单句翻译
- 'singleChoice' =>10 //单项选择 5,10,15
- ),
- 'grammaticalFocus' =>array(
- 'singleChoice' =>10, //单项选择 5,10,15
- 'singleSentenceGrammar' =>10, //单句语法填空 5,10,15
- 'singleSentenceCorrection' =>10, //单句改错 5,10,15
- 'grammaticalFillIn' =>1, //语法填空1,2,3
- 'errorCorrection' =>1, //短文改错1,2,3
- ),
- 'extraCredit' =>1, //美文赏析1,2,3
- //阶段复习部分设置
- 'vocabularyConsolidation' =>array( //语汇巩固
- 'bankedCloze' =>10, //选词填空
- 'singleSentenceTranslation' =>10, //单句翻译
- ),
- 'grammaticalEnhancement' =>array(
- 'singleChoice' =>10, //单项选择 5,10,15
- 'singleSentenceCorrection' =>10, //单句改错 5,10,15
- 'grammaticalFillIn' =>1, //语法填空1,2,3
- 'errorCorrection' =>1, //短文改错1,2,3
- 'singleSentenceGrammar' =>10, //单句语法填空 5,10,15
- ),
- 'discourseEnhancement' =>array( //语篇提升
- 'readingComprehension' =>'1-1', //阅读理解 1配1,2配2
- ),
- 'finishingBreakthrough' =>array( //完型突破
- 'gestaltFilling' =>'1-1', //完形填空 1配1,2配2
- ),
- //考后复习部分设置
- 'readingTrainingLevel' =>array(
- 'readingComprehension' =>'1', //阅读理解 1配1,2配2
- 'taskBasedReading' =>1, //短文改错1,2,3==>任务型阅读
- 'sevenChooseFive' =>1, //七选五1,2,3
- 'gestaltFilling' =>'1', //完形填空 1配1,2配2
- ),
- )
- )
- );
- if($subjectId==3){
- $productVer[2]=array(
- 0 => array(
- 'name' => '默认',
- 'product_type' => 2,//1-错题本 2-个性化学习方案 3-个性化学习宝
- 'show_map' => 1,//显示成长轨迹 1-是 0-否
- 'show_top' => 1, //显示 题组训练个性化学习宝 1-是 0-否
- 'show_kp' => 1,//显示薄弱知识点掌握分析 1-是 0-否
- 'show_wrg_origin' => 0,//显示错题原型 1-是 0-否
- 'show_wrg_analyze' => 0,//显示错因分析 1-是 0-否
- 'show_guide' => 0,//显示名师指导 1-是 0-否
- 'st_tuozhan' => '3|4',//拓展训练题使用的学生 1--尖子生 2--优秀生 3--中等生 4--学困生
- 'st_wrong' => '',//错题本过滤难题
- 'st_reduce' => '',//减少提分题
- 'show_level' => 0,//提分题分层 1-是 0-否
- 'create_time' => $time,//创建时间
- 'is_default' => 1,//是否默认设置 1-是 0-否
- 'top_kps' => '5|5',//知识点数量
- 'custom_config'=>'',
- )
- );
- $productVer[3]=array(
- 0 => array(
- 'name' => '默认',
- 'product_type' => 3,//1-错题本 2-个性化学习方案 3-个性化学习宝
- 'show_map' => 1,//显示成长轨迹 1-是 0-否
- 'show_top' => 1, //显示 题组训练个性化学习宝 1-是 0-否
- 'show_kp' => 1,//显示薄弱知识点掌握分析 1-是 0-否
- 'show_wrg_origin' => 1,//显示错题原型 1-是 0-否
- 'show_wrg_analyze' => 1,//显示错因分析 1-是 0-否
- 'show_guide' => 1,//显示名师指导 1-是 0-否
- 'st_tuozhan' => '3|4',//拓展训练题使用的学生 1--尖子生 2--优秀生 3--中等生 4--学困生
- 'st_wrong' => '',//错题本过滤难题
- 'st_reduce' => '',//减少提分题
- 'show_level' => 0,//提分题分层 1-是 0-否
- 'create_time' => $time,//创建时间
- 'is_default' => 1,//是否默认设置 1-是 0-否
- 'top_kps' => '5|5',//知识点数量
- 'custom_config'=>'',
- )
- );
- }elseif($subjectId==8){
- //英语模块默认配置
- $defaultSetting=array(
- 'moduleName'=>'晨读词汇',
- 'moduleType'=>'english_1',
- 'setting'=>array(
- 'lexicalClassification' =>1, //词汇分类
- 'exampleSentenceWriting' =>1, //例句填词
- 'associativeMemory' =>1, //联想记忆
- 'lexicalUse' =>1, //词汇运用
- 'grammaticalFocus' =>1, //语法聚焦
- 'extraCredit' =>1, //美文赏析
- 'numberOfWrongQuestions' =>array( //错题数量
- )
- )
- );
- if($provinceId==11){
- $defaultSetting['setting']['numberOfWrongQuestions']['lexicalUse']['singleChoice']=10;
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalFocus']['singleChoice']=10;
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalFocus']['singleSentenceCorrection']=10;
- }elseif($provinceId==12){
- $defaultSetting['setting']['numberOfWrongQuestions']['lexicalUse']['wordSpelling']=10;
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalFocus']['singleSentenceGrammar']=10;
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalFocus']['singleSentenceCorrection']=10;
- }else{
- $defaultSetting['setting']['numberOfWrongQuestions']['lexicalUse']['wordSpelling']=10;
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalFocus']['grammaticalFillIn']=1;
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalFocus']['singleSentenceCorrection']=10;
- }
- $englishConfig=$defaultSetting;
- $productVer[2]=array(
- 0 => array(
- 'name' => '默认',
- 'product_type' => 4,//1-错题本 2-个性化学习方案 3-个性化学习宝 4-自定义模块
- 'show_map' => 0,//显示成长轨迹 1-是 0-否
- 'show_top' => 0, //显示 题组训练个性化学习宝 1-是 0-否
- 'show_kp' => 0,//显示薄弱知识点掌握分析 1-是 0-否
- 'show_wrg_origin' => 0,//显示错题原型 1-是 0-否
- 'show_wrg_analyze' => 0,//显示错因分析 1-是 0-否
- 'show_guide' => 0,//显示名师指导 1-是 0-否
- 'st_tuozhan' => '',//拓展训练题使用的学生 1--尖子生 2--优秀生 3--中等生 4--学困生
- 'st_wrong' => '',//错题本过滤难题
- 'st_reduce' => '',//减少提分题
- 'show_level' => 0,//提分题分层 1-是 0-否
- 'create_time' => $time,//创建时间
- 'is_default' => 1,//是否默认设置 1-是 0-否
- 'top_kps' => '',//知识点数量
- 'custom_config'=>json_encode($englishConfig)
- )
- );
- $defaultSetting=array(
- 'moduleName'=>'阶段复习',
- 'moduleType'=>'english_2',
- 'setting'=>array(
- 'vocabularyConsolidation' =>1, //语汇巩固
- 'grammaticalEnhancement' =>1, //语法强化
- 'discourseEnhancement' =>1, //语篇提升
- 'finishingBreakthrough' =>1, //完型突破
- 'numberOfWrongQuestions' =>array( //错题数量
- //阶段复习部分设置
- 'grammaticalEnhancement' =>array(
- ),
- 'vocabularyConsolidation'=>array(
- 'bankedCloze'=>10
- ),
- )
- )
- );
- if($provinceId==11){
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalEnhancement']['singleChoice']=10;
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalEnhancement']['singleSentenceCorrection']=10;
- }elseif($provinceId==12){
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalEnhancement']['singleSentenceGrammar']=10;
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalEnhancement']['singleSentenceCorrection']=10;
- }else{
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalEnhancement']['grammaticalFillIn']=1;
- $defaultSetting['setting']['numberOfWrongQuestions']['grammaticalEnhancement']['singleSentenceCorrection']=10;
- }
- $englishConfig=$defaultSetting;
- $productVer[3]=array(
- 0 => array(
- 'name' => '默认',
- 'product_type' => 5,//1-错题本 2-个性化学习方案 3-个性化学习宝 4-自定义模块
- 'show_map' => 0,//显示成长轨迹 1-是 0-否
- 'show_top' => 0, //显示 题组训练个性化学习宝 1-是 0-否
- 'show_kp' => 0,//显示薄弱知识点掌握分析 1-是 0-否
- 'show_wrg_origin' => 0,//显示错题原型 1-是 0-否
- 'show_wrg_analyze' => 0,//显示错因分析 1-是 0-否
- 'show_guide' => 0,//显示名师指导 1-是 0-否
- 'st_tuozhan' => '',//拓展训练题使用的学生 1--尖子生 2--优秀生 3--中等生 4--学困生
- 'st_wrong' => '',//错题本过滤难题
- 'st_reduce' => '',//减少提分题
- 'show_level' => 0,//提分题分层 1-是 0-否
- 'create_time' => $time,//创建时间
- 'is_default' => 1,//是否默认设置 1-是 0-否
- 'top_kps' => '',//知识点数量
- 'custom_config'=>json_encode($englishConfig)
- )
- );
- $englishConfig=array(
- 'moduleName'=>'个性化学习宝',
- 'moduleType'=>'english_3',
- 'setting'=>array(
- 'achSwitch'=>1,//成长轨迹开关
- 'achievementAnalysisAndGoalSetting' =>array(//成长轨迹
- 'basicInformation'=>1,//基本情况
- 'classRankTrendChart'=>1,//班级排名趋势图
- 'personAveScoreRate'=>1//个人与班级平均得分率对比图
- ),
- 'analyzeAndFindTheCause' =>1, //阶段小结
- 'topicScoreSwitch'=>1,//题型得分表开关
- 'topicTypeScore' =>array( //题型得分表
- 'questionTypeScore' =>1, //题型得分表
- 'analysisOfWrongQuestions' =>1 //错题分析
- ),
- 'personSwitch'=>1,//个性训练开关
- 'personalTraining' =>array( //个性训练
- 'readingLevelDescription' =>1, //阅读等级说明
- 'discourseSwitch'=>1,//语篇题开关
- 'discourseTitle'=>array(//语篇题
- 'errorAnalysis' =>1, //错因分析
- 'vocabularyAccumulation' =>1, //词汇积累
- 'syntacticAnalysis' =>1, //句法剖析
- 'variantTrainingSwitch'=>1,//变式训练开关
- 'variantTraining'=>array( //变式训练
- 'vocabularyApplication' =>1, //词汇运用'
- 'skillInspiration' =>1, //技巧点拨
- 'disVariantTraining' =>1, //变式训练
- ),
- ),
- 'grammaFillSwitch'=>1,//语法填空开关
- 'grammaFill'=>array( //语法填空
- 'errorAnalysis' =>1, //错因分析
- 'graVariantTraining' =>1, //变式训练
- ),
- 'writingGuidanceSwitch'=>1,//写作指导开关
- 'writingGuidance'=>array( //写作指导
- 'compositionSwitch'=>1,//作文展示开关
- 'compositionDisplay'=>array( //作文展示
- 'myComposition'=>1, //我的作文
- 'excellentComposition'=>1 //优秀作文
- ),
- 'intelligentDiagnosis' =>1, //智能诊断结果
- 'thinkingOfExamination' =>1, //审题思路
- 'standardModelText' =>1, //标准范文
- 'modelTextHighlights' =>1, //范文亮点
- 'writingTemplate' =>1, //写作模板
- ),
- ),
- 'variantTrainingOfCommonProblems' =>1, //共性问题变式训练
- 'printSeparately'=>1,//题目答案分开打印
- 'oldPaperAnswer'=>1,//原卷答案
- 'isMandatoryChangePage'=>1,//"共性问题变式训练"是否强制换页
- 'isStudentEditionContainAnswer'=>1,//答案中是否显示“共性问题变式训练”答案
- 'numberOfWrongQuestions' =>array( //错题数量
- //考后复习部分设置
- 'scoringTraining' =>array(
- 'readingComprehension' =>'1', //阅读理解 1配1,2配2
- 'taskBasedReading' =>1, //短文改错1,2,3==>任务型阅读
- 'sevenChooseFive' =>1, //七选五1,2,3
- 'gestaltFilling' =>'1', //完形填空 1配1,2配2
- 'grammaticalFillIn' =>'1', //语法填空
- 'vocabularyApplication' =>10, //词汇运用
- ),
- ),
- 'commonType'=>0,//共性问题变式训练题型
- 'productName'=>'英语个性化学习宝',//产品名称
- // 'teachingProgress'=>array(//教学进度
- // 'nodeIds'=>'4_4_7',
- // 'nodeStr'=>'新课标人教版_必修一_Unit 1 Friendship'
- // ),
- 'exCompositionScope'=>1,//优秀作文选择范围 1-本班 2-本次考试
- 'growthTrackExamCount'=>1,//成长轨迹(显示的最小考试场次)
- )
- );
- $productVer[4]=array(
- 0 => array(
- 'name' => '默认',
- 'product_type' => 6,//1-错题本 2-个性化学习方案 3-个性化学习宝 4-自定义模块
- 'show_map' => 0,//显示成长轨迹 1-是 0-否
- 'show_top' => 0, //显示 题组训练个性化学习宝 1-是 0-否
- 'show_kp' => 0,//显示薄弱知识点掌握分析 1-是 0-否
- 'show_wrg_origin' => 0,//显示错题原型 1-是 0-否
- 'show_wrg_analyze' => 0,//显示错因分析 1-是 0-否
- 'show_guide' => 0,//显示名师指导 1-是 0-否
- 'st_tuozhan' => '',//拓展训练题使用的学生 1--尖子生 2--优秀生 3--中等生 4--学困生
- 'st_wrong' => '',//错题本过滤难题
- 'st_reduce' => '',//减少提分题
- 'show_level' => 0,//提分题分层 1-是 0-否
- 'create_time' => $time,//创建时间
- 'is_default' => 1,//是否默认设置 1-是 0-否
- 'top_kps' => '',//知识点数量
- 'custom_config'=>json_encode($englishConfig)
- )
- );
- $englishConfig=$this->englishConfig_4;
- $productVer[5]=array(
- 0 => array(
- 'name' => '默认',
- 'product_type' => 7,//1-错题本 2-个性化学习方案 3-个性化学习宝 4-自定义模块,7晨读词汇
- 'show_map' => 0,//显示成长轨迹 1-是 0-否
- 'show_top' => 0, //显示 题组训练个性化学习宝 1-是 0-否
- 'show_kp' => 0,//显示薄弱知识点掌握分析 1-是 0-否
- 'show_wrg_origin' => 0,//显示错题原型 1-是 0-否
- 'show_wrg_analyze' => 0,//显示错因分析 1-是 0-否
- 'show_guide' => 0,//显示名师指导 1-是 0-否
- 'st_tuozhan' => '',//拓展训练题使用的学生 1--尖子生 2--优秀生 3--中等生 4--学困生
- 'st_wrong' => '',//错题本过滤难题
- 'st_reduce' => '',//减少提分题
- 'show_level' => 0,//提分题分层 1-是 0-否
- 'create_time' => $time,//创建时间
- 'is_default' => 1,//是否默认设置 1-是 0-否
- 'top_kps' => '',//知识点数量
- 'custom_config'=>json_encode($englishConfig)
- )
- );
- }
- return $productVer;
- }
- //新增默认晨读模块
- public function initEnglishCdch(){
- $englishConfig=$this->englishConfig_4;
- $time=time();
- $productVer[]=array(
- 0 => array(
- 'name' => '默认',
- 'product_type' => 7,//1-错题本 2-个性化学习方案 3-个性化学习宝 4-自定义模块,7晨读词汇
- 'show_map' => 0,//显示成长轨迹 1-是 0-否
- 'show_top' => 0, //显示 题组训练个性化学习宝 1-是 0-否
- 'show_kp' => 0,//显示薄弱知识点掌握分析 1-是 0-否
- 'show_wrg_origin' => 0,//显示错题原型 1-是 0-否
- 'show_wrg_analyze' => 0,//显示错因分析 1-是 0-否
- 'show_guide' => 0,//显示名师指导 1-是 0-否
- 'st_tuozhan' => '',//拓展训练题使用的学生 1--尖子生 2--优秀生 3--中等生 4--学困生
- 'st_wrong' => '',//错题本过滤难题
- 'st_reduce' => '',//减少提分题
- 'show_level' => 0,//提分题分层 1-是 0-否
- 'create_time' => $time,//创建时间
- 'is_default' => 1,//是否默认设置 1-是 0-否
- 'top_kps' => '',//知识点数量
- 'custom_config'=>json_encode($englishConfig)
- )
- );
- foreach($productVer as $key => $value){
- foreach($value as $k => $v){
- $valueStr = "('{$v['name']}',{$v['product_type']},{$v['show_map']},{$v['show_kp']},{$v['show_wrg_origin']},{$v['show_wrg_analyze']},{$v['show_guide']},'{$v['st_tuozhan']}','{$v['st_wrong']}','{$v['st_reduce']}',{$v['show_level']},{$v['create_time']},{$v['is_default']},8,'{$v['custom_config']}')";
- $sql = "INSERT INTO `product_setting` (`name`,`product_type`,`show_map`,`show_kp`,`show_wrg_origin`,`show_wrg_analyze`,`show_guide`,`st_tuozhan`,`st_wrong`,`st_reduce`,`show_level`,`create_time`,`is_default`,`subject_id`,`custom_config`) VALUES ".$valueStr;
- $this->getDbConnection()->createCommand($sql)->execute();
- }
- }
- return true;
- }
- //新增默认晨读模块
- public function initEnglishMagicWOrd(){
- $englishConfig=$this->englishConfig_5;
- $time=time();
- $productVer[]=array(
- 0 => array(
- 'name' => '默认',
- 'product_type' => 8,//1-错题本 2-个性化学习方案 3-个性化学习宝 4-自定义模块,7晨读词汇,8魔法词汇宝
- 'show_map' => 0,//显示成长轨迹 1-是 0-否
- 'show_top' => 0, //显示 题组训练个性化学习宝 1-是 0-否
- 'show_kp' => 0,//显示薄弱知识点掌握分析 1-是 0-否
- 'show_wrg_origin' => 0,//显示错题原型 1-是 0-否
- 'show_wrg_analyze' => 0,//显示错因分析 1-是 0-否
- 'show_guide' => 0,//显示名师指导 1-是 0-否
- 'st_tuozhan' => '',//拓展训练题使用的学生 1--尖子生 2--优秀生 3--中等生 4--学困生
- 'st_wrong' => '',//错题本过滤难题
- 'st_reduce' => '',//减少提分题
- 'show_level' => 0,//提分题分层 1-是 0-否
- 'create_time' => $time,//创建时间
- 'is_default' => 1,//是否默认设置 1-是 0-否
- 'top_kps' => '',//知识点数量
- 'custom_config'=>json_encode($englishConfig)
- )
- );
- foreach($productVer as $key => $value){
- foreach($value as $k => $v){
- $valueStr = "('{$v['name']}',{$v['product_type']},{$v['show_map']},{$v['show_kp']},{$v['show_wrg_origin']},{$v['show_wrg_analyze']},{$v['show_guide']},'{$v['st_tuozhan']}','{$v['st_wrong']}','{$v['st_reduce']}',{$v['show_level']},{$v['create_time']},{$v['is_default']},8,'{$v['custom_config']}')";
- $sql = "INSERT INTO `product_setting` (`name`,`product_type`,`show_map`,`show_kp`,`show_wrg_origin`,`show_wrg_analyze`,`show_guide`,`st_tuozhan`,`st_wrong`,`st_reduce`,`show_level`,`create_time`,`is_default`,`subject_id`,`custom_config`) VALUES ".$valueStr;
- $this->getDbConnection()->createCommand($sql)->execute();
- }
- }
- return true;
- }
-
- //新增默认写作宝
- public function initEnglishWriting(){
- $englishConfig=$this->englishConfig_6;
- $time=time();
- $productVer[]=array(
- 0 => array(
- 'name' => '默认',
- 'product_type' => 9,//1-错题本 2-个性化学习方案 3-个性化学习宝 4-自定义模块,7晨读词汇,8魔法词汇宝,9写作宝
- 'show_map' => 0,//显示成长轨迹 1-是 0-否
- 'show_top' => 0, //显示 题组训练个性化学习宝 1-是 0-否
- 'show_kp' => 0,//显示薄弱知识点掌握分析 1-是 0-否
- 'show_wrg_origin' => 0,//显示错题原型 1-是 0-否
- 'show_wrg_analyze' => 0,//显示错因分析 1-是 0-否
- 'show_guide' => 0,//显示名师指导 1-是 0-否
- 'st_tuozhan' => '',//拓展训练题使用的学生 1--尖子生 2--优秀生 3--中等生 4--学困生
- 'st_wrong' => '',//错题本过滤难题
- 'st_reduce' => '',//减少提分题
- 'show_level' => 0,//提分题分层 1-是 0-否
- 'create_time' => $time,//创建时间
- 'is_default' => 1,//是否默认设置 1-是 0-否
- 'top_kps' => '',//知识点数量
- 'custom_config'=>json_encode($englishConfig)
- )
- );
- foreach($productVer as $key => $value){
- foreach($value as $k => $v){
- $valueStr = "('{$v['name']}',{$v['product_type']},{$v['show_map']},{$v['show_kp']},{$v['show_wrg_origin']},{$v['show_wrg_analyze']},{$v['show_guide']},'{$v['st_tuozhan']}','{$v['st_wrong']}','{$v['st_reduce']}',{$v['show_level']},{$v['create_time']},{$v['is_default']},8,'{$v['custom_config']}')";
- $sql = "INSERT INTO `product_setting` (`name`,`product_type`,`show_map`,`show_kp`,`show_wrg_origin`,`show_wrg_analyze`,`show_guide`,`st_tuozhan`,`st_wrong`,`st_reduce`,`show_level`,`create_time`,`is_default`,`subject_id`,`custom_config`) VALUES ".$valueStr;
- $this->getDbConnection()->createCommand($sql)->execute();
- }
- }
- return true;
- }
- public function getCommonSetting($classId,$subjectId,$type){
- $sql = "select custom_config from product_class_relation pcr join product_setting ps on pcr.ps_id=ps.ps_id where pcr.class_id={$classId} and product_type={$type} and ps.subject_id = {$subjectId}";
- $res = $this->findBySql($sql);
- $check = 1;
- if ($res) {
- $config = json_decode($res->custom_config,true);
- $setting = $config['setting'];
- $check = isset($setting['variantTrainingOfCommonProblems']) ? $setting['variantTrainingOfCommonProblems'] : 1;
- }
- return $check;
- }
- }
|