From f1d14d0d9ea4c14bbb1004b3c58902a82b8f2f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 16 Dec 2019 11:35:22 +0800 Subject: [PATCH 01/13] =?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 | 6 +++--- public/react/src/modules/courses/poll/PollNew.js | 15 +++++++++++++++ public/react/src/modules/tpm/NewHeader.js | 5 +++-- .../src/modules/tpm/newshixuns/Newshixuns.js | 4 ++-- .../shixunchild/Challenges/Challengesjupyter.js | 4 ++-- .../react/src/modules/user/usersInfo/InfosPath.js | 7 ++++++- 6 files changed, 31 insertions(+), 10 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index 7d83757aa..4694d57da 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -608,10 +608,10 @@ class App extends Component { } } /> - + {/*/>*/} diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 248434295..49c89c375 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -1579,6 +1579,9 @@ class PollNew extends Component { if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.setState({ + Newdisplay:true, + }) return; } } @@ -1589,10 +1592,16 @@ class PollNew extends Component { if(object.question.min_choices){ if(object.question.min_choices===0){ this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.setState({ + Newdisplay:true, + }) return; } }else { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.setState({ + Newdisplay:true, + }) return; } @@ -1605,10 +1614,16 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices===0){ this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.setState({ + Newdisplay:true, + }) return; } }else { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.setState({ + Newdisplay:true, + }) return; } diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index ff2f067e4..783972f75 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -1294,8 +1294,9 @@ submittojoinclass=(value)=>{
  • this.getUser("/courses/new")}>{this.props.user&&this.props.user.main_site===false?"新建课堂":"新建翻转课堂"}
  • :"" } {shixuntype===true?"":
  • this.getUser("/shixuns/new")}>新建实训项目
  • } - {this.props.Headertop===undefined?"": - pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?
  • this.getUser("/paths/new")} >新建实践课程
  • :"" + {this.props.user&&this.props.user.main_site===false?"":this.props.Headertop===undefined?"":
  • this.getUser("/paths/new")} >新建实践课程
  • } + {this.props.user&&this.props.user.main_site===true?"":this.props.Headertop===undefined?"": + pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?
  • this.getUser("/paths/new")} >新建实践课程
  • :"" } {this.props.user&&this.props.user.main_site===true?
  • this.getUser("/projects/new","projects")} target="_blank">新建开发项目
  • :""} diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index bf744abde..22497932b 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -117,12 +117,12 @@ class Newshixuns extends Component { // window.open("/shixuns/"+response.data.shixun_identifier+"/challenges"); } else { this.setState({ - loading: true + loading: false }) } }).catch((error) => { this.setState({ - loading: true + loading: false }) }) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 840891ff7..3bbc4bf8f 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -263,7 +263,7 @@ class Challengesjupyter extends Component { "" : ( - is_teacher===true||admin===true||business===true||mysidentity===true? + admin===true||business===true||mysidentity===true?

    任务详情

    @@ -306,7 +306,7 @@ class Challengesjupyter extends Component { } { - is_teacher===true||admin===true||business===true||mysidentity===true? + admin===true||business===true||mysidentity===true?
    { diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js index d9db6108d..7bb96e30c 100644 --- a/public/react/src/modules/user/usersInfo/InfosPath.js +++ b/public/react/src/modules/user/usersInfo/InfosPath.js @@ -168,6 +168,8 @@ class InfosPath extends Component{ ); + + // console.log(this.props.user&&this.props.user.main_site) return(
    @@ -327,7 +329,10 @@ class InfosPath extends Component{
    {/* 295 */} { - page == 1 && is_current && !category ? :"" + this.props.user&&this.props.user.main_site===true?page == 1 && is_current && !category ? :"":"" + } + { + this.props.user&&this.props.user.main_site===false?this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?page == 1 && is_current && !category ? :"":"":"" } { (!data || (data && data.subjects.length==0)) && category && From d7bfaf09683bccef4b6dd97d4653aa5636eec91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 11:38:58 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=97=AE=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/poll/PollNew.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 49c89c375..0c40f48c9 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -1449,7 +1449,6 @@ class PollNew extends Component { //object 单个数组数据 Deleteadddomthree = (indexo, object,bool) => { this.setState({ - Newdisplay:false, newoption: false, }) // console.log("deleteadddom 349") @@ -2029,6 +2028,9 @@ class PollNew extends Component { if (result !== undefined) { if (result.data.status === 0) { this.props.showNotification(`已完成`); + this.setState({ + Newdisplay:false, + }) thiss.thisinitializationdatanew(); // console.log("确认创建问题") // console.log(result) @@ -2104,6 +2106,9 @@ class PollNew extends Component { try { if (result.data.status === 0) { this.props.showNotification(`编辑题目成功`); + this.setState({ + Newdisplay:false, + }) thiss.thisinitializationdatanew(); } } catch (e) { From 07921e9d3397fc281c25606e68055f817cc337c1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 11:39:50 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E5=BC=80=E5=90=AFJupyter=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0myshixun=5Fidentifier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/jupyter_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/jupyter_service.rb b/app/services/jupyter_service.rb index 1bbad9390..0f5af6cb8 100644 --- a/app/services/jupyter_service.rb +++ b/app/services/jupyter_service.rb @@ -48,7 +48,7 @@ module JupyterService tpiID = myshixun.id mount = myshixun.shixun.data_sets.present? - params = {tpiID: tpiID, identifier: shixun.identifier, needMount: mount, + params = {tpiID: tpiID, identifier: shixun.identifier, myshixunIdentifier: myshixun.identifier, needMount: mount, :containers => "#{Base64.urlsafe_encode64(shixun_container_limit(shixun))}"} res = uri_post uri, params From 0ac5ff977622626d7fbf660d63a19ac1354e3366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 16 Dec 2019 11:39:53 +0800 Subject: [PATCH 04/13] =?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/tpm/TPMsettings/Shixuninformation.js | 3 --- public/react/src/modules/tpm/newshixuns/Newshixuns.js | 10 +++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js index f3ec8e300..71754fc87 100644 --- a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js +++ b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js @@ -704,9 +704,6 @@ class Shixuninformation extends Component { }) } }); - this.setState({ - loading: false - }) } Selectthestudent = (value) => { diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index 22497932b..cc537496a 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -97,6 +97,7 @@ class Newshixuns extends Component { }) const mdContnet = this.contentMdRef.current.getValue().trim(); this.props.form.validateFieldsAndScroll((err, values) => { + debugger if (!err) { console.log('Received values of form: ', values); @@ -125,13 +126,12 @@ class Newshixuns extends Component { loading: false }) }) - - + }else{ + this.setState({ + loading: false + }) } }); - this.setState({ - loading: false - }) }; Selectthestudent = (value) => { this.props.form.setFieldsValue({ From 1b822f25c97478215adea5b96f898d1171d49c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 12:00:47 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/poll/PollNew.js | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 0c40f48c9..248434295 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -1449,6 +1449,7 @@ class PollNew extends Component { //object 单个数组数据 Deleteadddomthree = (indexo, object,bool) => { this.setState({ + Newdisplay:false, newoption: false, }) // console.log("deleteadddom 349") @@ -1578,9 +1579,6 @@ class PollNew extends Component { if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); - this.setState({ - Newdisplay:true, - }) return; } } @@ -1591,16 +1589,10 @@ class PollNew extends Component { if(object.question.min_choices){ if(object.question.min_choices===0){ this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); - this.setState({ - Newdisplay:true, - }) return; } }else { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); - this.setState({ - Newdisplay:true, - }) return; } @@ -1613,16 +1605,10 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices===0){ this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); - this.setState({ - Newdisplay:true, - }) return; } }else { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); - this.setState({ - Newdisplay:true, - }) return; } @@ -2028,9 +2014,6 @@ class PollNew extends Component { if (result !== undefined) { if (result.data.status === 0) { this.props.showNotification(`已完成`); - this.setState({ - Newdisplay:false, - }) thiss.thisinitializationdatanew(); // console.log("确认创建问题") // console.log(result) @@ -2106,9 +2089,6 @@ class PollNew extends Component { try { if (result.data.status === 0) { this.props.showNotification(`编辑题目成功`); - this.setState({ - Newdisplay:false, - }) thiss.thisinitializationdatanew(); } } catch (e) { From a6428c0b532ba41ca6633fc9dfff11b4ceb03845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 14:41:11 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/poll/PollNew.js | 58 ++++++++++++++----- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 7384c7f6e..8740a9bbf 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -893,7 +893,6 @@ class PollNew extends Component { //保存并继续 //保存并继续,即提交本题的新建并继续创建一个相同的题(该新题处于编辑模式,题目和选项不要清空) Deleteadddomtwo = (indexo, object,bool) => { - debugger var thiss = this; @@ -1038,7 +1037,7 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.props.showNotification(`可选的最大限制不能小于最小限制`); return; } } @@ -1258,7 +1257,7 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.props.showNotification(`可选的最大限制不能小于最小限制`); return; } } @@ -1449,9 +1448,7 @@ class PollNew extends Component { // indexo 第几个数组 //object 单个数组数据 Deleteadddomthree = (indexo, object,bool) => { - this.setState({ - newoption: false, - }) + // console.log("deleteadddom 349") var thiss = this; let arr = this.state.adddom; @@ -1477,9 +1474,14 @@ class PollNew extends Component { } if (newarr[indexo].question.question_title === "") { this.props.showNotification('题目不能为空!'); + return + } + if (newarr[indexo].question.question_title.match(/^[ ]*$/)) { + this.props.showNotification('题目不能为空!'); return } + if (max > 0) { if (object.question.question_type === 1) { this.props.showNotification('选项内容不能为空!'); @@ -1579,7 +1581,7 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.props.showNotification(`可选的最大限制不能小于最小限制`); return; } } @@ -1790,7 +1792,7 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.props.showNotification(`可选的最大限制不能小于最小限制`); return; } } @@ -1867,7 +1869,6 @@ class PollNew extends Component { }; question = {"question": questiontwo}; //插入多选题 - if (uuk !== -1) { // console.log("修改") this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length); @@ -2016,10 +2017,11 @@ class PollNew extends Component { if (result !== undefined) { if (result.data.status === 0) { this.props.showNotification(`已完成`); - thiss.thisinitializationdatanew(); this.setState({ Newdisplay:false, + newoption: false, + }) // console.log("确认创建问题") // console.log(result) @@ -2032,11 +2034,24 @@ class PollNew extends Component { // // } } + }else{ + this.setState({ + Newdisplay:true, + newoption: false, + + }) } // } catch (e) { // // } + }).catch((error) => { + console.log(error) + this.setState({ + Newdisplay:true, + newoption: false, + + }) }) @@ -2096,11 +2111,24 @@ class PollNew extends Component { if (result.data.status === 0) { this.props.showNotification(`编辑题目成功`); thiss.thisinitializationdatanew(); + this.setState({ + Newdisplay:false, + newoption: false, + }) } } catch (e) { // console.log("调用了edittotheserver") - console.log(e) + this.setState({ + Newdisplay:true, + newoption: false, + }) } + }).catch((error) => { + console.log(error) + this.setState({ + Newdisplay:true, + newoption: false, + }) }) } @@ -2685,7 +2713,8 @@ class PollNew extends Component { // console.log("2301"); // console.log(newr); // window.history.pushState('','',newUrl+'?tab='+e); - window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`; + + // window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`; }) } else { @@ -2773,6 +2802,7 @@ class PollNew extends Component { height: '30px', lineHeight: '30px', }; + const hejiine=this.state.mysingles + this.state.mydoubles + this.state.mymainsint; // console.log(this.state.projects===undefined?"":this.state.projects.poll_questions) var displaymysave = (mysave === true) ? "" : "display:none;"; @@ -2942,7 +2972,7 @@ class PollNew extends Component { { - this.state.mysingles + this.state.mydoubles + this.state.mymainsint === 0 ? "" : + hejiine=== 0 ? "" :
    {this.state.mysingles === 0 ? "" : 合计 {this.state.mysingles === undefined ? "" : this.state.mydoubles === undefined ? "" : this.state.mymainsint === undefined ? "" : this.state.mysingles + this.state.mydoubles + this.state.mymainsint} + className="color-blue">{this.state.mysingles === undefined ? "" : this.state.mydoubles === undefined ? "" : this.state.mymainsint === undefined ? "" : hejiine}
    } From fbd1d015e1070331b1a6e7fee13dd37be0b47879 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 15:24:33 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E8=B7=B3=E5=85=B3=E9=BB=98=E8=AE=A4=E6=98=AF=E5=8B=BE=E9=80=89?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20191216071931_modify_task_pass_for_shixuns.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 db/migrate/20191216071931_modify_task_pass_for_shixuns.rb diff --git a/db/migrate/20191216071931_modify_task_pass_for_shixuns.rb b/db/migrate/20191216071931_modify_task_pass_for_shixuns.rb new file mode 100644 index 000000000..b1e4372ff --- /dev/null +++ b/db/migrate/20191216071931_modify_task_pass_for_shixuns.rb @@ -0,0 +1,5 @@ +class ModifyTaskPassForShixuns < ActiveRecord::Migration[5.2] + def change + change_column :shixuns, :task_pass, :boolean, :default => true + end +end From e70c09527351458b2265ca795ea51ac87e901ace Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 15:47:48 +0800 Subject: [PATCH 08/13] 1 --- app/controllers/shixuns_controller.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index f75dd7147..84ceacd26 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -400,13 +400,14 @@ class ShixunsController < ApplicationController @shixun.shixun_info.update_attributes(shixun_info_params) # 镜像变动 @shixun.shixun_mirror_repositories.where.not(mirror_repository_id: old_mirror_ids).destroy_all - @shixun.shixun_mirror_repositories.create!(new_mirror_id) + @shixun.shixun_mirror_repositories.create!(new_mirror_id) if new_mirror_id.present? # 镜像变动要更换服务配置 @shixun.shixun_service_configs.where.not(mirror_repository_id: old_mirror_ids).destroy_all - @shixun.shixun_service_configs.create!(service_create_params) + @shixun.shixun_service_configs.create!(service_create_params) if service_create_params.present? service_update_params&.map do |service| smr = @shixun.shixun_service_configs.find_by(mirror_repository_id: service[:mirror_repository_id]) - smr.update_attributes(service) + logger.info("########smr: #{smr}") + smr.update_attributes(service) if smr.present? end # 添加第二仓库(管理员权限) if params[:is_secret_repository] From 562a1fd49a63ac1ec8d2738813e0e89332cd0d29 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 15:48:03 +0800 Subject: [PATCH 09/13] add log --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 84ceacd26..23537d480 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -407,7 +407,7 @@ class ShixunsController < ApplicationController service_update_params&.map do |service| smr = @shixun.shixun_service_configs.find_by(mirror_repository_id: service[:mirror_repository_id]) logger.info("########smr: #{smr}") - smr.update_attributes(service) if smr.present? + smr.update_attributes(service) end # 添加第二仓库(管理员权限) if params[:is_secret_repository] From e69b4b7a37b7a4cd8a0090f36cc4cc82e131359a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 15:57:30 +0800 Subject: [PATCH 10/13] mirrorname --- app/controllers/application_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bda4bcc6c..165b33989 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -467,7 +467,7 @@ class ApplicationController < ActionController::Base list = [] mirrors = MirrorRepository.select([:id, :type_name, :description]).published_main_mirror mirrors.try(:each) do |mirror| - list << {id: mirror.id, type_name: mirror.type_name, description: mirror.try(:description)} + list << {id: mirror.id, type_name: mirror.type_name, description: mirror.try(:description), mirror_name: mirror.name} end list end @@ -477,7 +477,7 @@ class ApplicationController < ActionController::Base list = [] mirrors = MirrorRepository.select([:id, :type_name, :description]).published_small_mirror mirrors.try(:each) do |mirror| - list << {id: mirror.id, type_name: mirror.type_name, description: mirror.description} + list << {id: mirror.id, type_name: mirror.type_name, description: mirror.description, mirror_name: mirror.name} end list end From 617e6f2b62c393096d7df105ac4a20e8b92c8389 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 16:00:05 +0800 Subject: [PATCH 11/13] fix bug --- app/controllers/application_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 165b33989..9630caaec 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -465,7 +465,7 @@ class ApplicationController < ActionController::Base # 实训主类别列表,自带描述 def shixun_main_type list = [] - mirrors = MirrorRepository.select([:id, :type_name, :description]).published_main_mirror + mirrors = MirrorRepository.select([:id, :type_name, :description, :name]).published_main_mirror mirrors.try(:each) do |mirror| list << {id: mirror.id, type_name: mirror.type_name, description: mirror.try(:description), mirror_name: mirror.name} end @@ -475,7 +475,7 @@ class ApplicationController < ActionController::Base # 小类别列表 def shixun_small_type list = [] - mirrors = MirrorRepository.select([:id, :type_name, :description]).published_small_mirror + mirrors = MirrorRepository.select([:id, :type_name, :description, :name]).published_small_mirror mirrors.try(:each) do |mirror| list << {id: mirror.id, type_name: mirror.type_name, description: mirror.description, mirror_name: mirror.name} end From eccca56a3ac077b9da3e792621b2d3cefa041794 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 16:08:26 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 23537d480..84ceacd26 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -407,7 +407,7 @@ class ShixunsController < ApplicationController service_update_params&.map do |service| smr = @shixun.shixun_service_configs.find_by(mirror_repository_id: service[:mirror_repository_id]) logger.info("########smr: #{smr}") - smr.update_attributes(service) + smr.update_attributes(service) if smr.present? end # 添加第二仓库(管理员权限) if params[:is_secret_repository] From de0836a3d5542cec2c8d698946b12c0ca5dafadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 18:05:59 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 265 +++++++++++++----- 1 file changed, 196 insertions(+), 69 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index ab75b6c89..435a9ca6e 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -46,6 +46,7 @@ const {Option} = Select; //作品列表(学生) let allow_lates=false; let answer_open_evaluation=false; +// Curcomlevel class Listofworksstudentone extends Component { //unifiedsetting 统一设置 //allowreplenishment 允许补交 @@ -269,7 +270,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '提交状态', + title: '作品状态', dataIndex: 'submitstate', key: 'submitstate', align: "center", @@ -277,15 +278,17 @@ class Listofworksstudentone extends Component { width: '98px', render: (text, record) => ( - {record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate} + } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center", width: '98px',} + : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px',} + : { + color: '#747A7F', + textAlign: "center", + width: '98px', + }}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate} ), @@ -310,14 +313,14 @@ class Listofworksstudentone extends Component { } }> {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time === "--" ? "--" : - {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} + } + >{record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} } @@ -340,7 +343,26 @@ class Listofworksstudentone extends Component { // ), // }, { - title: '完成情况', + title: '当前完成关卡', + dataIndex: 'curcomlevel', + key: 'curcomlevel', + align: "center", + className: 'font-14', + width: '99px', + render: (text, record) => ( + + {record.Curcomlevel + "/" + this.state.challenges_count} + + ), + }, + { + title: '截止前完成关卡', dataIndex: 'completion', key: 'completion', align: "center", @@ -359,7 +381,9 @@ class Listofworksstudentone extends Component { ), }, { - title: '关卡得分', + title:关卡得分 + 截止前学员完成的关卡才有成绩
    + }>
    , dataIndex: 'levelscore', key: 'levelscore', align: 'center', @@ -638,7 +662,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '提交状态', + title: '作品状态', dataIndex: 'submitstate', key: 'submitstate', align: "center", @@ -646,15 +670,17 @@ class Listofworksstudentone extends Component { width: '98px', render: (text, record) => ( - {record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate} + } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center", width: '98px',} + : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px',} + : { + color: '#747A7F', + textAlign: "center", + width: '98px', + }}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate} ), @@ -709,7 +735,26 @@ class Listofworksstudentone extends Component { // ), // }, { - title: '完成情况', + title: '当前完成关卡', + dataIndex: 'curcomlevel', + key: 'curcomlevel', + align: "center", + className: 'font-14', + width: '99px', + render: (text, record) => ( + + {record.Curcomlevel + "/" + this.state.challenges_count} + + ), + }, + { + title: '截止前完成关卡', dataIndex: 'completion', key: 'completion', align: "center", @@ -728,7 +773,9 @@ class Listofworksstudentone extends Component { ), }, { - title: '关卡得分', + title:关卡得分 + 截止前学员完成的关卡才有成绩
    + }>
    , dataIndex: 'levelscore', key: 'levelscore', align: 'center', @@ -967,19 +1014,21 @@ class Listofworksstudentone extends Component { ) }, { - title: '提交状态', + title: '作品状态', dataIndex: 'submitstate', key: 'submitstate', align: 'center', className: 'font-14', render: (text, record) => ( - {record.submitstate} + } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center"} + : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px'} + : { + color: '#747A7F', + textAlign: "center" + }}>{record.submitstate} ) @@ -1036,7 +1085,26 @@ class Listofworksstudentone extends Component { // ), // }, { - title: '完成情况', + title: '当前完成关卡', + dataIndex: 'curcomlevel', + key: 'curcomlevel', + align: "center", + className: 'font-14', + width: '99px', + render: (text, record) => ( + + {record.Curcomlevel + "/" + this.state.challenges_count} + + ), + }, + { + title: '截止前完成关卡', dataIndex: 'completion', key: 'completion', align: 'center', @@ -1051,7 +1119,9 @@ class Listofworksstudentone extends Component { ) }, { - title: '关卡得分', + title:关卡得分 + 截止前学员完成的关卡才有成绩
    + }>
    , dataIndex: 'levelscore', key: 'levelscore', align: 'center', @@ -1094,12 +1164,12 @@ class Listofworksstudentone extends Component { { record.efficiencyscore && record.efficiencyscore === "--" ? ( this.state.allow_late && this.state.allow_late === false ? - + -- : this.state.allow_late && this.state.allow_late === true ? - + -- : @@ -1315,19 +1385,21 @@ class Listofworksstudentone extends Component { ) }, { - title: '提交状态', + title: '作品状态', dataIndex: 'submitstate', key: 'submitstate', align: 'center', className: 'font-14', render: (text, record) => ( - {record.submitstate} + } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center"} + : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px'} + : { + color: '#747A7F', + textAlign: "center" + }}>{record.submitstate} ) @@ -1360,20 +1432,39 @@ class Listofworksstudentone extends Component { } }> {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time === "--" ? "--" : - {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} - + } + >{record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} + } ) }, { - title: '完成情况', + title: '当前完成关卡', + dataIndex: 'curcomlevel', + key: 'curcomlevel', + align: "center", + className: 'font-14', + width: '99px', + render: (text, record) => ( + + {record.Curcomlevel + "/" + this.state.challenges_count} + + ), + }, + { + title: '截止前完成关卡', dataIndex: 'completion', key: 'completion', align: 'center', @@ -1388,7 +1479,9 @@ class Listofworksstudentone extends Component { ) }, { - title: '关卡得分', + title:关卡得分 + 截止前学员完成的关卡才有成绩
    + }>
    , dataIndex: 'levelscore', key: 'levelscore', align: 'center', @@ -1431,12 +1524,12 @@ class Listofworksstudentone extends Component { { record.efficiencyscore && record.efficiencyscore === "--" ? ( this.state.allow_late && this.state.allow_late === false ? - + -- : this.state.allow_late && this.state.allow_late === true ? - + -- : @@ -1977,7 +2070,7 @@ class Listofworksstudentone extends Component { stduynumber: teacherdata.student_id, classroom: teacherdata.group_name, cost_time: teacherdata.cost_time, - submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时完成" : teacherdata.work_status === 2 ? "延时完成" : "未提交", + submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -1991,6 +2084,7 @@ class Listofworksstudentone extends Component { ultimate_score: teacherdata.ultimate_score, user_name: teacherdata.user_name, user_login: teacherdata.user_login, + Curcomlevel: teacherdata.current_complete_count===undefined||teacherdata.current_complete_count===null||teacherdata.current_complete_count===""?0:teacherdata.current_complete_count, }) // } @@ -2019,7 +2113,7 @@ class Listofworksstudentone extends Component { stduynumber: student_works[i].student_id, classroom: student_works[i].group_name, cost_time: student_works[i].cost_time, - submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时完成" : student_works[i].work_status === 2 ? "延时完成" : "未提交", + submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -2033,6 +2127,7 @@ class Listofworksstudentone extends Component { ultimate_score: student_works[i].ultimate_score, user_name: student_works[i].user_name, user_login: student_works[i].user_login, + Curcomlevel:student_works[i].current_complete_count===null||student_works[i].current_complete_count===null||student_works[i].current_complete_count===""?0:student_works[i].current_complete_count, }) } @@ -2178,7 +2273,7 @@ class Listofworksstudentone extends Component { stduynumber: teacherdata.student_id, classroom: teacherdata.group_name, cost_time: teacherdata.cost_time, - submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时完成" : teacherdata.work_status === 2 ? "延时完成" : "未提交", + submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -2192,6 +2287,8 @@ class Listofworksstudentone extends Component { ultimate_score: teacherdata.ultimate_score, user_name: teacherdata.user_name, user_login: teacherdata.user_login, + Curcomlevel: teacherdata.current_complete_count===null|| teacherdata.current_complete_count===undefined|| teacherdata.current_complete_count===""?0: teacherdata.current_complete_count, + }) // } @@ -2537,7 +2634,7 @@ class Listofworksstudentone extends Component { stduynumber: student_works[i].student_id, classroom: student_works[i].group_name, cost_time: student_works[i].cost_time, - submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时完成" : student_works[i].work_status === 2 ? "延时完成" : "未提交", + submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -2551,6 +2648,7 @@ class Listofworksstudentone extends Component { ultimate_score: student_works[i].ultimate_score, user_name: student_works[i].user_name, user_login: student_works[i].user_login, + Curcomlevel: student_works[i].current_complete_count===undefined||student_works[i].current_complete_count===null||student_works[i].current_complete_count===""?0:student_works[i].current_complete_count, }) } @@ -3356,13 +3454,42 @@ class Listofworksstudentone extends Component { } render() { - let {columns, course_groupysls, datajs, isAdmin, homework_status, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, game_list, columnsstu, columnsstu2, limit, experience, boolgalist, viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate, computeTimetype} = this.state; + let {columns,columnss, course_groupysls, datajs, isAdmin, homework_status, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, game_list, columnsstu, columnsstu2, limit, experience, boolgalist, viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate, computeTimetype} = this.state; const antIcon = ; let course_is_end = this.props.current_user && this.props.current_user.course_is_end; // console.log("Listofworksstudentone.js"); // console.log(orders); - + let homewrok=false; + if(homework_status && homework_status.length > 0){ + for(var i=0;i tr > th, .ant-table-tbody > tr > td { - padding: 9px; + padding: 0px; } `}
    @@ -3846,10 +3973,10 @@ class Listofworksstudentone extends Component { {teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" : {teacherdata.left_time.status} } - {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : - {teacherdata.left_time.time} - } + {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : + {teacherdata.left_time.time} + } @@ -3901,7 +4028,7 @@ class Listofworksstudentone extends Component { height: 58px; } .ysltableow .ant-table-thead > tr > th, .ant-table-tbody > tr > td { - padding: 9px; + padding: 0px; } `}
    @@ -4005,7 +4132,7 @@ class Listofworksstudentone extends Component { height: 58px; } .ysltableows .ant-table-thead > tr > th, .ant-table-tbody > tr > td { - padding: 9px; + padding: 0px; } ` } @@ -4043,9 +4170,9 @@ class Listofworksstudentone extends Component { {teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" : {teacherdata.left_time.status}} - {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : - {teacherdata.left_time.time}} + {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : + {teacherdata.left_time.time}}