From d75d507ab3cf1db86a99cf524b25d5b1d7f22478 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:10:23 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=80=97=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E5=87=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/tasks/shixuns.rake diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake new file mode 100644 index 000000000..f2cdddc52 --- /dev/null +++ b/lib/tasks/shixuns.rake @@ -0,0 +1,18 @@ +#coding=utf-8 + + +desc "纠正学生实训耗时不准的问题" + +namespace :shixuns do + task correct_the_shixun_cost_time: :environment do + puts "myshixun_id: #{ENV['myshixun_id']}" + if ENV['myshixun_id'].present? + myshixun = Myshixun.find(ENV['myshixun_id']) + myshixun.games.where(status: 2).each do |game| + cost_time = game.open_time.to_i - game.end_time.to_i + game.update_column(:cost_time, cost_time) + end + end + + end +end \ No newline at end of file From bdb9e7b1ad1349237f1e864799b432ea7d82a53f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:18:53 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake index f2cdddc52..bca3d6db6 100644 --- a/lib/tasks/shixuns.rake +++ b/lib/tasks/shixuns.rake @@ -9,7 +9,11 @@ namespace :shixuns do if ENV['myshixun_id'].present? myshixun = Myshixun.find(ENV['myshixun_id']) myshixun.games.where(status: 2).each do |game| + puts "open_time: #{game.open_time.to_i}" + puts "end_time: #{game.end_time.to_i}" + puts "game_id: #{game.id}" cost_time = game.open_time.to_i - game.end_time.to_i + puts "cost_time: #{cost_time}" game.update_column(:cost_time, cost_time) end end From be87a6ec2f683315e9cac19c0bacff1d803744dd Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:20:03 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E4=BF=AE=E6=AD=A3games=E7=9A=84=E8=80=97?= =?UTF-8?q?=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake index bca3d6db6..0249c98f1 100644 --- a/lib/tasks/shixuns.rake +++ b/lib/tasks/shixuns.rake @@ -9,11 +9,7 @@ namespace :shixuns do if ENV['myshixun_id'].present? myshixun = Myshixun.find(ENV['myshixun_id']) myshixun.games.where(status: 2).each do |game| - puts "open_time: #{game.open_time.to_i}" - puts "end_time: #{game.end_time.to_i}" - puts "game_id: #{game.id}" - cost_time = game.open_time.to_i - game.end_time.to_i - puts "cost_time: #{cost_time}" + cost_time = game.end_time.to_i - game.open_time.to_i game.update_column(:cost_time, cost_time) end end From 90c030926ae9f0e5aa57d3ca00e09162f391a66d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:21:20 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E8=80=97=E6=97=B6?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake index 0249c98f1..ce6d2b80d 100644 --- a/lib/tasks/shixuns.rake +++ b/lib/tasks/shixuns.rake @@ -9,7 +9,11 @@ namespace :shixuns do if ENV['myshixun_id'].present? myshixun = Myshixun.find(ENV['myshixun_id']) myshixun.games.where(status: 2).each do |game| + puts "open_time: #{game.open_time.to_i}" + puts "end_time: #{game.end_time.to_i}" + puts "game_id: #{game.id}" cost_time = game.end_time.to_i - game.open_time.to_i + puts "cost_time: #{cost_time}" game.update_column(:cost_time, cost_time) end end From 1e6381b256443c727ad480f984152fc94a98fc08 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:24:09 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake index ce6d2b80d..28795a099 100644 --- a/lib/tasks/shixuns.rake +++ b/lib/tasks/shixuns.rake @@ -14,7 +14,7 @@ namespace :shixuns do puts "game_id: #{game.id}" cost_time = game.end_time.to_i - game.open_time.to_i puts "cost_time: #{cost_time}" - game.update_column(:cost_time, cost_time) + game.update_column!(:cost_time, cost_time) end end From 257aa29880ef37cf5526a449c7cf79f4404c0226 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 14:25:11 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/shixuns.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/shixuns.rake b/lib/tasks/shixuns.rake index 28795a099..84f8afd34 100644 --- a/lib/tasks/shixuns.rake +++ b/lib/tasks/shixuns.rake @@ -14,7 +14,7 @@ namespace :shixuns do puts "game_id: #{game.id}" cost_time = game.end_time.to_i - game.open_time.to_i puts "cost_time: #{cost_time}" - game.update_column!(:cost_time, cost_time) + game.update_attributes!(cost_time: cost_time) end end From 4e325346985b11d89e5308e30508b0b0e5b3cae1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 6 Mar 2020 17:28:54 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E5=A4=9A=E8=BF=9B=E7=A8=8B=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/static_all.rake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tasks/static_all.rake b/lib/tasks/static_all.rake index 6deec5da1..2290f0dc5 100644 --- a/lib/tasks/static_all.rake +++ b/lib/tasks/static_all.rake @@ -3,8 +3,9 @@ desc "统计每个学校使用数据" namespace :static_all do task :repo => :environment do school_alls = School.includes(:courses, user_extensions: :user).all + proc_num = ENV['processes'].blank? ? 5 : ENV['processes'].to_i school_alls.find_in_batches(batch_size: 50) do |schools| - Parallel.each(schools, in_processes: 5) do |school| + Parallel.each(schools, in_processes: proc_num) do |school| puts("school_id: #{school.id}") data = Schools::SchoolStatisticService.new(school) sta_all = StaAll.find_or_initialize_by(school_id: school.id) From d6c003643fb4ca6b91ac27d2e0de1ac24b2d7f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Mar 2020 17:34:51 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/question/NewMyShixunModel.js | 63 +++++++++++++++---- public/react/src/modules/question/Question.js | 57 ++++++++++++++--- .../modules/question/component/Contentpart.js | 4 +- .../question/component/Contentquestionbank.js | 4 +- 4 files changed, 103 insertions(+), 25 deletions(-) diff --git a/public/react/src/modules/question/NewMyShixunModel.js b/public/react/src/modules/question/NewMyShixunModel.js index cce7be87d..4307c5ba2 100644 --- a/public/react/src/modules/question/NewMyShixunModel.js +++ b/public/react/src/modules/question/NewMyShixunModel.js @@ -729,7 +729,35 @@ class NewMyShixunModel extends Component { } - //选用 + + // 不选用 Question.js页面也有个 + NOgetitem_baskets=(data)=>{ + let url="/examination_banks/cancel_items.json"; + + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keyword: this.state.keywords, + page: this.state.page, + per_page:10, + exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdatasy(data); + this.getbasket_listdata(); + } + }).catch((error) => { + ////console.log(error); + }) + } + + //选用 Question.js页面也有个 getitem_baskets=(data)=>{ //选用题型可以上传单个 或者多个题型 let url=""; @@ -743,7 +771,6 @@ class NewMyShixunModel extends Component { axios.post(url, data) .then((result) => { if (result.data.status == 0) { - // this.props.showNotification(`选用成功`); var data = { discipline_id:this.state.discipline_id, sub_discipline_id:this.state.sub_discipline_id, @@ -758,9 +785,6 @@ class NewMyShixunModel extends Component { }; this.getdatasy(data); this.getbasket_listdata(); - // this.setState({ - // visible:true - // }) } }).catch((error) => { ////console.log(error); @@ -845,7 +869,7 @@ class NewMyShixunModel extends Component { } //全选试题库 - selectallquestionsonthispage=()=>{ + selectallquestionsonthispage=(bool)=>{ var item_idsdata=[]; var arr= this.state.Contentdata.items; @@ -853,6 +877,10 @@ class NewMyShixunModel extends Component { if(data.item_type==="PROGRAM"){ //编程题 if(data.choosed===true){ + if(data.program_attr.status===1){ + //已发布 + item_idsdata.push(data.id); + } }else{ //未选用 @@ -866,7 +894,7 @@ class NewMyShixunModel extends Component { }else{ //不是编程题 if(data.choosed===true){ - + item_idsdata.push(data.id); }else{ //未选用 item_idsdata.push(data.id); @@ -878,10 +906,21 @@ class NewMyShixunModel extends Component { item_ids:item_idsdata, exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), } - this.getitem_baskets(data); - this.setState({ - selectallquestionsonthispages:true, - }) + + + if(bool===false){ + this.getitem_baskets(data); + this.setState({ + selectallquestionsonthispages:true, + }) + }else{ + this.NOgetitem_baskets(data); + this.setState({ + selectallquestionsonthispages:false, + }) + } + + } //全选的状态 @@ -1040,7 +1079,7 @@ class NewMyShixunModel extends Component { chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexibool={(e)=>this.chakanjiexibool(e)} getitem_basketss={(id)=>this.getitem_basketss(id)} - selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} + selectallquestionsonthispage={(bool)=>this.selectallquestionsonthispage(bool)} getitem_baskets={(e)=>this.getitem_baskets(e)} setdatafuns={(e) => this.setdatafuns(e)} setdatafunsval={(e) => this.setdatafunsval(e)} diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index b48affa33..f4d859ed7 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -659,9 +659,37 @@ class Question extends Component { }) } + // 不选用 NewMyShixunModel.js 页面也有个 + NOgetitem_baskets=(data)=>{ + let url="/examination_banks/cancel_items.json"; + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + // this.props.showNotification(`选用成功`); + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keyword: this.state.keywords, + page: this.state.page, + per_page:10, + }; + this.getdatasy(data); + this.getbasket_listdata(); + // this.setState({ + // visible:true + // }) + } + }).catch((error) => { + ////console.log(error); + }) + } - //选用 + //选用 NewMyShixunModel.js 页面也有个 getitem_baskets=(data)=>{ //选用题型可以上传单个 或者多个题型 let url="/item_baskets.json"; @@ -738,7 +766,7 @@ class Question extends Component { } //全选试题库 - selectallquestionsonthispage=()=>{ + selectallquestionsonthispage=(bool)=>{ var item_idsdata=[]; var arr= this.state.Contentdata.items; @@ -746,7 +774,10 @@ class Question extends Component { if(data.item_type==="PROGRAM"){ //编程题 if(data.choosed===true){ - + if(data.program_attr.status===1){ + //已发布 + item_idsdata.push(data.id); + } }else{ //未选用 if(data.program_attr.status===1){ @@ -759,7 +790,7 @@ class Question extends Component { }else{ //不是编程题 if(data.choosed===true){ - + item_idsdata.push(data.id); }else{ //未选用 item_idsdata.push(data.id); @@ -770,10 +801,18 @@ class Question extends Component { const data={ item_ids:item_idsdata } - this.getitem_baskets(data); - this.setState({ - selectallquestionsonthispages:true, - }) + if(bool===false){ + this.getitem_baskets(data); + this.setState({ + selectallquestionsonthispages:true, + }) + }else{ + this.NOgetitem_baskets(data); + this.setState({ + selectallquestionsonthispages:false, + }) + } + } //全选的状态 @@ -1016,7 +1055,7 @@ class Question extends Component { chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexibool={(e)=>this.chakanjiexibool(e)} getitem_basketss={(id)=>this.getitem_basketss(id)} - selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} + selectallquestionsonthispage={(bool)=>this.selectallquestionsonthispage(bool)} getitem_baskets={(e)=>this.getitem_baskets(e)} setdatafuns={(e) => this.setdatafuns(e)} setdatafunsval={(e) => this.setdatafunsval(e)} diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 955a9d9b8..516e6be1f 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -440,12 +440,12 @@ class Contentpart extends Component {
{ defaultActiveKey===1||defaultActiveKey==="1"? - this.props.selectallquestionsonthispage()} > + this.props.selectallquestionsonthispage(bool)} > :"" } { defaultActiveKey===0||defaultActiveKey==="0"? - this.props.selectallquestionsonthispage()}> + this.props.selectallquestionsonthispage(bool)}> :"" }
diff --git a/public/react/src/modules/question/component/Contentquestionbank.js b/public/react/src/modules/question/component/Contentquestionbank.js index 79e8bbb88..e6a724fef 100644 --- a/public/react/src/modules/question/component/Contentquestionbank.js +++ b/public/react/src/modules/question/component/Contentquestionbank.js @@ -50,9 +50,9 @@ class Contentquestionbank extends Component {
{ selectionbools===true? - this.props.selectallquestionsonthispage()} disabled> + this.props.selectallquestionsonthispage(this.props.selectallquestionsonthispages)} > : - this.props.selectallquestionsonthispage()}> + this.props.selectallquestionsonthispage(this.props.selectallquestionsonthispages)}> }

选用本页全部试题

From 12aed5dbf7bc24a1216ca8961cd73b3599303c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Mar 2020 17:49:05 +0800 Subject: [PATCH 09/14] =?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/modules/question/questioncss/questioncom.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index 3fee3fc1e..f2aeacef4 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -913,7 +913,7 @@ width: 40px !important; position: absolute; border-radius: 4px; - top: -50%; + top: -95%; } .shitikussmys{ width:29px !important; From 60b141c5ca0ef341dd0bf21bf18ddd79612d15e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Mar 2020 18:02:53 +0800 Subject: [PATCH 10/14] =?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/modules/question/Question.js | 30 +++++++++---------- .../question/questioncss/questioncom.css | 8 ++++- public/react/src/modules/tpm/TPMIndex.css | 2 +- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index f4d859ed7..9613a4cc3 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -1086,7 +1086,7 @@ class Question extends Component { { ` .ant-drawer-content-wrapper{ - width: 200px !important; + width: 160px !important; overflow:hidden; margin-top: 62px; } @@ -1134,8 +1134,8 @@ class Question extends Component { "" :

单选题{'('}{single_questions_count}{')'}

-

单选题{'('}{single_questions_count}{')'}

+

this.showQuestionModals("SINGLE")}>

} @@ -1145,8 +1145,8 @@ class Question extends Component { :

多选题{'('}{multiple_questions_count}{')'}

-

多选题{'('}{multiple_questions_count}{')'}

+

this.showQuestionModals("MULTIPLE")}>

} @@ -1156,8 +1156,8 @@ class Question extends Component { :

判断题{'('}{judgement_questions_count}{')'}

-

判断题{'('}{judgement_questions_count}{')'}

+

this.showQuestionModals("JUDGMENT")}>

} @@ -1167,8 +1167,8 @@ class Question extends Component { :

填空题{'('}{completion_questions_count}{')'}

-

填空题{'('}{completion_questions_count}{')'}

+

this.showQuestionModals("COMPLETION")}>

} @@ -1178,8 +1178,8 @@ class Question extends Component { :

简答题{'('}{subjective_questions_count}{')'}

-

简答题{'('}{subjective_questions_count}{')'}

+

this.showQuestionModals("SUBJECTIVE")}>

} @@ -1189,8 +1189,8 @@ class Question extends Component { :

实训题{'('}{practical_questions_count}{')'}

-

实训题{'('}{practical_questions_count}{')'}

+

} @@ -1200,8 +1200,8 @@ class Question extends Component { :

编程题{'('}{program_questions_count}{')'}

-

编程题{'('}{program_questions_count}{')'}

+

this.showQuestionModals("PROGRAM")}>

} diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index f2aeacef4..096b30007 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -271,6 +271,12 @@ width:30%; } +.w80s{ + width:80%; +} +.w20s{ + width:20%; +} .w50s{ width: 50%; @@ -913,7 +919,7 @@ width: 40px !important; position: absolute; border-radius: 4px; - top: -95%; + top: -79%; } .shitikussmys{ width:29px !important; diff --git a/public/react/src/modules/tpm/TPMIndex.css b/public/react/src/modules/tpm/TPMIndex.css index 4f19260aa..2ec090e7d 100644 --- a/public/react/src/modules/tpm/TPMIndex.css +++ b/public/react/src/modules/tpm/TPMIndex.css @@ -268,7 +268,7 @@ body>.-task-title { background: #EEEEEE; } .mystask-sidebar{ - right: 220px !important; + right: 181px !important; } .mystask-sidebars{ right: 20px !important; From 8fb1e9c372f51170b6763b5f20ab4044191c9465 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Fri, 6 Mar 2020 18:17:42 +0800 Subject: [PATCH 11/14] issue --- .../courses/coursesDetail/CoursesLeftNav.js | 17 +++++++--------- .../courses/coursesPublic/Addcourses.js | 15 ++++++++++---- .../src/modules/courses/new/CoursesNew.js | 20 +++++++++---------- .../RepositoryAddFileupload_file.js | 19 ++++++++++++++---- 4 files changed, 43 insertions(+), 28 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 80c250134..999ae4e15 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -499,7 +499,6 @@ class Coursesleftnav extends Component{ } cannerNavmoda=()=>{ - this.setState({ Navmodalnametype:false, NavmodalValuetype:false, @@ -525,6 +524,7 @@ class Coursesleftnav extends Component{ } saveNavmodapost=(url,value,positiontype,coursesId)=>{ + axios.post(url, {name:value}).then((result)=>{ if(result!=undefined){ @@ -539,13 +539,13 @@ class Coursesleftnav extends Component{ if(positiontype==="files"){ this.updasaveNavmoda() trigger('updateNavSuccess') - window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`; + this.props.history.push(`/courses/${coursesId}/file/${result.data.category_id}`); } if(positiontype==="boards"){ this.updasaveNavmoda() trigger('updateNavSuccess') - window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`; + this.props.history.push(`/courses/${coursesId}/boards/${result.data.category_id}`); } if(positiontype!="course_groups"){ @@ -585,7 +585,6 @@ class Coursesleftnav extends Component{ } saveNavmoda=()=>{ - debugger; let {Navmodaltypename,setnavid,NavmodalValue}=this.state; let id =setnavid; @@ -950,17 +949,15 @@ class Coursesleftnav extends Component{ {/* ""*/} {/*}*/} - { - Navmodalnametype===true?:"" - } + { + debugger; let{Addcoursestype}=this.state; this.setState({ isSpin:true }) let {invite_code,professor,assistant_professor,student}=this.state; + invite_code="MBTAP"; if(invite_code===undefined||invite_code===""){ this.setState({ invite_codetype:true, @@ -269,13 +271,18 @@ class Addcourses extends Component{ this.props.history.push('/courses/2704/boards/8367/messages/42072') return; } - if(response.data.course_id!=undefined){ - this.submitasyn(response.data.course_id) - } notification.open({ message:"提示", description:response.data.message - }); + }); + if(response.data.course_id!=undefined){ + this.submitasyn(response.data.course_id) + }else{ + // 无返回课程id则是选择的教师或者助教身份,成功后跳转到课堂首页 + // console.log(this.props); + // console.log(this.props.history.push); + window.location.href="/courses"; + } if(Addcoursestype===true){ this.props.hideAddcoursestype(); } diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 873b1d9d7..e599bfa93 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -73,8 +73,8 @@ class CoursesNew extends Component { period: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period+"", credit: data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit+"", checkboxgroup: data.course_module_types, - Realnamecertification: data.authentication, - Professionalcertification:data.professional_certification, + // Realnamecertification: data.authentication, + // Professionalcertification:data.professional_certification, endtime: data.end_date === undefined ? "" : moment(data.end_date, dateFormat), school:data.school @@ -84,8 +84,8 @@ class CoursesNew extends Component { datatime: data.end_date, dataname:data.name, is_public: data.is_public === 1 ? true : false, - Realnamecertification: data.authentication, - Professionalcertification:data.professional_certification, + // Realnamecertification: data.authentication, + // Professionalcertification:data.professional_certification, addonAfteronelenone: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period, addonAfteronelentwo:data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit, @@ -237,8 +237,8 @@ class CoursesNew extends Component { end_date: datatime===undefined?"":datatime, is_public: is_public === true || is_public === 1 ? 1 : 0, course_module_types: values.checkboxgroup, - authentication: this.state.Realnamecertification, - professional_certification: this.state.Professionalcertification, + // authentication: this.state.Realnamecertification, + // professional_certification: this.state.Professionalcertification, school:values.school } ).then((response) => { @@ -313,8 +313,8 @@ class CoursesNew extends Component { end_date: datatime===undefined?"":datatime, is_public: is_public === true || is_public === 1 ? 1 : 0, course_module_types: values.checkboxgroup, - authentication: this.state.Realnamecertification, - professional_certification: this.state.Professionalcertification, + // authentication: this.state.Realnamecertification, + // professional_certification: this.state.Professionalcertification, school:values.school } ).then((response) => { @@ -953,7 +953,7 @@ class CoursesNew extends Component { )}
-
+ {/*
-
+
*/}
{ + if(info.response){ let shixunId = this.props.match.params.shixunId; let {message,filspath}=this.state; if(message===""||message===undefined){ @@ -105,13 +109,20 @@ class RepositoryAddFileupload_files extends Component { secret_repository:Repositoryflag }}) .then((response) => { - if (response.data.status == 0) { - this.props.showNotification("删除成功") + if (response.data.status === 0) { + let fileList = this.state.fileList.filter(item=>item.uid !== info.uid); + this.setState({ + fileList + }) + this.props.showNotification("删除成功"); } }) .catch(function (error) { console.log(error); }); + }else{ + this.props.showNotification("还未上传完成,无法进行删除操作!"); + } } FormInput=(e)=>{ @@ -195,7 +206,7 @@ class RepositoryAddFileupload_files extends Component { return false } - this.props.showNotification("上传成功") + // this.props.showNotification("上传成功"); }, }; From f614c99827291c79988081da2a76559b1edb46a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Mar 2020 19:38:26 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/testpaper/Intecomponents.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/public/react/src/modules/testpaper/Intecomponents.js b/public/react/src/modules/testpaper/Intecomponents.js index 8776b6a9e..ce5040821 100644 --- a/public/react/src/modules/testpaper/Intecomponents.js +++ b/public/react/src/modules/testpaper/Intecomponents.js @@ -282,6 +282,34 @@ class Intecomponents extends Component { } preservation = () => { + + let mylistcour=1; + try { + mylistcour=this.state.single_question_count+this.state.multiple_question_count+this.state.judgement_question_count+this.state.program_question_count + }catch (e) { + + } + if(mylistcour===0){ + this.props.showNotification(`没有题不能组卷`); + return; + } + + let arraycour=1; + try { + arraycour=this.Judquestio.Getdatas()[3].rbdxt+this.Judquestio.Getdatas()[4].rbdxtx+ this.Judquestio.Getdatas()[5].rbpdt+this.Judquestio.Getdatas()[6].rbbct + + }catch (e) { + + } + + if(arraycour===0){ + this.props.showNotification(`没有设置题型及数量不能组卷`); + return; + } + + + + if (this.Judquestio.Getdatas().length === 0) { this.scrollToAnchor("Itembankstopid"); return; From 9daef0475ff10ed7033a056bca504123b4da7690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Mar 2020 19:39:43 +0800 Subject: [PATCH 13/14] =?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/modules/tpm/NewHeader.js | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index dccdbc5a7..8d3c85378 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -1075,21 +1075,21 @@ submittojoinclass=(value)=>{ ` } - { - Periofters===true? -
  • - -
    -
    - 题库 -
    -
    -
    -
  • - :"" - } + {/*{*/} + {/* Periofters===true?*/} + {/*
  • */} + {/* */} + {/*
    */} + {/*
    */} + {/* 题库*/} + {/*
    */} + {/*
    */} + {/*
    */} + {/*
  • */} + {/* :""*/} + {/*}*/}
  • Date: Fri, 6 Mar 2020 20:04:35 +0800 Subject: [PATCH 14/14] issue --- .../react/src/modules/courses/boards/index.js | 10 ++-- .../courses/coursesPublic/Addcourses.js | 2 - .../RepositoryAddFileupload_file.js | 46 +++++++++---------- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/public/react/src/modules/courses/boards/index.js b/public/react/src/modules/courses/boards/index.js index ea49e862b..9c18313fe 100644 --- a/public/react/src/modules/courses/boards/index.js +++ b/public/react/src/modules/courses/boards/index.js @@ -98,12 +98,12 @@ class Boards extends Component{ this.fetchBoards() this.fetchAll() - on('updateNavSuccess', this.updateNavSuccess) + // on('updateNavSuccess', this.updateNavSuccess) } - componentWillUnmount() { - off('updateNavSuccess', this.updateNavSuccess) - } + // componentWillUnmount() { + // off('updateNavSuccess', this.updateNavSuccess) + // } updateNavSuccess = () => { this.fetchBoards() if (this.props.match.params.boardId == this.state.boardid) { @@ -112,7 +112,7 @@ class Boards extends Component{ } componentDidUpdate = (prevProps) => { - if ( prevProps.match.params.boardId != this.props.match.params.boardId ) { + if ( prevProps.match.params.boardId !== this.props.match.params.boardId ) { this.setState({ isSpin:true }) diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index ab26787ea..fb0a8a920 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -194,13 +194,11 @@ class Addcourses extends Component{ } submittojoinclass=()=>{ - debugger; let{Addcoursestype}=this.state; this.setState({ isSpin:true }) let {invite_code,professor,assistant_professor,student}=this.state; - invite_code="MBTAP"; if(invite_code===undefined||invite_code===""){ this.setState({ invite_codetype:true, diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js index 71161bb89..eb0557472 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js @@ -65,7 +65,6 @@ class RepositoryAddFileupload_files extends Component { fileList = fileList.map(file => { if (file.response) { if (file.response.status===0) { - } } return file; @@ -76,34 +75,35 @@ class RepositoryAddFileupload_files extends Component { }; onAttachmentRemove=(info)=>{ + console.log(info); if(info.response){ - let shixunId = this.props.match.params.shixunId; - let {message,filspath}=this.state; - if(message===""||message===undefined){ - this.props.showNotification('删除文件请先填写提交信息'); - return - } + let shixunId = this.props.match.params.shixunId; + let {message,filspath}=this.state; + if(message===""||message===undefined){ + this.props.showNotification('删除文件请先填写提交信息'); + return; + } - let matchpath =this.props.match.path; + let matchpath =this.props.match.path; - let Repositoryflag =undefined; + let Repositoryflag =undefined; - if( matchpath.indexOf("repository")>-1){ - Repositoryflag =undefined; - } - if(matchpath.indexOf("secret_repository")>-1){ - Repositoryflag =true; - } + if( matchpath.indexOf("repository")>-1){ + Repositoryflag =undefined; + } + if(matchpath.indexOf("secret_repository")>-1){ + Repositoryflag =true; + } - let newfilspath=filspath; + let newfilspath=filspath; - if(newfilspath===""){ - newfilspath=info.name - }else{ - newfilspath=filspath+"/"+info.name - } - const url = `/shixuns//${shixunId}/delete_git_file.json`; - axios.delete(url, { data: { + if(newfilspath===""){ + newfilspath=info.name + }else{ + newfilspath=filspath+"/"+info.name + } + const url = `/shixuns//${shixunId}/delete_git_file.json`; + axios.delete(url, { data: { path:newfilspath, message:message, secret_repository:Repositoryflag