From 4ff06ce17e3f22af770e156ddfd8e9d49fc9a184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 28 Nov 2019 07:46:47 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=BC=80=E6=94=BE=E5=AE=9E=E8=B7=B5?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/NewHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 32051575b..d0b54671f 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -1289,7 +1289,7 @@ submittojoinclass=(value)=>{ } {shixuntype===true?"":
  • this.getUser("/shixuns/new")}>新建实训项目
  • } {this.props.Headertop===undefined?"": - pathstype===true?"":this.props.user&&this.props.user.main_site===true||this.props.user&&this.props.user.admin===true?
  • this.getUser("/paths/new")} >新建实践课程
  • :"" + 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">新建开发项目
  • :""} From 85dcab0a8886a1745817a318270f4ab8e61f37b7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 28 Nov 2019 08:06:14 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/subjects_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 917f3ad8e..26073d080 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -219,6 +219,13 @@ class SubjectsController < ApplicationController @shixun = Shixun.create!(name: params[:name], user_id: current_user.id, identifier: identifier) # 添加合作者 @shixun.shixun_members.create!(user_id: current_user.id, role: 1) + # 创建长字段 + @shixun.shixun_info.create!(description: "") + # 创建版本库 + repo_path = repo_namespace(current_user.login, identifier) + GitService.add_repository(repo_path: repo_path) + # todo: 为什么保存的时候要去除后面的.git呢?? + @shixun.update_column(:repo_name, repo_path.split(".")[0]) end end From 3aef2eeb53d8d75cf5590f9c735c7ec3ae0c64d7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 28 Nov 2019 08:07:37 +0800 Subject: [PATCH 3/8] 1 --- app/controllers/subjects_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 26073d080..d465179fd 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -10,6 +10,7 @@ class SubjectsController < ApplicationController include ApplicationHelper include SubjectsHelper + include GitCommon def index @tech_system = current_laboratory.subject_repertoires From d58809fbedcdbafcca0aea1ace96a65543d0c80a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 28 Nov 2019 08:10:49 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/subjects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index d465179fd..614f86dbb 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -221,7 +221,7 @@ class SubjectsController < ApplicationController # 添加合作者 @shixun.shixun_members.create!(user_id: current_user.id, role: 1) # 创建长字段 - @shixun.shixun_info.create!(description: "") + ShixunInfo.create!(shixun_id: @shixun.id) # 创建版本库 repo_path = repo_namespace(current_user.login, identifier) GitService.add_repository(repo_path: repo_path) From 6d58f839138bf4429f3402f2f2e98460c2a618af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 28 Nov 2019 08:24:08 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=93=E9=AA=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tpm/challengesnew/TPManswer2.js | 3 +- .../tpm/challengesnew/TPMchallengesnew.js | 5 +- .../tpm/challengesnew/TPMevaluation.js | 1 + .../tpm/shixunchild/Challenges/Challenges.js | 50 +++++++++---------- 4 files changed, 31 insertions(+), 28 deletions(-) diff --git a/public/react/src/modules/tpm/challengesnew/TPManswer2.js b/public/react/src/modules/tpm/challengesnew/TPManswer2.js index 6cbfcd081..ba38776cd 100644 --- a/public/react/src/modules/tpm/challengesnew/TPManswer2.js +++ b/public/react/src/modules/tpm/challengesnew/TPManswer2.js @@ -177,7 +177,8 @@ export default class TPManswer extends Component { this.props.showSnackbar(response.data.message); } if (response.data.status == 1) { - $("html").animate({ scrollTop: 0 }) + window.location.href=`/shixuns/${id}/challenges`; + // $("html").animate({ scrollTop: 0 }) } } diff --git a/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js b/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js index 9da0b79f5..f6bac13a5 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js +++ b/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js @@ -240,8 +240,8 @@ export default class TPMchallengesnew extends Component { }).then((response) => { if (response.data.status === 1) { // $("html").animate({ scrollTop: 0 }) - - window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/editcheckpoint`; + //window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/editcheckpoint?tab=2`; + window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/tab=2`; // this.setState({ // setopen: true, // CreatePracticesendtype:false, @@ -363,6 +363,7 @@ export default class TPMchallengesnew extends Component { }).then((response) => { this.props.showSnackbar(response.data.messages); if (response.data.status === 1) { + window.location.href=`/shixuns/${id}/challenges/${checkpointId}/tab=2`; this.setState({ setopen: true, editPracticesendtype:false, diff --git a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js index f29e9311e..c4e28a883 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js +++ b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js @@ -673,6 +673,7 @@ export default class TPMevaluation extends Component { } ).then((response) => { this.props.showSnackbar(response.data.messages); + window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/tab=3`; // if(response.data.status===1){ // window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3" // } diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js index 1470d45db..b6d70af87 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js @@ -380,31 +380,31 @@ class Challenges extends Component {

    全部任务 - {this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ? - - - - 实践任务 - - - : "" - } - {this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ? - - - - 选择题任务 - - : "" - } + {/*{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?*/} + {/**/} + {/**/} + {/**/} + {/*实践任务*/} + {/**/} + + {/* : ""*/} + {/*}*/} + {/*{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?*/} + {/**/} + {/**/} + {/**/} + {/*选择题任务*/} + {/**/} + {/* : ""*/} + {/*}*/}

    From 64981200442685824f8fcebf76de44cffe0113d9 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 28 Nov 2019 08:24:59 +0800 Subject: [PATCH 6/8] 1 --- app/controllers/subjects_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 614f86dbb..a846e6a45 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -221,12 +221,17 @@ class SubjectsController < ApplicationController # 添加合作者 @shixun.shixun_members.create!(user_id: current_user.id, role: 1) # 创建长字段 - ShixunInfo.create!(shixun_id: @shixun.id) + ShixunInfo.create!(shixun_id: @shixun.id, description: "请在此处添加实训描述") # 创建版本库 repo_path = repo_namespace(current_user.login, identifier) GitService.add_repository(repo_path: repo_path) # todo: 为什么保存的时候要去除后面的.git呢?? @shixun.update_column(:repo_name, repo_path.split(".")[0]) + mirror_id = MirrorRepository.find_by(type_name: 'Python').id + if mirror_id + ShixunMirrorRepository.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id) + @shixun.shixun_service_configs.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id) + end end end From c710690d4a65e97dd4df108ee0712e668101375e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 28 Nov 2019 08:31:23 +0800 Subject: [PATCH 7/8] Python3.6 --- app/controllers/subjects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index a846e6a45..02b8ed783 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -227,7 +227,7 @@ class SubjectsController < ApplicationController GitService.add_repository(repo_path: repo_path) # todo: 为什么保存的时候要去除后面的.git呢?? @shixun.update_column(:repo_name, repo_path.split(".")[0]) - mirror_id = MirrorRepository.find_by(type_name: 'Python').id + mirror_id = MirrorRepository.find_by(type_name: 'Python3.6').id if mirror_id ShixunMirrorRepository.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id) @shixun.shixun_service_configs.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id) From a8b2c8996a49eb73a86d9978f7fc96c3a75f1038 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 28 Nov 2019 08:32:04 +0800 Subject: [PATCH 8/8] 1 --- app/controllers/subjects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 02b8ed783..096a0fe52 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -227,7 +227,7 @@ class SubjectsController < ApplicationController GitService.add_repository(repo_path: repo_path) # todo: 为什么保存的时候要去除后面的.git呢?? @shixun.update_column(:repo_name, repo_path.split(".")[0]) - mirror_id = MirrorRepository.find_by(type_name: 'Python3.6').id + mirror_id = MirrorRepository.find_by(type_name: 'Python3.6')&.id if mirror_id ShixunMirrorRepository.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id) @shixun.shixun_service_configs.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)