hjm 5 years ago
commit d698d0785b

@ -354,7 +354,7 @@ class TPMBanner extends Component {
//开始实战按钮 //开始实战按钮
startshixunCombat=(id)=>{ startshixunCombat=(id)=>{
let {shixunsDetails} = this.props let {shixunsDetails} = this.props
if( shixunsDetails.status>1){ if( shixunsDetails.shixun_status>1){
this.setState({ this.setState({
startbtn:true, startbtn:true,
hidestartshixunsreplacevalue:"" hidestartshixunsreplacevalue:""
@ -463,11 +463,11 @@ class TPMBanner extends Component {
// //
// } // }
if(shixunsDetails!=undefined){ if(shixunsDetails!=undefined){
if (shixunsDetails.status === 0 ) { if (shixunsDetails.shixun_status === 0 ) {
challengeBtnText = '继续实战' challengeBtnText = '继续实战'
} else if (shixunsDetails.status === 1) { } else if (shixunsDetails.shixun_status === 1) {
challengeBtnText = '查看实战' challengeBtnText = '查看实战'
} else if (shixunsDetails.status === 3) { } else if (shixunsDetails.shixun_status === 3) {
challengeBtnText = '继续实战' challengeBtnText = '继续实战'
}else{ }else{
challengeBtnText = "开始实战" challengeBtnText = "开始实战"
@ -640,7 +640,7 @@ class TPMBanner extends Component {
className="fr user_default_btn task-btn-orange font-18" className="fr user_default_btn task-btn-orange font-18"
id="shixun_operation" data-remote="true" id="shixun_operation" data-remote="true"
> >
{shixunsDetails.task_operation === undefined ? "" : shixunsDetails.task_operation[0]} {shixunsDetails.task_operation === undefined ? "" : shixunsDetails.shixun_status > 1 ? shixunsDetails.task_operation[0] : "模拟实战"}
</a> </a>
</Tooltip> </Tooltip>
: "" : ""
@ -707,7 +707,7 @@ class TPMBanner extends Component {
{/*>{shixunsDetails.task_operation===undefined?"":shixunsDetails.task_operation[0]}</a>:""*/} {/*>{shixunsDetails.task_operation===undefined?"":shixunsDetails.task_operation[0]}</a>:""*/}
{/*}*/} {/*}*/}
{shixunsDetails.status === 0 && this.props.identity < 4 ? {shixunsDetails.shixun_status === 0 && this.props.identity < 4 ?
<a onClick={this.applyrelease} className="fr user_default_btn user_blue_btn mr20 font-18 height39" <a onClick={this.applyrelease} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
id="challenge_begin">申请发布</a> : "" id="challenge_begin">申请发布</a> : ""
} }
@ -772,7 +772,7 @@ class TPMBanner extends Component {
</Modal> </Modal>
{shixunsDetails.status === 1 && this.props.identity < 4 ? {shixunsDetails.shixun_status === 1 && this.props.identity < 4 ?
<a onClick={this.cancel_publish} className="fr user_default_btn user_blue_btn mr20 font-18 height39" <a onClick={this.cancel_publish} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
id="challenge_begin">撤销发布</a> : "" id="challenge_begin">撤销发布</a> : ""
} }
@ -781,7 +781,7 @@ class TPMBanner extends Component {
<a onClick={this.Senttothe} <a onClick={this.Senttothe}
className="fr user_default_btn user_blue_btn mr20 font-18" className="fr user_default_btn user_blue_btn mr20 font-18"
data-tip-down="" data-tip-down=""
style={{display: shixunsDetails.status === 0 || shixunsDetails.status === 3 ||shixunsDetails.status === 1 ? "none" : "block"}} style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 ||shixunsDetails.shixun_status === 1 ? "none" : "block"}}
data-remote="true"> data-remote="true">
<Tooltip placement="bottom" title={"以实训作业的形式发送到我的课堂"}> <Tooltip placement="bottom" title={"以实训作业的形式发送到我的课堂"}>
发送至 发送至
@ -847,7 +847,7 @@ class TPMBanner extends Component {
</div> </div>
</Modal> </Modal>
{shixunsDetails.status === 3 && {shixunsDetails.shixun_status === 3 &&
<a className="fr user_default_btn edu-greyback-btn mr15 font-18">已关闭</a> <a className="fr user_default_btn edu-greyback-btn mr15 font-18">已关闭</a>
} }
@ -918,7 +918,7 @@ class TPMBanner extends Component {
</div> </div>
<div className="alert alert-orange mb15 mt15 clearfix" <div className="alert alert-orange mb15 mt15 clearfix"
style={{display:shixunsDetails.status === 1?"block":"none"}} style={{display:shixunsDetails.shixun_status === 1?"block":"none"}}
>正在等待管理员的审核在审核通过前可以随时撤销发布</div> >正在等待管理员的审核在审核通过前可以随时撤销发布</div>
</div> </div>

@ -239,7 +239,7 @@ class Challenges extends Component {
<p className="clearfix mb30"> <p className="clearfix mb30">
<span className="font-16 fl">简介</span> <span className="font-16 fl">简介</span>
<a style={{ display: this.props.identity < 4 && this.props.status < 3 ? "block" : 'none' }} <a style={{ display: this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
href={"/shixuns/" + id + "/settings?edit=1"} className="ring-green fr" href={"/shixuns/" + id + "/settings?edit=1"} className="ring-green fr"
data-tip-down="编辑"> data-tip-down="编辑">
<img src={getImageUrl("images/educoder/icon/edit.svg")} className="fl mt3 ml2" /> <img src={getImageUrl("images/educoder/icon/edit.svg")} className="fl mt3 ml2" />
@ -249,7 +249,7 @@ class Challenges extends Component {
<div className="justify break_full_word new_li markdown-body" <div className="justify break_full_word new_li markdown-body"
id="challenge_editorMd_description"> id="challenge_editorMd_description">
<p id="ReactMarkdown" style={{overflow:'hidden'}}> <p id="ReactMarkdown" style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList.description===null?"": {ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
<div dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div> <div dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
} }
</p> </p>
@ -262,7 +262,7 @@ class Challenges extends Component {
<p className="clearfix mb10"> <p className="clearfix mb10">
<span className="font-16 fl">全部任务</span> <span className="font-16 fl">全部任务</span>
{this.props.identity < 4 && this.props.status === 0 ? {this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/new"} <Link to={"/shixuns/" + id + "/challenges/new"}
className="white-btn edu-greenline-btn fr" className="white-btn edu-greenline-btn fr"
// data-tip-down="新增代码编辑类型任务" // data-tip-down="新增代码编辑类型任务"
@ -275,7 +275,7 @@ class Challenges extends Component {
</Link> : "" </Link> : ""
} }
{this.props.identity < 4 && this.props.status === 0 ? {this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/newquestion"} <Link to={"/shixuns/" + id + "/challenges/newquestion"}
className="white-btn edu-greenline-btn fr mr20" className="white-btn edu-greenline-btn fr mr20"
// data-tip-down="新增选择题类型任务" // data-tip-down="新增选择题类型任务"
@ -359,7 +359,7 @@ class Challenges extends Component {
{item.delete_url != undefined && {item.delete_url != undefined &&
<Tooltip placement="bottom" title={"删除"}> <Tooltip placement="bottom" title={"删除"}>
<a onClick={() => this.delOperations(item.challenge_id)} <a onClick={() => this.delOperations(item.challenge_id)}
style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && this.props.status === 0 ? "block" : 'none' }} style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }}
className="fl ring-op-green mr25"> className="fl ring-op-green mr25">
<img src={getImageUrl("images/educoder/icon/close.svg")} <img src={getImageUrl("images/educoder/icon/close.svg")}
className="fl mt5 ml5" /> className="fl mt5 ml5" />
@ -371,7 +371,7 @@ class Challenges extends Component {
{item.up_url != undefined && {item.up_url != undefined &&
<Tooltip placement="bottom" title={"向上移动"}> <Tooltip placement="bottom" title={"向上移动"}>
<a onClick={operationstrue===true?"":() => this.operations(item.challenge_id, "up")} <a onClick={operationstrue===true?"":() => this.operations(item.challenge_id, "up")}
style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && this.props.status === 0 ? "block" : 'none' }} style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }}
className="fl ring-op-green mr25"> className="fl ring-op-green mr25">
<img src={getImageUrl("images/educoder/icon/moveup.svg")} <img src={getImageUrl("images/educoder/icon/moveup.svg")}
className="fl mt2 ml4" /> className="fl mt2 ml4" />
@ -381,7 +381,7 @@ class Challenges extends Component {
{item.down_url != undefined && {item.down_url != undefined &&
<Tooltip placement="bottom" title={"向下移动"}> <Tooltip placement="bottom" title={"向下移动"}>
<a onClick={operationstrue===true?"":() => this.operations(item.challenge_id, "down")} <a onClick={operationstrue===true?"":() => this.operations(item.challenge_id, "down")}
style={{ display: this.props.user.admin===true?"block":this.props.identity < 4 && this.props.status === 0 ? "block" : 'none' }} style={{ display: this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status=== 0 ? "block" : 'none' }}
className="fl ring-op-green mr25"> className="fl ring-op-green mr25">
<img src={getImageUrl("images/educoder/icon/movedown.svg")} className="fl mt2 ml4" /> <img src={getImageUrl("images/educoder/icon/movedown.svg")} className="fl mt2 ml4" />
</a> </a>
@ -393,7 +393,7 @@ class Challenges extends Component {
item.st === 1 ? item.st === 1 ?
<Tooltip placement="bottom" title={"编辑"}> <Tooltip placement="bottom" title={"编辑"}>
<a <a
style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && this.props.status < 3 ? "block" : 'none' }} style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status< 3 ? "block" : 'none' }}
href={"/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + item.challenge_id + "/editquestion"} href={"/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + item.challenge_id + "/editquestion"}
className="fl ring-green"> className="fl ring-green">
<img src={getImageUrl("images/educoder/icon/edit.svg")} <img src={getImageUrl("images/educoder/icon/edit.svg")}
@ -403,7 +403,7 @@ class Challenges extends Component {
: :
<Tooltip placement="bottom" title={"编辑"}> <Tooltip placement="bottom" title={"编辑"}>
<a <a
style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && this.props.status < 3 ? "block" : 'none' }} style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
href={"/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + item.challenge_id + "/editcheckpoint"} href={"/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + item.challenge_id + "/editcheckpoint"}
className="fl ring-green"> className="fl ring-green">
<img src={getImageUrl("images/educoder/icon/edit.svg")} <img src={getImageUrl("images/educoder/icon/edit.svg")}

Loading…
Cancel
Save