import React, {Component} from 'react'; import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Tooltip} from 'antd'; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; // import "antd/dist/antd.css"; import axios from 'axios'; import { getImageUrl, toPath } from 'educoder'; import './css/TPMchallengesnew.css'; import {getUrl} from 'educoder'; import TPMeditorMD from './editorMD'; let origin = getUrl(); let path = getUrl("/editormd/lib/") const $ = window.$; const Option = Select.Option; const RadioGroup = Radio.Group; var letterArr = []; for (var i = 65, j = 0; i < 91; i++, j++) { letterArr[j] = String.fromCharCode(i); } // 恢复数据 function md_rec_data(k,mdu,id, editor){ if(window.sessionStorage.getItem(k+mdu) !== null){ editor.setValue(window.sessionStorage.getItem(k+mdu)); md_clear_data(k,mdu,id); } } // 保存数据 function md_add_data(k,mdu,d){ window.sessionStorage.setItem(k+mdu,d); } // 清空保存的数据 function md_clear_data(k,mdu,id){ window.sessionStorage.removeItem(k+mdu); var id1 = "#e_tip_"+id; var id2 = "#e_tips_"+id; if(k == 'content'){ $(id2).html(""); }else{ $(id1).html(""); } } function md_elocalStorage(editor,mdu,id){ if (window.sessionStorage){ var oc = window.sessionStorage.getItem('content'+mdu); if(oc !== null ){ // console.log("#e_tips_"+id) $("#e_tips_"+id).data('editor', editor); var h = '您上次有已保存的数据,是否恢复 ? / 不恢复'; $("#e_tips_"+id).html(h); } setInterval(function() { var d = new Date(); var h = d.getHours(); var m = d.getMinutes(); var s = d.getSeconds(); h = h < 10 ? '0' + h : h; m = m < 10 ? '0' + m : m; s = s < 10 ? '0' + s : s; if(editor.getValue().trim() != ""){ md_add_data("content",mdu,editor.getValue()); var id1 = "#e_tip_"+id; var id2 = "#e_tips_"+id; $(id1).html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 "); $(id2).html(""); } },10000); }else{ $("#e_tip_"+id).after('您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!'); } } function create_editorMD(id, width, high, placeholder, imageUrl,initValue, callback) { var editorName = window.editormd(id, { width: width, height: high, path: path, // "/editormd/lib/" markdown : initValue, syncScrolling: "single", tex: true, tocm: true, emoji: true, taskList: true, codeFold: true, searchReplace: true, htmlDecode: "style,script,iframe", sequenceDiagram: true, autoFocus: false, placeholder: placeholder, toolbarIcons: function () { // Or return editormd.toolbarModes[name]; // full, simple, mini // Using "||" set icons align right. return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"] }, toolbarCustomIcons: { testIcon: "
", testIcon1: "
" }, //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。 saveHTMLToTextarea: true, // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标 dialogMaskOpacity: 0.6, imageUpload: true, imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], imageUploadURL: imageUrl,//url onload: function () { // this.previewing(); $("#" + id + " [type=\"latex\"]").bind("click", function () { editorName.cm.replaceSelection("```latex"); editorName.cm.replaceSelection("\n"); editorName.cm.replaceSelection("\n"); editorName.cm.replaceSelection("```"); var __Cursor = editorName.cm.getDoc().getCursor(); editorName.cm.setCursor(__Cursor.line - 1, 0); }); $("#" + id + " [type=\"inline\"]").bind("click", function () { editorName.cm.replaceSelection("$$$$"); var __Cursor = editorName.cm.getDoc().getCursor(); editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); editorName.cm.focus(); }); $("[type=\"inline\"]").attr("title", "行内公式"); $("[type=\"latex\"]").attr("title", "多行公式"); callback && callback() } }); return editorName; } export default class TPMquestion extends Component { constructor(props) { super(props) this.state = { choice_url: undefined, practice_url: undefined, go_back_url: undefined, position: undefined, task_pass_default: undefined, submit_url: undefined, questionInputvalue:undefined, questionaddsum:0, questionaddarray:[], questionaddtype:true, activetype:"", questionlists:[{str:"A",val:"",type:false},{str:"B",val:"",type:false},{str:"C",val:"",type:false},{str:"D",val:"",type:false}], answeshixunsGroup: 1, answeoptions:[10,20], answeonshixunsmark:10, shixunssanswerkillvalue:"", shixunsskillanswerlist:[], challenge_id:"", challenge_choose_id:undefined, questionlistss:[], newcnttype:false, newquestioMDvaluetype:false, challenge_tagtype:false, editquestionaddtype:false, mancheckpointId:undefined, power:false, questionInputvaluetype:false, questioMD:"", standard_answer:"", subject:"", newquestioMDvaluetypes:false, questionInputvaluetypes:false, prev_challenge:undefined, next_challenge:undefined, newcnttypesum:1, marktype:false, answer:"", sumittype:false } } questioMD=(initValue, id)=> { this.contentChanged = false; const placeholder = "请输入选择题的过关任务内容"; // amp; // 编辑时要传memoId // const imageUrl = `/upload_with_markdown?container_id=&container_type=Memo`; const imageUrl = `/api/attachments.json`; // 创建editorMd let questio_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, initValue,() => { setTimeout(() => { questio_editormd.resize() questio_editormd.cm && questio_editormd.cm.refresh() }, 500) if (initValue != undefined) { questio_editormd.setValue(initValue) } questio_editormd.cm.on("change", (_cm, changeObj) => { console.log('....contentChanged') this.contentChanged = true; }) }); md_elocalStorage(questio_editormd, `MemoQuestion_${id}`, `${id}Question`); this.questio_editormd = questio_editormd; window.questio_editormd = questio_editormd; } newanswerMD=(initValue, id)=> { this.contentChanged = false; // amp; // 编辑时要传memoId const imageUrl = `/api/attachments.json`; // 创建editorMd let newanswerMD_editormd = create_editorMD(id, '100%', 400, "请输入各个选项的具体解析或其他相关信息", imageUrl, initValue,() => { setTimeout(() => { newanswerMD_editormd.resize() newanswerMD_editormd.cm && newanswerMD_editormd.cm.refresh() }, 500) if (initValue != undefined) { newanswerMD_editormd.setValue(initValue) } newanswerMD_editormd.cm.on("change", (_cm, changeObj) => { console.log('....contentChanged') this.contentChanged = true; }) }); md_elocalStorage(newanswerMD_editormd, `MemoQuestion_${id}`, `${id}Question`); this.newanswerMD_editormd = newanswerMD_editormd; window.newanswerMD_editormd = newanswerMD_editormd; } newquestioMD=(initValue, id)=>{ this.contentChanged = false; // amp; // 编辑时要传memoId const imageUrl = `/api/attachments.json`; // 创建editorMd let newquestioMD_editormd = create_editorMD(id, '100%', 400, "请输入选择题的题干内容", imageUrl, initValue,() => { setTimeout(() => { newquestioMD_editormd.resize() newquestioMD_editormd.cm && newquestioMD_editormd.cm.refresh() }, 500) if (initValue != undefined) { newquestioMD_editormd.setValue(initValue) } newquestioMD_editormd.cm.on("change", (_cm, changeObj) => { console.log('....contentChanged') this.contentChanged = true; }) }); md_elocalStorage(newquestioMD_editormd, `MemoQuestion_${id}`, `${id}Question`); this.newquestioMD_editormd = newquestioMD_editormd; window.newquestioMD_editormd = newquestioMD_editormd; } editanswerMD=(initValue, id)=> { this.contentChanged = false; const placeholder = ""; // amp; // 编辑时要传memoId const imageUrl = `/api/attachments.json`; // 创建editorMd const neweditanswer_editormd =create_editorMD(id, '100%', 400, "请输入选择题的题干内容", imageUrl, initValue,()=> { setTimeout(() => { neweditanswer_editormd.resize() neweditanswer_editormd.cm && neweditanswer_editormd.cm.refresh() }, 500) if (initValue != undefined) { neweditanswer_editormd.setValue(initValue) } neweditanswer_editormd.cm.on("change", (_cm, changeObj) => { console.log('....contentChanged') this.contentChanged = true; }) }); md_elocalStorage(neweditanswer_editormd, `MemoQuestion_${id}`, `${id}Question`); this.neweditanswer_editormd = neweditanswer_editormd; window.neweditanswer_editormd = neweditanswer_editormd; } editanswersMD=(initValue, id)=> { this.contentChanged = false; const placeholder = ""; // amp; // 编辑时要传memoId const imageUrl = `/api/attachments.json`; // 创建editorMd const editanswersMD_editormd = create_editorMD(id, '100%', 400, "请输入各个选项的具体解析或其他相关信息", imageUrl, initValue,() => { setTimeout(() => { editanswersMD_editormd.resize() editanswersMD_editormd.cm && editanswersMD_editormd.cm.refresh() }, 500) if (initValue != undefined) { editanswersMD_editormd.setValue(initValue) } editanswersMD_editormd.cm.on("change", (_cm, changeObj) => { console.log('....contentChanged') this.contentChanged = true; }) }); md_elocalStorage(editanswersMD_editormd, `MemoQuestion_${id}`, `${id}Question`); this.editanswersMD_editormd = editanswersMD_editormd; window.editanswersMD_editormd = editanswersMD_editormd; } //_______________________________________________________________________________ questionInputvalue=(e)=>{ this.setState({ questionInputvalue: e.target.value }) } componentDidMount() { if(this.props.status===2){ } let id = this.props.match.params.shixunId; let checkpointId=this.props.match.params.checkpointId; this.setState({ mancheckpointId:id, }) let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; let newpractice_url= "/shixuns/"+id+"/challenges/new"; let newgo_back_url="/shixuns/"+id+"/challenges"; if(this.props.match.params.choose_id===undefined){ if(checkpointId===undefined){ //新建模式 let nurl = "/shixuns/" + id + "/challenges/new.json" axios.get(nurl).then((response) => { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { }else { this.setState({ choice_url: newchoice_url, practice_url: newpractice_url, go_back_url: newgo_back_url, position: response.data.position, task_pass_default: response.data.task_pass_default, submit_url: response.data.submit_url, power:true, activetype:"first", }) if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { this.questioMD("", "questioMD"); this.setState({ questioMD:"" }) } else { this.questioMD("", "questioMD"); // this.create_mackdown(response.data.task_pass_default, "questioMD","") this.setState({ questioMD:response.data.task_pass_default }) } this.shixunsautoHeight() } }).catch((error) => { console.log(error) }); }else{ //编辑模式 let url = "/shixuns/"+ id +"/challenges/"+checkpointId+"/edit.json?st=1" axios.get(url).then((response) => { // if(choose_idlist!=undefined){ // // for(var i=0; i { console.log(error) }); } }else{ $('html').animate({ scrollTop:10 }, 500); let{challenge_id} =this.state; let id = this.props.match.params.shixunId; let url = "/shixuns/"+ id +"/challenges/"+checkpointId+"/edit.json?st=1" axios.get(url).then((response) => { // if(choose_idlist!=undefined){ // // for(var i=0; i { console.log(error) }); let zrl ='/shixuns/'+this.props.match.params.shixunId+'/challenges/'+this.props.match.params.checkpointId+'/edit_choose_question.json?choose_id='+this.props.match.params.choose_id; axios.get(zrl).then((response) => { if(response.status===200){ let choose_contents=response.data.choose_contents; let newchoose_contentslist=[] for(var i=0; i { }); } } clickquestionsumit=()=>{ this.setState({ sumittype:true }) let checkpointId=this.props.match.params.checkpointId; if(this.props.status===2&&checkpointId===undefined){ this.props.showSnackbar("该实训已经发布不能新建") this.setState({ sumittype:false }) return } let {questionInputvalue} =this.state; const exercise_editormdvalue = this.questio_editormd.getValue(); let id = this.props.match.params.shixunId; if(questionInputvalue===undefined||questionInputvalue===null||questionInputvalue===""){ this.setState({ questionInputvaluetype:true }) $('html').animate({ scrollTop: 10 }, 1000); this.setState({ sumittype:false }) return } if(exercise_editormdvalue===null ||exercise_editormdvalue===""){ this.setState({ questionInputvaluetypes:true }) $('html').animate({ scrollTop: 500 }, 1000); this.setState({ sumittype:false }) return } if(checkpointId===undefined){ let url = "/shixuns/" + id + "/challenges.json"; axios.post(url, { identifier:id, subject: questionInputvalue, task_pass: exercise_editormdvalue, st: 1 }).then((response) => { this.props.showSnackbar(response.data.messages); // if(response.data.status===1){ // // this.setState({ // questionaddtype:false, // challenge_id:response.data.challenge_id // }) // // this.questionadd() // } window.location.href = '/shixuns/'+id+'/challenges/'+response.data.challenge_id+'/editquestion'; }).catch((error) => { console.log(error) }); }else{ let url ="/shixuns/"+id+"/challenges/"+checkpointId+".json"; axios.put(url, { tab:0, subject: questionInputvalue, task_pass: exercise_editormdvalue, }).then((response) => { if(response.data.status===1){ this.setState({ questionaddtype:false, challenge_id:response.data.challenge_id }) } $('html').animate({ scrollTop: 10 }, 200); this.props.showSnackbar(response.data.messages); window.location.href = '/shixuns/'+id+'/challenges/'+response.data.challenge_id+'/editquestion'; }).catch((error) => { console.log(error) }); } } questionall=()=>{ let {task_pass_default}=this.state; this.setState({ activetype:"first", newquestionaddtype:false, editquestionaddtype:false }) this.questioMD(task_pass_default, "questioMD"); } questionadd=()=>{ $('html').animate({ scrollTop: 10 }, 200); let{questionaddarray}=this.state; let questionaddsums=questionaddarray.length; if(questionaddarray.length-1>9){ return } let questionaddarrays=questionaddarray; questionaddarrays.push({type:0,choose_id:0}); this.setState({ activetype:0, questionaddarray:questionaddarrays, questionaddtype:true, newquestionaddtype:true, editquestionaddtype:false, questionlists:[{str:"A",val:"",type:false},{str:"B",val:"",type:false},{str:"C",val:"",type:false},{str:"D",val:"",type:false}], answeshixunsGroup: 1, answeoptions:[10,20], answeonshixunsmark:10, shixunssanswerkillvalue:"", shixunsskillanswerlist:[] }) this.newanswerMD("","challenge_choose_answer") this.newquestioMD("","newquestioMDs") // this.create_mackdown("", "newquestioMDs","请输入选择题的题干内容","newanswerMD_editormd") // this.create_mackdown("", "challenge_choose_answer","请输入各个选项的具体解析或其他相关信息","newquestioMD_editormd") this.shixunsautoHeight() } editquestionlists=(newquestionlists)=>{ let newlist=newquestionlists; let list=[] for(var i=0; i{ let{questionlists} = this.state; let newquestionlists=questionlists; let newli={str:letterArr[questionlists.length],val:"",type:false}; newquestionlists.push(newli); this.editquestionlists(newquestionlists); } delquestionlists=(key)=>{ let{questionlists} = this.state; let newquestionlists=questionlists; newquestionlists.splice(key,1); for(var i=0; i{ let{questionlists} = this.state; let newquestionlists=questionlists; if(newquestionlists[key].type===true){ newquestionlists[key].type=false; }else if(newquestionlists[key].type===false){ newquestionlists[key].type=true; } this.editquestionlists(newquestionlists); } onshixunGroupanswe=(e)=> { let optionsum; let onshixunsmark; if(e.target.value===1){ optionsum=[10,20]; onshixunsmark=10; }else if(e.target.value===2){ optionsum=[30,40,50,60]; onshixunsmark=30; }else if(e.target.value===3){ optionsum=[70,80,90,100] onshixunsmark=70; } this.setState({ answeshixunsGroup: e.target.value, answeoptions:optionsum, answeonshixunsmark:onshixunsmark }) } shixunssanswerkill = (e) => { this.setState({ shixunssanswerkillvalue: e.target.value }) } clickshixunsanswerskill = () => { let {shixunssanswerkillvalue, shixunsskillanswerlist} = this.state; if (shixunssanswerkillvalue === "") { return } else if (shixunssanswerkillvalue === undefined) { return } if(shixunssanswerkillvalue == "" || shixunssanswerkillvalue == undefined || shixunssanswerkillvalue == null || (shixunssanswerkillvalue.length>0 && shixunssanswerkillvalue.trim().length == 0)){ message.error("输入为空,不能保存!"); return } let list = shixunsskillanswerlist; list.push(shixunssanswerkillvalue); this.setState({ shixunsskillanswerlist: list, shixunssanswerkillvalue: "" }) } delshixunssnswerllist=(key)=>{ let {shixunsskillanswerlist} = this.state; let newshixunsskillanswerlist = shixunsskillanswerlist; newshixunsskillanswerlist.splice(key, 1); this.setState({ shixunsskillanswerlist: newshixunsskillanswerlist }) } onInputoquestionption=(e,key)=>{ $.fn.autoHeight = function(){ function autoHeight(elem){ elem.style.height = 'auto'; elem.style.maxHeight = '140px'; elem.scrollTop = 0; //防抖动 elem.style.height = elem.scrollHeight + 'px'; } this.each(function(){ autoHeight(this); $(this).on('keyup', function(){ autoHeight(this); }); }); } $("#"+e.target.id).autoHeight(); let {questionlists}=this.state; let newquestionlists=questionlists; newquestionlists[key].val=e.target.value; this.editquestionlists(newquestionlists); } onshixunsansweSelect=(value)=>{ this.setState({ answeonshixunsmark: value }) } answer_subit=(sumtype,challenge_choose_id)=>{ let {challenge_id,questionlists,shixunsskillanswerlist,answeonshixunsmark,answeshixunsGroup,questionaddarray} =this.state; if(challenge_id===undefined){ message.error("关卡id为空"); return } let newquestionlists=questionlists; let newlist=""; let newtype=[]; let newcnt=[]; let list=0; for(var i=0; i { console.log(error) }); }else{ let newquestioMDvalue = this.newquestioMD_editormd.getValue(); if(newquestioMDvalue===""||newquestioMDvalue==="请输入选择题的题干内容"){ this.setState({ newquestioMDvaluetype:true, }) $('html').animate({ scrollTop:100 }, 200); message.error("题干为空"); return } let newnewanswerMDvalue = this.newanswerMD_editormd.getValue(); // // if(newnewanswerMDvalue===""||newnewanswerMDvalue==="请输入选择题的题干内容"){ // this.setState({ // newquestioMDvaluetypes:true, // }) // // $('html').animate({ // scrollTop:1300 // }, 200); // this.props.showSnackbar("参考答案为空"); // return // } if(newnewanswerMDvalue===""||newnewanswerMDvalue===" "){ newnewanswerMDvalue=newlist } url="/shixuns/" + id + "/challenges/" + challenge_id + "/create_choose_question.json"; axios.post(url, { challenge_choose: {subject: newquestioMDvalue, answer: newnewanswerMDvalue, standard_answer:newlist , score: answeonshixunsmark, difficult: answeshixunsGroup}, challenge_tag: shixunsskillanswerlist, question: {cnt: newcnt}, choice: {answer: newtype} }).then((response) => { let questionaddsums=questionaddarray.length; let questionaddarrays=questionaddarray; questionaddarrays[questionaddsums-1].choose_id=response.data.challenge_choose_id; if(newlist.length===1){ questionaddarrays[questionaddsums-1].type=1; }else if(newlist.length>1){ questionaddarrays[questionaddsums-1].type=2; } this.setState({ challenge_choose_id:response.data.challenge_choose_id, questionaddtype:false, editquestionaddtype:false, newquestioMDvaluetype:false, newquestioMDvaluetypes:false, questionaddarray:questionaddarrays }) // $('html').animate({ // scrollTop: 10 // }, 200); message.success("新建成功"); // this.getanswer_subitlist() this.gochooseid("/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+response.data.challenge_choose_id) }).catch((error) => { console.log(error) }); } } // getanswer_subitlist=()=>{ // let{challenge_choose_id,challenge_id,questionaddarray} =this.state // let id = this.props.match.params.shixunId; // let url ='/shixuns/'+id+'/challenges/'+challenge_id+'/edit_choose_question.json?choose_id='+challenge_choose_id; // axios.get(url).then((response) => { // if(response.status===200){ // this.create_mackdown(response.data.subject, "neweditanswer","","neweditanswer_editormd") // this.create_mackdown(response.data.standard_answer, "editanswers","","editanswersMD_editormd") // let choose_contents=response.data.choose_contents; // let newchoose_contentslist=[] // for(var i=0; i { // }); // } questionlist=(key,challenge_choose_id,type)=>{ $('html').animate({ scrollTop:10 }, 500); let{challenge_id} =this.state; if(challenge_choose_id===""||type===0){ this.newanswerMD("","neweditanswer") this.editanswersMD("","editanswers") this.setState({ activetype:challenge_choose_id, editquestionaddtype:true, questionaddtype:true, newquestionaddtype:false, questionlists:[{str:"A",val:"",type:false},{str:"B",val:"",type:false},{str:"C",val:"",type:false},{str:"D",val:"",type:false}], answeshixunsGroup: 1, answeoptions:[10,20], answeonshixunsmark:10, shixunssanswerkillvalue:"", shixunsskillanswerlist:[] }) // this.create_mackdown("", "newquestioMDs","请输入选择题的题干内容","newanswerMD_editormd") // this.create_mackdown("", "challenge_choose_answer","请输入各个选项的具体解析或其他相关信息","newquestioMD_editormd") }else{ let id = this.props.match.params.shixunId; let url ='/shixuns/'+id+'/challenges/'+challenge_id+'/edit_choose_question.json?choose_id='+challenge_choose_id; axios.get(url).then((response) => { if(response.status===200){ let choose_contents=response.data.choose_contents; let newchoose_contentslist=[] for(var i=0; i { }); } } shixunsautoHeight=()=>{ $.fn.autoHeight = function(){ function autoHeight(elem){ elem.style.height = 'auto'; elem.style.maxHeight = '140px'; elem.scrollTop = 0; //防抖动 if(elem.scrollHeight===0){ elem.style.height = 62 + 'px'; }else{ // if(elem.style.height>140){ // // } elem.style.height = elem.scrollHeight + 'px'; } } this.each(function(){ autoHeight(this); $(this).on('keyup', function(){ autoHeight(this); }); }); } $('textarea[autoHeight]').autoHeight(); } gochooseid=(url)=>{ window.location.href =url } onshixunsmarks=()=> { this.setState({ marktype:true }) } onshixunsmarkss=()=> { this.setState({ marktype:false }) } render() { let {choice_url, practice_url, go_back_url, position, questionInputvalue, challenge_tagtype, questionInputvaluetype, answeshixunsGroup, answeoptions, answeonshixunsmark, shixunssanswerkillvalue, questionlistss,power, questionaddarray, questionaddtype, activetype, newquestionaddtype, newquestioMDvaluetype, editquestionaddtype, questionlists, shixunsskillanswerlist, newcnttype, challenge_choose_id, mancheckpointId, challenge_id, questioMD, standard_answer, subject, newquestioMDvaluetypes, questionInputvaluetypes, prev_challenge, next_challenge, newcnttypesum, marktype, answer, sumittype } = this.state; let options; options = answeoptions.map((d, k) => { return ( ) }) console.log(answer) return (
  • 本关任务
  • { questionaddarray.length===0?"":questionaddarray.map((item,key)=>{ return(
  • this.questionlist(key,item.choose_id,item.type):""} > { item.choose_id!=0? this.gochooseid("/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+item.choose_id)}> {key+1}.{item.type===2?"多选题":item.type===1?"单选题":'选择题'} :{key+1}.{item.type===2?"多选题":item.type===1?"单选题":'选择题'} }
  • ) }) }
  • +
  • 任务名称

    *
    必填项

    过关任务

    *
    {/**/}
    必填项

    4||this.props.identity===undefined||power===false?"none":"block"}}> 提交 取消
    {/*新建*/} {newquestionaddtype===true?

    题干

    *
    {/**/} {/*
    */} {/*
    */} {/**/}
    必填项

    { questionlists===undefined||questionlists.length===0?"":questionlists.map((item,key)=>{ return(
  • this.delquestionlists(key)}>
  • ) }) }

    新增选项 {newcnttypesum===0?"请选择答案":"选项内容不能为空"}

  • 参考答案

    {/**/} {/*
    */} {/*
    */}
    必填项

    难度系数

    简单 中等 困难

    奖励经验值

    *

    如果学员答题错误,则不能得到相应的经验值
    如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+10经验值、+10金币

    必填项

    技能标签

    *
    {/*+ 添加*/}
    学员答题正确将获得技能,否则不能获得技能 必填项
    { shixunsskillanswerlist.length === 0 ? "" : shixunsskillanswerlist.map((itme, key) => { return (
  • {itme} this.delshixunssnswerllist(key)}>×
  • ) }) }
    4||this.props.identity===undefined||power===false?"none":"block"}}> 提交 取消
    :""} {/*修改*/} {editquestionaddtype===true?

    题干

    *
    必填项

    { questionlists===undefined||questionlists.length===0?"":questionlists.map((item,key)=>{ return(
  • this.delquestionlists(key)}>
  • ) }) }

    新增选项 {newcnttypesum===0?"请选择答案":"选项内容不能为空"}

  • 参考答案

    {/**/} {/*
    */} {/*
    */}
    必填项

    难度系数

    简单 中等 困难

    奖励经验值

    *

    如果学员答题错误,则不能得到相应的经验值
    如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+10经验值、+10金币

    必填项

    技能标签

    *
    {/*+ 添加*/}
    学员答题正确将获得技能,否则不能获得技能 必填项
    { shixunsskillanswerlist.length === 0 ? "" : shixunsskillanswerlist.map((itme, key) => { return (
  • {itme} this.delshixunssnswerllist(key)}>×
  • ) }) }
    4||this.props.identity===undefined||power===false?"none":"block"}}> this.answer_subit("edit",challenge_choose_id)}>提交 取消
    :""}
    ) } }