调整 issues/24746 实训作业作业描述模块

competitions
杨树林 6 years ago
parent ee2890aed1
commit fb6fcee969

@ -40,6 +40,7 @@ class ShixunHomeworkPage extends Component {
ModalsBottomval:"是否确认重做?", ModalsBottomval:"是否确认重做?",
ModalsType:false, ModalsType:false,
mylistisSpin:false, mylistisSpin:false,
Showupdateinstructions:false,
} }
} }
@ -170,6 +171,18 @@ class ShixunHomeworkPage extends Component {
} }
bindRef = ref => { this.child = ref } bindRef = ref => { this.child = ref }
///////////////教师截止 ///////////////教师截止
//编辑作业
Showupdateinstructionsboolfalse (bool) {
this.setState({
Showupdateinstructions:bool
})
}
//开始编辑作业
edenwork = ()=>{
this.setState({
Showupdateinstructions:true
})
}
gotohome=()=>{ gotohome=()=>{
// console.log(this.props) // console.log(this.props)
let {jobsettingsdatapage}=this.state let {jobsettingsdatapage}=this.state
@ -304,6 +317,15 @@ class ShixunHomeworkPage extends Component {
teacherdatapage && teacherdatapage.code_review === true ? teacherdatapage && teacherdatapage.code_review === true ?
<a className="fr color-blue font-16" onClick={(child)=>this.workshowmodels(this.child)}>代码查重</a> <a className="fr color-blue font-16" onClick={(child)=>this.workshowmodels(this.child)}>代码查重</a>
: "" : ""} : "" : ""}
{
parseInt(tab)===1?
this.props.isAdmin() ?
<a className="fr color-blue font-16" onClick={()=>this.edenwork()}>编辑作业</a>
:""
:""
}
{this.state.view_report === true ? <Link className="fr color-blue font-16" target={"_blank"} {this.state.view_report === true ? <Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}> to={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}>
查看实训报告 查看实训报告
@ -335,7 +357,7 @@ class ShixunHomeworkPage extends Component {
{/*modalsType={this.state.DownloadType}*/} {/*modalsType={this.state.DownloadType}*/}
{/*/>*/} {/*/>*/}
{parseInt(tab) === 0 ?<Listofworksstudentone triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>:""} {parseInt(tab) === 0 ?<Listofworksstudentone triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>:""}
{parseInt(tab) === 1 ?<Workquestionandanswer triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Workquestionandanswer>:""} {parseInt(tab) === 1 ?<Workquestionandanswer triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)} Showupdateinstructionsboolfalse={(i)=>this.Showupdateinstructionsboolfalse(i)}></Workquestionandanswer>:""}
{parseInt(tab) === 2 ?<ShixunStudentWork triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>:""} {parseInt(tab) === 2 ?<ShixunStudentWork triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>:""}
{parseInt(tab) === 3 ?<Trainingjobsetting triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>:""} {parseInt(tab) === 3 ?<Trainingjobsetting triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>:""}
</Spin> </Spin>

@ -67,7 +67,7 @@ class Workquestionandanswer extends Component {
ealuation: false, ealuation: false,
latededuction: undefined, latededuction: undefined,
latedeductiontwo: undefined, latedeductiontwo: undefined,
Showupdateinstructions: false, // Showupdateinstructions: false,
database: false, database: false,
datasheet: false, datasheet: false,
databasetwo: undefined, databasetwo: undefined,
@ -135,11 +135,11 @@ class Workquestionandanswer extends Component {
console.log(error) console.log(error)
}) })
} }
jobdescriptiondisplaybj = () => { // jobdescriptiondisplaybj = () => {
this.setState({ // this.setState({
Showupdateinstructions: true, // Showupdateinstructions: true,
}) // })
} // }
//统一设置 //统一设置
onChange = (e) => { onChange = (e) => {
@ -275,13 +275,23 @@ class Workquestionandanswer extends Component {
}) })
.then((result) => { .then((result) => {
if (result) { if (result) {
try {
this.props.showNotification(`${result.data.message}`); this.props.showNotification(`${result.data.message}`);
this.setState({ }catch (e) {
Showupdateinstructions: false
}) }
try {
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid)
this.Gettitleinformation(homeworkid) this.Gettitleinformation(homeworkid);
}catch (e) {
}
try {
this.props.Showupdateinstructionsboolfalse(false);
}catch (e) {
}
} }
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
@ -289,9 +299,7 @@ class Workquestionandanswer extends Component {
} }
NOReleaseNotes = () => { NOReleaseNotes = () => {
this.setState({ this.props.Showupdateinstructionsboolfalse(false);
Showupdateinstructions: false,
})
} }
workshowmodel = () => { workshowmodel = () => {
this.setState({ this.setState({
@ -390,7 +398,7 @@ class Workquestionandanswer extends Component {
render() { render() {
const dateFormat = 'YYYY-MM-DD HH:mm:ss'; const dateFormat = 'YYYY-MM-DD HH:mm:ss';
let { let {
starttimetype, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, score_open, Showupdateinstructions starttimetype, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, score_open
, homework_id , homework_id
} = this.state; } = this.state;
const radioStyle = { const radioStyle = {
@ -451,69 +459,52 @@ class Workquestionandanswer extends Component {
<div className="edu-back-white" > <div className="edu-back-white" >
{jobsettingsdata === undefined || jobsettingsdata.data.description === null ? <div className="ml20" style={{paddingTop: "20px"}}></div> : {/*{jobsettingsdata === undefined || jobsettingsdata.data.description === null ? <div className="ml20" style={{paddingTop: "20px"}}>无</div> :*/}
<div className=" clearfix edu-back-white poll_list mr20 " style={{paddingTop: "20px"}}> {/* <div className=" clearfix edu-back-white poll_list mr20 " style={{paddingTop: "20px"}}>*/}
<span> {/* <span>*/}
<style> {/* <style>*/}
{
`
hr{
display:none;
}
`
}
</style>
<div className={"font-16 color-dark fl pl20 "} >
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g, "▁▁▁")}}></div>
{/* /!*{}}></div>
{/* /!*{jobsettingsdata.data.description}*!/*/}
{/* <textarea>*/}
{/* {*/} {/* {*/}
{/* this.state.namestring*/} {/* `*/}
{/* hr{*/}
{/* display:none;*/}
{/* }*/} {/* }*/}
{/* </textarea>*/} {/* `*/}
</div> {/* }*/}
{/* <div className="justify break_full_word new_li markdown-body"*/} {/* </style>*/}
{/* id="challenge_editorMd_description">*/} {/* <div className={"font-16 color-dark fl pl20 "} >*/}
{/* <p id="ReactMarkdown" style={{overflow:'hidden'}}>*/} {/* <div className={"markdown-body"}*/}
{/* /!*{ChallengesDataList === undefined ? "" :ChallengesDataList.description===null?""*!/*/} {/* dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g, "▁▁▁")}}></div>*/}
{/* <textarea className="w200">*/}
{/* {jobsettingsdata.data.description}*/}
{/* </textarea>*/}
{/* /!*}*!/*/}
{/* </p>*/}
{/*</div>*/}
</span>
</div>}
<div className=" clearfix edu-back-white poll_list pd10">
<div className="font-16 color-green fl pl20 mt10">作业说明:</div>
{
this.props.isAdmin() && this.props.isAdmin() === true ?
(Showupdateinstructions && Showupdateinstructions === true ? "" : {/* </div>*/}
<Tooltip placement="top" title="编辑"><i {/* </span>*/}
className="color-green font-18 iconfont icon-bianjidaibeijing fr pr20 " {/* </div>}*/}
onClick={() => this.jobdescriptiondisplaybj()}></i></Tooltip>
) : "" {/*<div className=" clearfix edu-back-white poll_list pd10">*/}
} {/*<div className="font-16 color-green fl pl20 mt10">作业说明:</div>*/}
{/*{*/}
{/* this.props.isAdmin() && this.props.isAdmin() === true ?*/}
{/* (Showupdateinstructions && Showupdateinstructions === true ? "" :*/}
{/* <Tooltip placement="top" title="编辑"><i*/}
{/* className="color-green font-18 iconfont icon-bianjidaibeijing fr pr20 "*/}
{/* onClick={() => this.jobdescriptiondisplaybj()}></i></Tooltip>*/}
{/* ) : ""*/}
{/*}*/}
</div> {/*</div>*/}
<span> <span>
<div className="font-16 color-dark break_word flex1 "> <div className="font-16 color-dark break_word flex1 ">
{Showupdateinstructions && Showupdateinstructions === true ? {this.props.Showupdateinstructions && this.props.Showupdateinstructions === true ?
<div> <div>
<Homeworddescription {...this.props} ReleaseNotes={this.ReleaseNotes} <Homeworddescription {...this.props} ReleaseNotes={(explanations)=>this.ReleaseNotes(explanations)}
NOReleaseNotes={this.NOReleaseNotes} NOReleaseNotes={()=>this.NOReleaseNotes()}
description={jobsettingsdata === undefined ? "" : jobsettingsdata === null ? "" : jobsettingsdata === "null" ? "" : jobsettingsdata.data.explanation === undefined ? "" : jobsettingsdata.data.explanation === null ? "" : jobsettingsdata.data.explanation}></Homeworddescription> description={jobsettingsdata === undefined ? "" : jobsettingsdata === null ? "" : jobsettingsdata === "null" ? "" : jobsettingsdata.data.explanation === undefined ? "" : jobsettingsdata.data.explanation === null ? "" : jobsettingsdata.data.explanation}></Homeworddescription>
</div> </div>
: :
<div className="pl20 markdown-body" style={{"padding": "10px 10px 10px 20px"}}> <div className="pl20 markdown-body" style={{minHeight: "150px",padding: "20px"}}>
{jobsettingsdata === undefined ? "无" : jobsettingsdata === null ? "无" : jobsettingsdata === "null" ? "无" : {jobsettingsdata === undefined ? <span style={{color:"#D3D3D3"}}>暂无~</span> : jobsettingsdata === null ? <span style={{color:"#D3D3D3"}}>~</span> : jobsettingsdata === "null" ? <span style={{color:"#D3D3D3"}}>~</span> :
jobsettingsdata.data.explanation === undefined ? "无" : jobsettingsdata.data.explanation === null ? "无" : jobsettingsdata.data.explanation === undefined ? <span style={{color:"#D3D3D3"}}>暂无~</span> : jobsettingsdata.data.explanation === null ? <span style={{color:"#D3D3D3"}}>~</span> :
<div className={"markdown-body"} <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g, "▁▁▁")}}></div> dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g, "▁▁▁")}}></div>
} }

Loading…
Cancel
Save