|
|
|
@ -18,6 +18,13 @@ const Option = Select.Option;
|
|
|
|
|
|
|
|
|
|
const RadioGroup = Radio.Group;
|
|
|
|
|
|
|
|
|
|
function isNulltpm( str ){
|
|
|
|
|
if ( str == "" ) return true;
|
|
|
|
|
var regu = "^[ ]+$";
|
|
|
|
|
var re = new RegExp(regu);
|
|
|
|
|
return re.test(str);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default class TPMchallengesnew extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
@ -195,7 +202,7 @@ export default class TPMchallengesnew extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CreatePracticesend = () => {
|
|
|
|
|
|
|
|
|
|
const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim();
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
CreatePracticesendtype:true
|
|
|
|
@ -237,6 +244,25 @@ export default class TPMchallengesnew extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (exercise_editormdvalue === undefined||exercise_editormdvalue==""||exercise_editormdvalue===null) {
|
|
|
|
|
this.setState({
|
|
|
|
|
tpmcourseMessageMDType:true,
|
|
|
|
|
CreatePracticesendtype:false
|
|
|
|
|
})
|
|
|
|
|
this.props.scrollToAnchor("tpmcourseMessageMD");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isNulltpm(exercise_editormdvalue)){
|
|
|
|
|
this.setState({
|
|
|
|
|
tpmcourseMessageMDType:true,
|
|
|
|
|
CreatePracticesendtype:false
|
|
|
|
|
})
|
|
|
|
|
this.props.scrollToAnchor("tpmcourseMessageMD");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(shixunCreatePracticeGroup===undefined){
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunCreatePracticeGrouptype:true,
|
|
|
|
@ -284,7 +310,8 @@ export default class TPMchallengesnew extends Component {
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
let url = "/shixuns/" + id + "/challenges.json";
|
|
|
|
|
// exec_time:exec_time
|
|
|
|
@ -369,19 +396,13 @@ export default class TPMchallengesnew extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
editPracticesend=()=>{
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
editPracticesendtype:true
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,checkpointId,exec_time} = this.state;
|
|
|
|
|
|
|
|
|
|
const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim();
|
|
|
|
|
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
|
|
|
|
|
let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json";
|
|
|
|
|
|
|
|
|
|
const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim();
|
|
|
|
|
|
|
|
|
|
if (shixunCreatePractice === undefined||shixunCreatePractice=="") {
|
|
|
|
|
this.setState({
|
|
|
|
@ -408,6 +429,25 @@ export default class TPMchallengesnew extends Component {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (exercise_editormdvalue === undefined||exercise_editormdvalue==""||exercise_editormdvalue===null) {
|
|
|
|
|
this.setState({
|
|
|
|
|
tpmcourseMessageMDType:true,
|
|
|
|
|
editPracticesendtype:false
|
|
|
|
|
})
|
|
|
|
|
this.props.scrollToAnchor("tpmcourseMessageMD");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isNulltpm(exercise_editormdvalue)){
|
|
|
|
|
this.setState({
|
|
|
|
|
tpmcourseMessageMDType:true,
|
|
|
|
|
editPracticesendtype:false
|
|
|
|
|
})
|
|
|
|
|
this.props.scrollToAnchor("tpmcourseMessageMD");
|
|
|
|
|
this.props.showNotification("过关任务,请勿输入空格");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(shixunCreatePracticeGroup===undefined){
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunCreatePracticeGrouptype:true,
|
|
|
|
@ -591,7 +631,7 @@ export default class TPMchallengesnew extends Component {
|
|
|
|
|
|
|
|
|
|
<div className="edu-back-white newpadding02020">
|
|
|
|
|
|
|
|
|
|
<p className="color-grey-6 font-16 mb10"><span className="mr5 color-red">*</span>过关任务</p>
|
|
|
|
|
<p className="color-grey-6 font-16 mb10" id={"tpmcourseMessageMD"}><span className="mr5 color-red">*</span>过关任务</p>
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
@ -607,10 +647,13 @@ export default class TPMchallengesnew extends Component {
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<TPMMDEditor ref={this.exercisememoMDRef} placeholder="请输入选择题的题干内容" mdID={'exercisememoMD'} refreshTimeout={1500}
|
|
|
|
|
|
|
|
|
|
watch={true} className="courseMessageMD" initValue={this.state.exercisememoMDRefval} height={800}></TPMMDEditor>
|
|
|
|
|
|
|
|
|
|
<p id="e_tip_Memochallengesnew" className="edu-txt-right color-grey-cd font-12"></p>
|
|
|
|
|
<p id="e_tips_Memochallengesnew" className="edu-txt-right color-grey-cd font-12"></p>
|
|
|
|
|
|
|
|
|
|
{this.state.tpmcourseMessageMDType===true?<div className="color-red mt7 ml5 font-14" >必填项:不能为空</div>:""}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|