调整新版实训

chromesetting
杨树明 5 years ago
parent f142fcc335
commit ea9b5cbd04

@ -26,7 +26,7 @@ class TPMChallenge extends Component {
<React.Fragment>
<div className="educontent clearfix mt30 mb80">
<div className="with65 fl edu-back-white" >
<div className="with65 fl " >
<TPMNav
match={match}
user={user}

@ -12,7 +12,7 @@ import { getImageUrl ,markdownToHTML, configShareForCustom} from 'educoder'
import { CircularProgress } from 'material-ui/Progress';
import { Modal, Spin, Tooltip ,message,Icon} from 'antd';
import { Modal, Spin, Tooltip ,message,Icon,Button} from 'antd';
import 'antd/lib/pagination/style/index.css';
@ -325,89 +325,116 @@ class Challenges extends Component {
display: 'block'
}} /> :
<div className="mt30 pl20 pr20">
<p className="clearfix mb20">
{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>
<p className="clearfix mb20">
<span className="font-16 fl">简介</span>
<Tooltip placement="bottom" title={"编辑"}>
<a style={{ display: this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
href={"/shixuns/" + id + "/settings?edit=1"} className="ring-green fr">
<img src={getImageUrl("images/educoder/icon/edit.svg")} className="fl mt3 ml2" />
</a>
</Tooltip>
<div>
{/*<p className="clearfix mb20">*/}
{/* {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>*/}
<style>
{
`
.task-item{
margin-bottom: 20px;
padding-bottom: 20px;
margin-top: 10px;
}
`
}
</style>
<p className="clearfix mb20 edu-back-white">
<div className={"shixunjianjie"}>
<span className="font-16 fl">简介</span>
{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ?
<a href={"/shixuns/" + id + "/settings"} className="fr color-blue font-14">
{/*<img src={getImageUrl("images/educoder/icon/edit.svg")} className="fl mt3 ml2" />*/}
编辑
</a>:""}
{this.props.user && this.props.user.main_site === true ?
this.props.identity < 5?<a className="fr font-14 color-blue mr20" href="/forums/2943"
target="_blank">实训制作指南</a> : "":""}
</div>
<div className={"pd20"}>
<style>
{
`
.editormd-html-preview, .editormd-preview-container {
width: 100% !important;
}
`
}
</style>
<div className="justify break_full_word new_li "
id="challenge_editorMd_description">
<p id="ReactMarkdown" style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
}
</p>
</div>
</div>
</p>
<div className="justify break_full_word new_li "
id="challenge_editorMd_description">
<p id="ReactMarkdown" style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
<div className={"shixunjianjiecballenges edu-back-white"}>
<span className="font-16 fl">全部任务</span>
<span className="fr mt5">
{/* <img src={getImageUrl("images/educoder/icon/addsmallgreen.svg")}
className="fl mr5 mt6" />*/}
{/*<Tooltip placement="bottom" title={"新增代码编辑类型任务"}>*/}
{/* </Tooltip>*/}
{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/new"}
className="fr"
// data-tip-down="新增代码编辑类型任务"
>
<Button type="primary"
className="edu-default-btn edu-greenback-btn"
>新增实践任务</Button>
</Link> : ""
}
</p>
{/*
<span className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(question_title)}}
style={{ display: 'inline-block', width:'100%' , margin: '10px 0px 15px' }}></span>
*/}
{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/newquestion"}
className="fr mr20"
// data-tip-down="新增选择题类型任务"
>
<Button type="primary"
className="edu-default-btn edu-greenback-btn"
>新增选择题任务</Button>
</Link> : ""
}
{/*<Tooltip placement="bottom" title={"新增选择题类型任务"}>*/}
{/* </Tooltip>*/}
{/* <img src={getImageUrl("images/educoder/icon/addsmallgreen.svg")}
className="fl mr5 mt5" />*/}
</span>
</div>
<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> : ""*/}
{/*}*/}
</p>
<div className="alltask">
<div className="alltask edu-back-white padding1020pxshixun">
{ChallengesDataList === undefined ? <div className="alltask">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20"
@ -431,51 +458,60 @@ class Challenges extends Component {
</div>
</div>
: ChallengesDataList.challenge_list.map((item, key) => {
let newstatus = 2;
if(ChallengesDataList.challenge_list[key - 1]!=undefined){
newstatus=ChallengesDataList.challenge_list[key - 1].status;
}
return (
<div className="task-item" key={key} id={"shixun_index_" + item.position}>
<div className="clearfix mb5">
<div className="mr15 font-16 fl shixunstartbutton666666">{key+1}{item.st === 0 ?"实践题":"选择题"}
{/*<a className={"edu-default-btn edu-blueline-btn fr Finish_button mtf3"}*/}
{/* onClick={()=>this.startshixunCombat(false,undefined, item.challenge_id)}*/}
{/* // onClick={() => this.startshixunCombat(false)}*/}
{/* title={"查看挑战关卡"}*/}
{/*>已完成</a>*/}
{/*判断比较复杂 有排第一不能是灰色按钮*/}
{item.status === 2 ?
<Button type="primary" shape="round" size={"small"} className={"ml30 shixunstartbutton33BD8C"}>已完成</Button>
: ""
}
<div className="clearfix mb20">
<span className="fl ring-blue mr10 mt8">
{item.st === 0 ?
<Tooltip placement="bottom" title={"实训任务"}>
<img src={getImageUrl("images/educoder/icon/code.svg")} className="fl mt2 ml2" />
</Tooltip>
:
<Tooltip placement="bottom" title={"选择题任务"}>
<img src={getImageUrl("images/educoder/icon/choose.svg")} className="fl mt2 ml3" />
</Tooltip>
}
</span>
<span className="mr15 font-16 fl">{key+1}</span>
{/* <a className={"edu-default-btn edu-blueback-btn fr Finish_button"}
title={"直接挑战"}
style={{marginTop: '-2px'}}
onClick={()=>this.startshixunCombat(false,undefined, item.challenge_id)}
// onClick={() => this.startshixunCombat(false)}
>直接挑战</a> */}
{
ChallengesDataList.allow_skip === true && item.status === 1?
<Button type="primary" shape="round" size={"small"} className={"ml30 shixunstartbuttonFF6601"}>未完成</Button>
: ""
}
{this.props.identity<5?
item.st === 1 ?
<a onClick={() => this.EditTraining(this.props.identity, item.challenge_id, "/editquestion")}
className="font-16 color05101a">{item.name}</a>
:
<a onClick={() => this.EditTraining(this.props.identity, item.challenge_id, "/editcheckpoint")}
className="font-16 color05101a">{item.name}</a>:<span
// onClick={() => this.startshixunCombat(this.props.identity, item.challenge_id, "/editcheckpoint")}
className="font-16 color05101a">{item.name}</span>
}
{/* <Tooltip placement="bottom" title={""}>
<a className={"edu-default-btn edu-blueback-btn fr Finish_button"}
onClick={()=>this.startshixunCombat(false,undefined, item.challenge_id)}
style={{marginTop: '-2px'}}>直接挑战</a>
</Tooltip>
*/}
{
ChallengesDataList.allow_skip === false ? item.status === 1?
<Button type="primary" shape="round" size={"small"} className={"ml30 shixunstartbuttonFF6601"}>未完成</Button>
:"":""
<Modal
keyboard={false}
visible={startbtns}
closable={false}
footer={null}
className="startbtnModal"
>
<Spin size="large" />
</Modal>
<span className="fr mt8">
}
{/*<Tooltip placement="bottom" title={"请先完成前序关卡"}>*/}
{/* <a className={"edu-default-btn edu-greyback-btn fr Finish_button"}*/}
{/* // onClick={this.props.identity<5&&item.open_game!=""?()=>this.startshixunCombat(false,undefined, item.challenge_id):""}*/}
{/* style={{marginTop: '-2px'}}>直接挑战</a>*/}
{/*</Tooltip>*/}
{
item.status === 0 ?
<Button type="primary" shape="round" size={"small"} className={"ml30 shixunstartbuttonFF6601"}>未完成</Button>
:""
}
</div>
<span className="fr mt8">
{item.delete_url != undefined &&
<Tooltip placement="bottom" title={"删除"}>
<a onClick={() => this.delOperations(item.challenge_id)}
@ -535,55 +571,44 @@ class Challenges extends Component {
</span>
</div>
<div className="clearfix pl28">
<span className="task-colspan"><span className={"color-orange"}>{item.passed_count}</span>&nbsp;</span>
<span
className="task-colspan"><span className={"color-orange"}>{item.playing_count}</span>&nbsp;</span>
<span className="task-colspan"><span>完成挑战可获得经验值&nbsp;<span className={"color-orange"}>{item.score}</span></span></span>
{/*判断比较复杂 有排第一不能是灰色按钮*/}
{item.status === 2 ?
<a className={"edu-default-btn edu-blueline-btn fr Finish_button mtf3"}
onClick={()=>this.startshixunCombat(false,undefined, item.challenge_id)}
// onClick={() => this.startshixunCombat(false)}
title={"查看挑战关卡"}
>已完成</a> : ""
}
{
ChallengesDataList.allow_skip === true && item.status === 1?
<a className={"edu-default-btn edu-blueback-btn fr Finish_button"}
title={"直接挑战"}
style={{marginTop: '-2px'}}
onClick={()=>this.startshixunCombat(false,undefined, item.challenge_id)}
// onClick={() => this.startshixunCombat(false)}
>直接挑战</a> : ""
}
{
ChallengesDataList.allow_skip === false ? item.status === 1?
<Tooltip placement="bottom" title={"直接挑战"}>
<a className={"edu-default-btn edu-blueback-btn fr Finish_button"}
onClick={()=>this.startshixunCombat(false,undefined, item.challenge_id)}
style={{marginTop: '-2px'}}>直接挑战</a>
</Tooltip>:"":""
}
{
item.status === 0 ?
<Tooltip placement="bottom" title={"请先完成前序关卡"}>
<a className={"edu-default-btn edu-greyback-btn fr Finish_button"}
// onClick={this.props.identity<5&&item.open_game!=""?()=>this.startshixunCombat(false,undefined, item.challenge_id):""}
style={{marginTop: '-2px'}}>直接挑战</a>
</Tooltip>:""
<div className="clearfix mb5">
{/*onClick={() => this.EditTraining(this.props.identity, item.challenge_id, "/editquestion")}*/}
{this.props.identity<5?
item.st === 1 ?
<span className="font-16 color05101a">{item.name}</span>
:
<span className="font-16 color05101a">{item.name}</span>:<span
// onClick={() => this.startshixunCombat(this.props.identity, item.challenge_id, "/editcheckpoint")}
className="font-16 color05101a">{item.name}</span>
}
{/* onClick={() => this.EditTraining(this.props.identity, item.challenge_id, "/editcheckpoint")}*/}
<Modal
keyboard={false}
visible={startbtns}
closable={false}
footer={null}
className="startbtnModal"
>
<Spin size="large" />
</Modal>
</div>
<div className="clearfix">
<style>
{
`
.task-colspan {
min-width: 20% !important;
}
`
}
</style>
<span className="task-colspan"><span className={"shixunbingbaocun12"}>正在挑战 </span><span className={"shixunbingbaocun33312"}>{item.playing_count}</span></span>
<span className="task-colspan"><span className={"shixunbingbaocun12"}>完成挑战 </span><span className={"shixunbingbaocun33312"}>{item.passed_count}</span></span>
<span className="task-colspan"><span className={"shixunbingbaocun12"}>可获经验 </span><span className={"shixunbingbaocun33312"}>{item.score}</span></span>
</div>
</div>

@ -199,7 +199,7 @@ class Challengesjupyter extends Component {
return (
<React.Fragment>
<div className="mt30 pl20 pr20" >
<div className="mt30 pl20 pr20 edu-back-white" >
<p className="clearfix mb20">
<span className="font-16 fl">简介</span>
<Tooltip placement="bottom" title={"编辑"}>

@ -103,3 +103,52 @@
position: absolute;
bottom: 21px;
}
.shixunjianjie{
height: 76px;
line-height: 35px;
padding: 20px;
border-bottom: 1px solid #eeee;
margin-bottom: 10px;
}
.pd20{
padding:20px;
}
.shixunbingbaocun12{
font-size:12px;
color:#888888;
}
.shixunbingbaocun33312{
font-size:12px;
color:#333333
}
.shixunjianjiecballenges{
height: 76px;
line-height: 35px;
padding: 20px;
border-bottom: 1px solid #eeee;
}
.padding1020pxshixun{
padding: 10px 20px 0px 20px;
}
.shixunstartbutton33BD8C{
background: #33BD8C;
border: #33BD8C;
}
.shixunstartbuttonFF6601{
background: #FF6601;
border: #FF6601;
}
.shixunstartbutton666666{
font-size:14px;
color:#666666;
}
Loading…
Cancel
Save