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/54] =?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/54] =?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/54] =?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/54] =?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/54] =?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/54] =?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/54] =?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/54] =?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 {
选用本页全部试题
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/54] =?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/54] =?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")}>
多选题{'('}{multiple_questions_count}{')'}
-多选题{'('}{multiple_questions_count}{')'}
+this.showQuestionModals("MULTIPLE")}>
判断题{'('}{judgement_questions_count}{')'}
-判断题{'('}{judgement_questions_count}{')'}
+this.showQuestionModals("JUDGMENT")}>
填空题{'('}{completion_questions_count}{')'}
-填空题{'('}{completion_questions_count}{')'}
+this.showQuestionModals("COMPLETION")}>
简答题{'('}{subjective_questions_count}{')'}
-简答题{'('}{subjective_questions_count}{')'}
+this.showQuestionModals("SUBJECTIVE")}>
实训题{'('}{practical_questions_count}{')'}
-实训题{'('}{practical_questions_count}{')'}
+
编程题{'('}{program_questions_count}{')'}
-编程题{'('}{program_questions_count}{')'}
+this.showQuestionModals("PROGRAM")}>
编辑 diff --git a/public/react/src/modules/question/component/SiderBars.js b/public/react/src/modules/question/component/SiderBars.js index e6cee7761..724ae7f79 100644 --- a/public/react/src/modules/question/component/SiderBars.js +++ b/public/react/src/modules/question/component/SiderBars.js @@ -117,7 +117,7 @@ class SiderBars extends Component { {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?
人工组卷
智能组卷
-人工组卷
智能组卷
*/} + {/*人工组卷
*/} + {/*
编辑
From 91fc391b4b4048808002902f36726eeda61d48ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 7 Mar 2020 01:05:55 +0800
Subject: [PATCH 52/54] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js
index e3cb54781..0e2203de0 100644
--- a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js
+++ b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js
@@ -162,6 +162,8 @@ const AddTestDemo = (props) => {