From cac35d0c74988111e9d08da4fad9f33cafda5388 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Wed, 21 Aug 2019 17:03:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/concerns/git_common.rb | 1 - app/controllers/concerns/git_helper.rb | 3 ++- app/views/exercises/_shixun_details.json.jbuilder | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/git_common.rb b/app/controllers/concerns/git_common.rb index cd21622aa..452204419 100644 --- a/app/controllers/concerns/git_common.rb +++ b/app/controllers/concerns/git_common.rb @@ -29,7 +29,6 @@ module GitCommon def file_content @content = git_fle_content @repo_path, @path - Rails.logger.info("##############_____@content.present?___________########################{@content.present?}") end # 版本库提交记录 diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb index eeb4671a4..9ec7d1166 100644 --- a/app/controllers/concerns/git_helper.rb +++ b/app/controllers/concerns/git_helper.rb @@ -34,7 +34,8 @@ module GitHelper rescue Exception => e Rails.logger.error(e.message) - raise Educoder::TipException.new("文档内容获取异常") + normal_status(-1,"文档内容获取异常") + # raise Educoder::TipException.new("文档内容获取异常") end end diff --git a/app/views/exercises/_shixun_details.json.jbuilder b/app/views/exercises/_shixun_details.json.jbuilder index 4a73a9bbb..b46243fe7 100644 --- a/app/views/exercises/_shixun_details.json.jbuilder +++ b/app/views/exercises/_shixun_details.json.jbuilder @@ -32,6 +32,7 @@ json.shixun_detail do if game.try(:lastest_code).blank? cha_path = challenge_path(shixun_challenge.challenge&.path) latest_code = git_fle_content(game.myshixun.repo_path,cha_path) + Rails.logger.info("#######_______latest_code______##########################{latest_code}") else latest_code = game.try(:lastest_code) end From 6caaea4a09d7928c2ac8de36dd0e821bb03487e0 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Wed, 21 Aug 2019 17:05:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=952?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/concerns/git_helper.rb | 2 +- app/views/exercises/_shixun_details.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb index 9ec7d1166..6a3765401 100644 --- a/app/controllers/concerns/git_helper.rb +++ b/app/controllers/concerns/git_helper.rb @@ -34,7 +34,7 @@ module GitHelper rescue Exception => e Rails.logger.error(e.message) - normal_status(-1,"文档内容获取异常") + Rails.logger.error("#####__________文档内容获取异常") # raise Educoder::TipException.new("文档内容获取异常") end end diff --git a/app/views/exercises/_shixun_details.json.jbuilder b/app/views/exercises/_shixun_details.json.jbuilder index b46243fe7..3625900d7 100644 --- a/app/views/exercises/_shixun_details.json.jbuilder +++ b/app/views/exercises/_shixun_details.json.jbuilder @@ -32,7 +32,7 @@ json.shixun_detail do if game.try(:lastest_code).blank? cha_path = challenge_path(shixun_challenge.challenge&.path) latest_code = git_fle_content(game.myshixun.repo_path,cha_path) - Rails.logger.info("#######_______latest_code______##########################{latest_code}") + Rails.logger.info("#######_______latest_code______##########################{latest_code.present?}") else latest_code = game.try(:lastest_code) end From 08a70546141ef614957f49f850eb2dc2d5150d92 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 21 Aug 2019 17:17:18 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=BE=E5=A0=82?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/settings.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/courses/settings.json.jbuilder b/app/views/courses/settings.json.jbuilder index 97083d5f9..376dc6f6d 100644 --- a/app/views/courses/settings.json.jbuilder +++ b/app/views/courses/settings.json.jbuilder @@ -9,6 +9,7 @@ json.start_date @course.start_date json.end_date @course.end_date json.is_public @course.is_public json.course_module_types @course.course_modules.where(hidden: 0).pluck(:module_type) +json.course_module_names @course.course_modules.where(hidden: 0).pluck(:module_name) json.authentication @course.authentication json.professional_certification @course.professional_certification json.subject_id @course.subject_id From 74a874f274b8a93585eb733ae46d53840d99e745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 21 Aug 2019 17:21:45 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.js | 28 +++++++--- .../src/modules/courses/new/Goldsubject.js | 54 +++++++++++-------- 2 files changed, 51 insertions(+), 31 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index ab3ebb02d..00eba8ea0 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -19,8 +19,8 @@ import Trialapplicationysl from './modules/login/Trialapplicationysl'; import Trialapplicationreview from './modules/user/Trialapplicationreview'; import Addcourses from "./modules/courses/coursesPublic/Addcourses"; import AccountProfile from "./modules/user/AccountProfile"; -import Trialapplication from './modules/login/Trialapplication' - +import Trialapplication from './modules/login/Trialapplication'; +import Certifiedprofessional from './modules/modals/Certifiedprofessional'; import NotFoundPage from './NotFoundPage' import Loading from './Loading' @@ -247,12 +247,24 @@ const Messagerouting= Loadable({ class App extends Component { constructor(props) { super(props) - // this.state = { - // isRenders:false, - // } + this.state = { + mydisplay:false + } } - + HideAddcoursestypess=(i)=>{ + console.log("调用了"); + this.setState({ + Addcoursestypes:false, + mydisplay:true, + occupation:i, + }) + }; + ModalCancelsy=()=>{ + this.setState({ + mydisplay:false, + }) + }; componentDidMount() { // force an update if the URL changes history.listen(() => { @@ -304,8 +316,8 @@ class App extends Component { - - {/**/} + this.HideAddcoursestypess(i)}/> + diff --git a/public/react/src/modules/courses/new/Goldsubject.js b/public/react/src/modules/courses/new/Goldsubject.js index 0fe39bcd1..bd427edf3 100644 --- a/public/react/src/modules/courses/new/Goldsubject.js +++ b/public/react/src/modules/courses/new/Goldsubject.js @@ -66,12 +66,12 @@ class Goldsubject extends Component { const { datatime } = this.state; var datatimes=""; - if(datatime!==undefined){ - datatimes=datatime; - datatimes=moment(datatimes, dateFormat).subtract(0, 'days');; - }else { - datatimes=datatime; - } + // if(datatime!==undefined){ + // datatimes=datatime; + datatimes=moment(datatime, dateFormat); + // }else { + // datatimes=datatime; + // } if (!startValue || !datatimes) { return false; } @@ -84,12 +84,12 @@ class Goldsubject extends Component { // console.log(moment(new Date(), dateFormat).add(2, 'days')); const { datatimetwo } = this.state; var startvalue=""; - if(datatimetwo!==undefined){ - startvalue=datatimetwo; - startvalue=moment(startvalue, dateFormat).add(1, 'days'); - }else { - startvalue=datatimetwo; - } + // if(datatimetwo!==undefined){ + // startvalue=datatimetwo; + startvalue=moment(datatimetwo, dateFormat); + // }else { + // startvalue=datatimetwo; + // } // console.log("结束时间"); // console.log(endValue); // console.log(startvalue); @@ -359,9 +359,12 @@ class Goldsubject extends Component { }); } else { + debugger + this.props.form.validateFields((err, values) => { console.log("错误信息信息信息2"); console.log(err); + console.log("xingxixingxi"); if (err) { return; } @@ -384,17 +387,22 @@ class Goldsubject extends Component { // console.log('Received values of form: ', values); let subjectid = this.props.match.params.subjectid; let url = "/courses.json"; - axios.post(url, { - subject_id:subjectid, //这是带过来的值 - name: values.classroom, - class_period: values.period, - credit: parseFloat(values.credit), - start_date:values.starttime, - end_date: values.endtime, - is_public: is_public, //这是也是带过来的值 - course_module_types: values.checkboxgroup, - school:values.school - } + var ysldatas={ + subject_id:subjectid, //这是带过来的值 + name: values.classroom, + class_period: values.period, + credit: parseFloat(values.credit), + start_date:values.starttime, + end_date: values.endtime, + is_public: is_public, //这是也是带过来的值 + course_module_types: values.checkboxgroup, + school:values.school + }; + console.log("提交的ysldatas数据"); + console.log(ysldatas); + console.log(JSON.stringify(ysldatas)); + axios.post(url, + ysldatas ).then((response) => { if (response.status === 200) { // this.goback