Merge branch 'develop' into dev_aliyun

chromesetting
daiao 5 years ago
commit f92472bcde

@ -10,6 +10,7 @@ class SubjectsController < ApplicationController
include ApplicationHelper
include SubjectsHelper
include GitCommon
def index
@tech_system = current_laboratory.subject_repertoires
@ -219,6 +220,18 @@ 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)
# 创建长字段
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: '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)
end
end
end

@ -1289,7 +1289,7 @@ submittojoinclass=(value)=>{
}
{shixuntype===true?"":<li><a onClick={(url)=>this.getUser("/shixuns/new")}>新建实训项目</a></li>}
{this.props.Headertop===undefined?"":
pathstype===true?"":this.props.user&&this.props.user.main_site===true||this.props.user&&this.props.user.admin===true?<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>:""
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?<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>:""
}
{this.props.user&&this.props.user.main_site===true?<li><a onClick={(url)=>this.getUser("/projects/new","projects")} target="_blank">新建开发项目</a></li>:""}
</ul>

@ -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 })
}
}

@ -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,

@ -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"
// }

@ -380,31 +380,31 @@ class Challenges extends Component {
<p className="clearfix mb10 mt20">
<span className="font-16 fl">全部任务</span>
{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/new"}
className="white-btn edu-greenline-btn fr addshixuns"
// data-tip-down="新增代码编辑类型任务"
>
<Tooltip placement="bottom" title={"新增代码编辑类型任务"}>
<img src={getImageUrl("images/educoder/icon/addsmallgreen.svg")}
className="fl mr5 mt6" />
实践任务
</Tooltip>
</Link> : ""
}
{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/newquestion"}
className="white-btn edu-greenline-btn fr mr20 addshixuns"
// data-tip-down="新增选择题类型任务"
>
<Tooltip placement="bottom" title={"新增选择题类型任务"}>
<img src={getImageUrl("images/educoder/icon/addsmallgreen.svg")}
className="fl mr5 mt5" />
选择题任务
</Tooltip>
</Link> : ""
}
{/*{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?*/}
{/*<Link to={"/shixuns/" + id + "/challenges/new"}*/}
{/*className="white-btn edu-greenline-btn fr addshixuns"*/}
{/*// data-tip-down="新增代码编辑类型任务"*/}
{/*>*/}
{/*<Tooltip placement="bottom" title={"新增代码编辑类型任务"}>*/}
{/*<img src={getImageUrl("images/educoder/icon/addsmallgreen.svg")}*/}
{/*className="fl mr5 mt6" />*/}
{/*实践任务*/}
{/*</Tooltip>*/}
{/*</Link> : ""*/}
{/*}*/}
{/*{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?*/}
{/*<Link to={"/shixuns/" + id + "/challenges/newquestion"}*/}
{/*className="white-btn edu-greenline-btn fr mr20 addshixuns"*/}
{/*// data-tip-down="新增选择题类型任务"*/}
{/*>*/}
{/*<Tooltip placement="bottom" title={"新增选择题类型任务"}>*/}
{/*<img src={getImageUrl("images/educoder/icon/addsmallgreen.svg")}*/}
{/*className="fl mr5 mt5" />*/}
{/*选择题任务*/}
{/*</Tooltip>*/}
{/*</Link> : ""*/}
{/*}*/}
</p>
<div className="alltask">

Loading…
Cancel
Save