Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

competitions
cxt 6 years ago
commit 7d80b057e1

@ -112,9 +112,24 @@ module ExercisesHelper
effictive_users_count = effictive_users.size #有效回答数可能有重复的用户id这里仅统计是否回答这个问题的全部人数 effictive_users_count = effictive_users.size #有效回答数可能有重复的用户id这里仅统计是否回答这个问题的全部人数
# #
if ex.question_type > Exercise::COMPLETION #当为主观题和实训题时, # if ex.question_type > Exercise::COMPLETION #当为主观题和实训题时,
# ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分
# percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率
#
# end
if ex.question_type != Exercise::MULTIPLE
ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分 ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分
percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率 percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率
else
multiple_score = 0
user_ids.each do |user_id|
ex_answer_score = ex_answers.select{|answer| answer.user_id == user_id}&.first&.score.to_f
multiple_score += ex_answer_score
end
percent = (ex_total_score == 0.0 ? 0.0 : (multiple_score / ex_total_score.to_f).round(3) * 100) #正确率
end end
question_answer_infos = [] question_answer_infos = []
@ -123,19 +138,19 @@ module ExercisesHelper
standard_answer = ex.exercise_standard_answers.pluck(:exercise_choice_id).sort #标准答案的位置 standard_answer = ex.exercise_standard_answers.pluck(:exercise_choice_id).sort #标准答案的位置
# right_users_count = 0 # right_users_count = 0
# 该问题的正确率 # 该问题的正确率
if ex.question_type == Exercise::MULTIPLE #多选题 # if ex.question_type == Exercise::MULTIPLE #多选题
right_user_ids = user_ids # right_user_ids = user_ids
standard_answer.each do |choice_position| # standard_answer.each do |choice_position|
standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == choice_position}.first&.id # standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == choice_position}.first&.id
right_user_ids = right_user_ids & effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.pluck(:user_id) # right_user_ids = right_user_ids & effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.pluck(:user_id)
end # end
right_users_count = right_user_ids.size # # right_users_count = right_user_ids.size
else #单选题和判断题 # else #单选题和判断题
standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == standard_answer.first}.first&.id # standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == standard_answer.first}.first&.id
right_users_count = effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.size # # right_users_count = effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.size
end # end
percent = commit_user_ids > 0 ? (right_users_count / commit_user_ids.to_f).round(3)*100 : 0.0 # percent = commit_user_ids > 0 ? (right_users_count / commit_user_ids.to_f).round(3)*100 : 0.0
#每个选项的正确率 #每个选项的正确率
ex_choices.each do |c| ex_choices.each do |c|
@ -181,7 +196,7 @@ module ExercisesHelper
all_user_count += user_count all_user_count += user_count
standard_answer_count += 1 standard_answer_count += 1
end end
percent = commit_user_ids > 0 ? (all_user_count / commit_user_ids.to_f).round(3)*100 : 0.0 # percent = commit_user_ids > 0 ? (all_user_count / commit_user_ids.to_f).round(3)*100 : 0.0
user_wrong_count = (effictive_users_count - all_user_count ) user_wrong_count = (effictive_users_count - all_user_count )

@ -21,16 +21,16 @@ let hashTimeout
// TODO 开发期多个身份切换 // TODO 开发期多个身份切换
let debugType ="" let debugType =""
if (isDev) { // if (isDev) {
const _search = window.location.search; // const _search = window.location.search;
let parsed = {}; // let parsed = {};
if (_search) { // if (_search) {
parsed = queryString.parse(_search); // parsed = queryString.parse(_search);
} // }
debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : // debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' : // window.location.search.indexOf('debug=s') != -1 ? 'student' :
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' // window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
} // }
window._debugType = debugType; window._debugType = debugType;
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {
initOnlineOfflineListener() initOnlineOfflineListener()

@ -35,6 +35,8 @@ class UseBank extends Component{
} }
} }
componentDidMount() { componentDidMount() {
console.log("UseBank");
console.log(this.props);
} }
onCheckBoxChange = (checkBoxValues) => { onCheckBoxChange = (checkBoxValues) => {
@ -182,6 +184,9 @@ class UseBank extends Component{
let { flag, nav_my, loading, hasMore, object_list, search, checkBoxValues,isChecked,page,is_teacher }=this.state let { flag, nav_my, loading, hasMore, object_list, search, checkBoxValues,isChecked,page,is_teacher }=this.state
let { object_type }=this.props; let { object_type }=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />; const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
console.log("题库选用2222");
console.log("UseBank");
console.log(this.props);
return( return(
<a> <a>
<style>{` <style>{`
@ -197,11 +202,21 @@ class UseBank extends Component{
width: 170px !important; width: 170px !important;
} }
.bankwidth{ .bankwidth{
width:32% !important;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
}
.bankwidth2{
width:24% !important; width:24% !important;
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
white-space:nowrap white-space:nowrap
} }
.with58{
width:58% !important;
Margin-left:15px
}
`}</style> `}</style>
@ -279,17 +294,39 @@ class UseBank extends Component{
return ( return (
<p className="clearfix mb7" key={item.id}> <p className="clearfix mb7" key={item.id}>
<Checkbox className="fl" value={item.id} key={item.id}></Checkbox> <Checkbox className="fl" value={item.id} key={item.id}></Checkbox>
<span className="fl with65"> <span className={nav_my === 'myself' ? "fl with58" : "fl with65"}>
<label className="task-hide fl" title={item.name && item.name.length > 30 ? item.name:""} style={{"maxWidth":"100%"}}>{item.name}</label> <label className="task-hide fl" title={item.name && item.name.length > 30 ? item.name:""} style={{"maxWidth":"100%"}}>{item.name}</label>
</span> </span>
<span title={item.course_list_name && item.course_list_name.length > 10 && item.course_list_name} <span title={item.course_list_name && item.course_list_name.length > 10 && item.course_list_name}
className={nav_my==='myself'?"fl with30 color-grey-6 task-hide pl5 bankwidth":"fl with30 color-grey-6 task-hide pl5 bankwidth"} className={nav_my === 'myself' ? "fl with30 color-grey-6 task-hide pl5 bankwidth" : "fl with30 color-grey-6 task-hide pl5 bankwidth2"}
>{item.course_list_name}</span> >{item.course_list_name}</span>
{ {
nav_my==='public' && nav_my==='public' &&
<span className="fl with16 color-grey-6 task-hide pl10">{item.username}</span> <span className="fl with16 color-grey-6 task-hide pl10">{item.username}</span>
} }
{nav_my === "myself" ?
(this.props.object_type && this.props.object_type === "normal" ?
<a style={{textAlign: "center"}} key={item.id} className="color-blue font-14 pl5"
href={`/banks/normal/${item.id}/edit/personal?tab=0`}
>编辑</a>
: this.props.object_type && this.props.object_type === "group" ?
<a style={{textAlign: "center"}} key={item.id} className="color-blue font-14 pl5"
href={`/banks/group/${item.id}/edit/publicly?tab=0`}
>编辑</a>
: this.props.object_type && this.props.object_type === "exercise" ?
<a style={{textAlign: "center"}} key={item.id} className="color-blue font-14 pl5"
href={`/banks/exercise/${item.id}/edit/personal`}
>编辑</a>
: this.props.object_type && this.props.object_type === "poll" ?
<a style={{textAlign: "center"}} key={item.id} className="color-blue font-14 pl5"
href={`/banks/poll/${item.id}/edit/personal`}
>编辑</a>
: "")
: ""
}
</p> </p>
) )
})} })}

@ -528,20 +528,31 @@ class Coursesleftnav extends Component{
axios.post(url, axios.post(url,
{name:value}).then((result)=>{ {name:value}).then((result)=>{
if(result.data.status===0){ if(result!=undefined){
// window.location.reload() if(result.data.status===0){
this.updasaveNavmoda() // window.location.reload()
// this.updasaveNavmoda()
notification.open({ //
message:"提示", notification.open({
description:result.data.message message:"提示",
}); description:result.data.message
trigger('updateNavSuccess') });
if(positiontype==="files"){ trigger('updateNavSuccess')
window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`;
// this.props.history.push(`/courses/${coursesId}/file/${result.data.category_id}`) if(positiontype==="files"){
window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`;
}
if(positiontype==="boards"){
window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`;
}
if(positiontype==="course_groups"){
window.location.href=`/courses/${coursesId}/course_groups/${result.data.group_id}`;
}
}
} }
}
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })
@ -549,17 +560,19 @@ class Coursesleftnav extends Component{
saveboardpost=(url,value)=>{ saveboardpost=(url,value)=>{
axios.put(url, axios.put(url,
{name:value}).then((result)=>{ {name:value}).then((result)=>{
if(result.data.status===0){ if(result!=undefined){
// window.location.reload() if(result.data.status===0){
this.updasaveNavmoda() // window.location.reload()
trigger('updateNavSuccess') this.updasaveNavmoda()
trigger('updateNavSuccess')
//
notification.open({ //
message:"提示", notification.open({
description:result.data.message message:"提示",
}); description:result.data.message
} });
}
}
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })
@ -599,7 +612,7 @@ class Coursesleftnav extends Component{
let newid=this.props.match.params.coursesId; let newid=this.props.match.params.coursesId;
let url="/courses/"+newid+"/course_groups.json"; let url="/courses/"+newid+"/course_groups.json";
this.saveNavmodapost(url,NavmodalValue) this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId)
}else if(Navmodaltypename===3){ }else if(Navmodaltypename===3){
@ -620,7 +633,7 @@ class Coursesleftnav extends Component{
let newid=this.props.match.params.coursesId; let newid=this.props.match.params.coursesId;
let url = "/courses/"+newid+"/boards.json"; let url = "/courses/"+newid+"/boards.json";
this.saveNavmodapost(url,NavmodalValue) this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId)
}else if(Navmodaltypename===7) { }else if(Navmodaltypename===7) {
@ -708,13 +721,15 @@ class Coursesleftnav extends Component{
droppablepost=(url,list)=>{ droppablepost=(url,list)=>{
axios.post(url,{position: list}).then((result)=>{ axios.post(url,{position: list}).then((result)=>{
// this.updasaveNavmoda(result.data.message) if(result!=undefined){
this.updasaveNavmoda() // this.updasaveNavmoda(result.data.message)
// this.updasaveNavmoda()
notification.open({ //
message:"提示", notification.open({
description:result.data.message message:"提示",
}); description:result.data.message
});
}
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })

@ -45,6 +45,12 @@ class Selectsetting extends Component{
componentDidMount() { componentDidMount() {
this.getalldata();
}
getalldata=()=>{
let {discussMessageid} =this.props; let {discussMessageid} =this.props;
let course_id=this.props.course_id; let course_id=this.props.course_id;
let url="/files/"+discussMessageid+".json"; let url="/files/"+discussMessageid+".json";
@ -70,19 +76,10 @@ class Selectsetting extends Component{
console.log(error); console.log(error);
}); });
}
getalldata=()=>{
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if ( prevProps.visible != this.props.visible ) { if ( prevProps.visible != this.props.visible ) {
console.log(prevProps)
console.log(this.props)
this.setState({ this.setState({
visible:this.props.visible visible:this.props.visible
}) })
@ -105,7 +102,6 @@ class Selectsetting extends Component{
ModalSave:this.hidecouseShixunModal, ModalSave:this.hidecouseShixunModal,
loadtype:false loadtype:false
}) })
this.props.Cancel()
} }
savecouseShixunModal=()=>{ savecouseShixunModal=()=>{
@ -152,9 +148,10 @@ class Selectsetting extends Component{
delay_publish:Radiovalue delay_publish:Radiovalue
}).then((result)=>{ }).then((result)=>{
if(result.data.status===0){ if(result.data.status===0){
this.hidecouseShixunModal()
this.props.setupdate(attachmentId) this.props.setupdate(attachmentId)
this.props.showNotification("设置资源成功"); this.props.showNotification("设置资源成功");
this.hidecouseShixunModal() this.props.Cancel()
} }
}) })
@ -233,6 +230,35 @@ class Selectsetting extends Component{
Radiovalue: e.target.value, Radiovalue: e.target.value,
}); });
} }
delectfils=(id)=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确定删除该历史资源?",
ModalSave:()=>this.delectcousedelectfils(id),
ModalCancel:this.hidecouseShixunModal,
loadtype:false
})
}
delectcousedelectfils=(id)=>{
const url = `/attachments/${id}.json`;
axios.delete(url)
.then((response) => {
if (response.data.status == 0) {
// {"status":1,"message":"删除成功"}
this.props.showNotification(response.data.message);
this.getalldata
this.hidecouseShixunModal
}else{
this.props.showNotification(response.data.message);
}
})
.catch(function (error) {
console.log(error);
});
}
render(){ render(){
let {datatime,description,datalist}=this.state; let {datatime,description,datalist}=this.state;
@ -256,7 +282,7 @@ class Selectsetting extends Component{
lineHeight: '30px', lineHeight: '30px',
}; };
console.log(this.state.Radiovalue)
return( return(
<div> <div>
<style> <style>
@ -329,7 +355,7 @@ class Selectsetting extends Component{
height: 37px; height: 37px;
} }
.isabox{ .isabox{
max-width: 173px; max-width:280px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@ -343,7 +369,7 @@ class Selectsetting extends Component{
`}</style> `}</style>
<div className="pl20 pr20 settingbox"> <div className="pl20 pr20 settingbox">
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE"> <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE">
<li className="fl" style={{width: '350px'}}> <li className="fl" style={{width: '343px'}}>
<span className={"isabox"} title={datalist&&datalist.title}> {datalist&&datalist.title} </span> <span className={"isabox"} title={datalist&&datalist.title}> {datalist&&datalist.title} </span>
{datalist&&datalist.attachment_histories.length===0?"":<span className={"newcolor-orange fl"}>当前版本</span>} {datalist&&datalist.attachment_histories.length===0?"":<span className={"newcolor-orange fl"}>当前版本</span>}
</li> </li>
@ -358,7 +384,7 @@ class Selectsetting extends Component{
{datalist&&datalist.attachment_histories.map((item,key)=>{ {datalist&&datalist.attachment_histories.map((item,key)=>{
return( return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}> <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl" style={{width: '350px'}}> <li className="fl" style={{width: '343px'}}>
<span className={"isabox"} title={item.title}> {item.title} </span> <span className={"isabox"} title={item.title}> {item.title} </span>
{/*<span className={"newcolor-orange fl"}>当前版本</span>*/} {/*<span className={"newcolor-orange fl"}>当前版本</span>*/}
</li> </li>
@ -368,6 +394,7 @@ class Selectsetting extends Component{
<li className="fl paddingl10 datastyle"> <li className="fl paddingl10 datastyle">
{moment(item.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(item.created_on).format('YYYY-MM-DD HH:mm')} {moment(item.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(item.created_on).format('YYYY-MM-DD HH:mm')}
</li> </li>
<a className="fr" onClick={()=>this.delectfils(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>
</div> </div>
) )
})} })}
@ -537,7 +564,7 @@ class Selectsetting extends Component{
</div> </div>
<div className="mt20 marginauto clearfix edu-txt-center"> <div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a> <a className="pop_close task-btn mr30 margin-tp26" onClick={()=>this.props.Cancel()}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a> <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
</div> </div>
</div> </div>

@ -19,7 +19,7 @@ class Exercisestatisticalresult extends Component {
super(props); super(props);
this.state = { this.state = {
data:undefined, data:undefined,
sort:"percent", sort:"asc",
exercise_group_id:[], exercise_group_id:[],
page:1, page:1,
limit:10, limit:10,
@ -60,24 +60,28 @@ class Exercisestatisticalresult extends Component {
limit:limit limit:limit
} }
}).then((result) => { }).then((result) => {
// console.log(result)
this.setState({ this.setState({
data:result.data data:result.data
}) })
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
onSortTypeChange=(value)=>{ onSortTypeChange=()=>{
let{exercise_group_id,page,limit}=this.state; let{exercise_group_id,page,limit,sort}=this.state;
let newdesc="asc";
if(sort==="desc"){
newdesc="asc"
}else{
newdesc="desc"
}
this.setState({ this.setState({
sort:value sort:newdesc
}) })
this.updatefun(value,exercise_group_id,page,limit)
this.updatefun(newdesc,exercise_group_id,page,limit)
} }
funtaskstatustwo=(checkedValues,list)=>{ funtaskstatustwo=(checkedValues,list)=>{
@ -172,17 +176,29 @@ class Exercisestatisticalresult extends Component {
.mr33{ .mr33{
margin-right: 33px; margin-right: 33px;
} }
.fiilssort{
position: absolute;
top: -9px;
}
`} `}
</style> </style>
<div className="stud-class-set fafafa"> <div className="stud-class-set fafafa">
<li className="drop_down fr mt10 mr33"> <li className="drop_down fr mt10 mr33 cursor" onClick={() => this.onSortTypeChange()}>
{sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""}<i className="iconfont icon-xiajiantou font-12 ml2"></i> {/*{sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""}*/}
<ul className="drop_down_normal"> {/*<i className="iconfont icon-xiajiantou font-12 ml2"></i>*/}
{sort==='percent'?"":<li onClick={() => this.onSortTypeChange('percent')}>正确率</li>} {/*<ul className="drop_down_normal">*/}
{sort==='type'?"":<li onClick={() => this.onSortTypeChange('type')}>题型</li>} {/*{sort==='percent'?"":<li onClick={() => this.onSortTypeChange('percent')}>正确率</li>}*/}
{sort==='position'?"":<li onClick={() => this.onSortTypeChange('position')}>题序</li>} {/*{sort==='type'?"":<li onClick={() => this.onSortTypeChange('type')}>题型</li>}*/}
</ul> {/*{sort==='position'?"":<li onClick={() => this.onSortTypeChange('position')}>题序</li>}*/}
{/*</ul>*/}
正确率
<sapn className="relativef ml5"style={{"top":"3px"}} >
<i className={sort==="asc"?
"iconfont icon-sanjiaoxing-up font-12 color-blue fiilssort" :"iconfont icon-sanjiaoxing-up font-12 fiilssort"}></i>
<i className={sort==="desc"?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue":"iconfont icon-sanjiaoxing-down font-12 yslbottomsj"}></i>
</sapn>
</li> </li>
</div> </div>

@ -672,7 +672,7 @@ class GraduationTasks extends Component{
</Link> </Link>
</WordsBtn> : ""} </WordsBtn> : ""}
{this.props.isAdmin() ?<UseBank {...this.props} {...this.state} object_type={"gtask"} useBankSuccess={(checkBoxValues,object_ids)=>this.useBankSuccess(checkBoxValues,object_ids)}></UseBank>:""} {/*题库选用 {this.props.isAdmin() ?<UseBank {...this.props} {...this.state} object_type={"gtask"} useBankSuccess={(checkBoxValues,object_ids)=>this.useBankSuccess(checkBoxValues,object_ids)}></UseBank>:""}*/}
</React.Fragment> </React.Fragment>
} }

@ -414,7 +414,7 @@ onBoardsNew=()=>{
{/* 参考普通作业 - 题库选用 */} {/* 参考普通作业 - 题库选用 */}
{/* <WordsBtn style="blue" className="mr30" onClick={()=>this.useFromBank()}>题库选用</WordsBtn> 正式版没有,先隐藏*/} {/* <WordsBtn style="blue" className="mr30" onClick={()=>this.useFromBank()}>题库选用</WordsBtn> 正式版没有,先隐藏*/}
< a className={"fl color-blue mr30 font-16"} onClick={(url)=>this.confirmysl(`/courses/${this.props.match.params.coursesId}/graduation_topics/export.xlsx`)}>导出</a> < a className={"fl color-blue mr30 font-16"} onClick={(url)=>this.confirmysl(`/courses/${this.props.match.params.coursesId}/graduation_topics/export.xlsx`)}>导出</a>
<p className="fl"><UseBank {...this.props} {...this.state} object_type={"gtopic"} useBankSuccess={this.useBankSuccess}></UseBank></p> {/*<p className="fl"><UseBank {...this.props} {...this.state} object_type={"gtopic"} useBankSuccess={this.useBankSuccess}></UseBank></p> 题库选用*/}
<WordsBtn style="blue" className="font-16" onClick={()=>this.onBoardsNew()}>新建</WordsBtn> <WordsBtn style="blue" className="font-16" onClick={()=>this.onBoardsNew()}>新建</WordsBtn>
</React.Fragment>):"" </React.Fragment>):""
} }

@ -273,11 +273,11 @@ class Listofworksstudentone extends Component {
width:'98px', width:'98px',
render: (text, record) => ( render: (text, record) => (
<span style={{width:'98px',}}> <span style={{width:'98px',}}>
<span style={record.submitstate === "延时提交" ? { <span style={record.submitstate === "延时完成" ? {
color: '#DD1717', color: '#DD1717',
textAlign: "center", textAlign: "center",
width:'98px', width:'98px',
} : record.submitstate === "按时提交" ? {color: '#29BD8B', textAlign: "center",width:'98px',} : { } : record.submitstate === "按时完成" ? {color: '#29BD8B', textAlign: "center",width:'98px',} : {
color: '#747A7F', color: '#747A7F',
textAlign: "center", textAlign: "center",
width:'98px', width:'98px',
@ -414,7 +414,7 @@ class Listofworksstudentone extends Component {
) )
}, },
{ {
title: '最终成绩', title: '当前成绩',
dataIndex: 'levelscore', dataIndex: 'levelscore',
key: 'levelscore', key: 'levelscore',
align: "center", align: "center",
@ -625,11 +625,11 @@ class Listofworksstudentone extends Component {
width:'98px', width:'98px',
render: (text, record) => ( render: (text, record) => (
<span style={{width:'98px',}}> <span style={{width:'98px',}}>
<span style={record.submitstate === "延时提交" ? { <span style={record.submitstate === "延时完成" ? {
color: '#DD1717', color: '#DD1717',
textAlign: "center", textAlign: "center",
width:'98px', width:'98px',
} : record.submitstate === "按时提交" ? {color: '#29BD8B', textAlign: "center",width:'98px',} : { } : record.submitstate === "按时完成" ? {color: '#29BD8B', textAlign: "center",width:'98px',} : {
color: '#747A7F', color: '#747A7F',
textAlign: "center", textAlign: "center",
width:'98px', width:'98px',
@ -762,7 +762,7 @@ class Listofworksstudentone extends Component {
) )
}, },
{ {
title: '最终成绩', title: '当前成绩',
dataIndex: 'levelscore', dataIndex: 'levelscore',
key: 'levelscore', key: 'levelscore',
align: "center", align: "center",
@ -918,10 +918,10 @@ class Listofworksstudentone extends Component {
align: 'center', align: 'center',
className:'font-14', className:'font-14',
render: (text, record) => ( render: (text, record) => (
<span style={record.submitstate === "延时提交" ? { <span style={record.submitstate === "延时完成" ? {
color: '#DD1717', color: '#DD1717',
textAlign: "center" textAlign: "center"
} : record.submitstate === "按时提交" ? {color: '#29BD8B', textAlign: "center"} : { } : record.submitstate === "按时完成" ? {color: '#29BD8B', textAlign: "center"} : {
color: '#747A7F', color: '#747A7F',
textAlign: "center" textAlign: "center"
}}>{record.submitstate} }}>{record.submitstate}
@ -1064,7 +1064,7 @@ class Listofworksstudentone extends Component {
) )
}, },
{ {
title: '最终成绩', title: '当前成绩',
dataIndex: 'finalscore', dataIndex: 'finalscore',
key: 'finalscore', key: 'finalscore',
align: 'center', align: 'center',
@ -1103,7 +1103,7 @@ class Listofworksstudentone extends Component {
<div>{record.levelscore === "--"?<span>关卡得分0</span> :<span>{record.levelscore}</span>}</div> <div>{record.levelscore === "--"?<span>关卡得分0</span> :<span>{record.levelscore}</span>}</div>
<div>{record.efficiencyscore === "--"?<span>效率评分0</span> :<span>{record.efficiencyscore}</span>}</div> <div>{record.efficiencyscore === "--"?<span>效率评分0</span> :<span>{record.efficiencyscore}</span>}</div>
<div>{record.late_penalty === "--"?<span>迟交扣分0</span> :<span>{record.late_penalty}</span>}</div> <div>{record.late_penalty === "--"?<span>迟交扣分0</span> :<span>{record.late_penalty}</span>}</div>
<div>{record.finalscore === "--"?<span>最终成绩0</span> :<span>{record.finalscore}</span>}</div> <div>{record.finalscore === "--"?<span>当前成绩0</span> :<span>{record.finalscore}</span>}</div>
</div>}> </div>}>
{ {
record.finalscore&&record.finalscore==="--"? record.finalscore&&record.finalscore==="--"?
@ -1141,7 +1141,7 @@ class Listofworksstudentone extends Component {
record.submitstate === "未提交" ? <span style={{ color: '#9A9A9A'}}>--</span> : record.submitstate === "未提交" ? <span style={{ color: '#9A9A9A'}}>--</span> :
<span> <span>
<a style={{textAlign: "center"}} className="color-blue" <a style={{textAlign: "center"}} className="color-blue"
onClick={() => this.Viewstudenttraininginformationt(record)}>{record.operating}</a> onClick={() => this.Viewstudenttraininginformationt(record)}>评阅</a>
</span> </span>
) )
}, },
@ -1231,10 +1231,10 @@ class Listofworksstudentone extends Component {
align: 'center', align: 'center',
className:'font-14', className:'font-14',
render: (text, record) => ( render: (text, record) => (
<span style={record.submitstate === "延时提交" ? { <span style={record.submitstate === "延时完成" ? {
color: '#DD1717', color: '#DD1717',
textAlign: "center" textAlign: "center"
} : record.submitstate === "按时提交" ? {color: '#29BD8B', textAlign: "center"} : { } : record.submitstate === "按时完成" ? {color: '#29BD8B', textAlign: "center"} : {
color: '#747A7F', color: '#747A7F',
textAlign: "center" textAlign: "center"
}}>{record.submitstate} }}>{record.submitstate}
@ -1370,7 +1370,7 @@ class Listofworksstudentone extends Component {
) )
}, },
{ {
title: '最终成绩', title: '当前成绩',
dataIndex: 'finalscore', dataIndex: 'finalscore',
key: 'finalscore', key: 'finalscore',
align: 'center', align: 'center',
@ -1409,7 +1409,7 @@ class Listofworksstudentone extends Component {
<div>{record.levelscore === "--"?<span>关卡得分0</span> :<span>{record.levelscore}</span>}</div> <div>{record.levelscore === "--"?<span>关卡得分0</span> :<span>{record.levelscore}</span>}</div>
<div>{record.efficiencyscore === "--"?<span>效率评分0</span> :<span>{record.efficiencyscore}</span>}</div> <div>{record.efficiencyscore === "--"?<span>效率评分0</span> :<span>{record.efficiencyscore}</span>}</div>
<div>{record.late_penalty === "--"?<span>迟交扣分0</span> :<span>{record.late_penalty}</span>}</div> <div>{record.late_penalty === "--"?<span>迟交扣分0</span> :<span>{record.late_penalty}</span>}</div>
<div>{record.finalscore === "--"?<span>最终成绩0</span> :<span>{record.finalscore}</span>}</div> <div>{record.finalscore === "--"?<span>当前成绩0</span> :<span>{record.finalscore}</span>}</div>
</div>}> </div>}>
{ {
record.finalscore&&record.finalscore==="--"? record.finalscore&&record.finalscore==="--"?
@ -1619,9 +1619,9 @@ class Listofworksstudentone extends Component {
// console.log(homeworkid); // console.log(homeworkid);
// search:搜索关键字 // search:搜索关键字
// order:排序方式更新时间update_time最终成绩work_score学号student_id // order:排序方式更新时间update_time当前成绩work_score学号student_id
// b_order:desc倒序 asc顺序 // b_order:desc倒序 asc顺序
// work_status:0:未提交, 1:按时提交, 2:延时提交,“”不限 // work_status:0:未提交, 1:按时完成, 2:延时完成,“”不限
// course_group:分班情况 [232, 231] []:不限(空数组) // course_group:分班情况 [232, 231] []:不限(空数组)
var order = "asc"; var order = "asc";
if (ordervlue === "updated_at") { if (ordervlue === "updated_at") {
@ -1696,7 +1696,7 @@ class Listofworksstudentone extends Component {
if(item.title==="效率分") { if(item.title==="效率分") {
continue continue
} }
if(item.title==="最终成绩") { if(item.title==="当前成绩") {
continue continue
} }
if(item.title==="学号") { if(item.title==="学号") {
@ -1733,7 +1733,7 @@ class Listofworksstudentone extends Component {
if(item.title==="效率分") { if(item.title==="效率分") {
continue continue
} }
if(item.title==="最终成绩") { if(item.title==="当前成绩") {
continue continue
} }
if(item.title==="学号") { if(item.title==="学号") {
@ -1789,7 +1789,7 @@ class Listofworksstudentone extends Component {
stduynumber: teacherdata.student_id, stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name, classroom: teacherdata.group_name,
cost_time: teacherdata.cost_time, cost_time: teacherdata.cost_time,
submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时提交" : teacherdata.work_status === 2 ? "延时提交" : "未提交", submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时完成" : teacherdata.work_status === 2 ? "延时完成" : "未提交",
// updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"", // updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata, updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -1830,7 +1830,7 @@ class Listofworksstudentone extends Component {
stduynumber: student_works[i].student_id, stduynumber: student_works[i].student_id,
classroom: student_works[i].group_name, classroom: student_works[i].group_name,
cost_time: student_works[i].cost_time, cost_time: student_works[i].cost_time,
submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时提交" : student_works[i].work_status === 2 ? "延时提交" : "未提交", submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时完成" : student_works[i].work_status === 2 ? "延时完成" : "未提交",
// updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"", // updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata, updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -1884,7 +1884,7 @@ class Listofworksstudentone extends Component {
if(item.title==="效率分") { if(item.title==="效率分") {
continue continue
} }
if(item.title==="最终成绩") { if(item.title==="当前成绩") {
continue continue
} }
if(item.title==="学号") { if(item.title==="学号") {
@ -1919,7 +1919,7 @@ class Listofworksstudentone extends Component {
if(item.title==="效率分") { if(item.title==="效率分") {
continue continue
} }
if(item.title==="最终成绩") { if(item.title==="当前成绩") {
continue continue
} }
if(item.title==="学号") { if(item.title==="学号") {
@ -1972,7 +1972,7 @@ class Listofworksstudentone extends Component {
stduynumber: teacherdata.student_id, stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name, classroom: teacherdata.group_name,
cost_time: teacherdata.cost_time, cost_time: teacherdata.cost_time,
submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时提交" : teacherdata.work_status === 2 ? "延时提交" : "未提交", submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时完成" : teacherdata.work_status === 2 ? "延时完成" : "未提交",
// updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"", // updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata, updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -2119,9 +2119,9 @@ class Listofworksstudentone extends Component {
// console.log(homeworkid); // console.log(homeworkid);
// search:搜索关键字 // search:搜索关键字
// order:排序方式更新时间update_time最终成绩work_score学号student_id // order:排序方式更新时间update_time当前成绩work_score学号student_id
// b_order:desc倒序 asc顺序 // b_order:desc倒序 asc顺序
// work_status:0:未提交, 1:按时提交, 2:延时提交,“”不限 // work_status:0:未提交, 1:按时完成, 2:延时完成,“”不限
// course_group:分班情况 [232, 231] []:不限(空数组) // course_group:分班情况 [232, 231] []:不限(空数组)
var order = "asc"; var order = "asc";
if (ordervlue === "updated_at") { if (ordervlue === "updated_at") {
@ -2319,7 +2319,7 @@ class Listofworksstudentone extends Component {
stduynumber: student_works[i].student_id, stduynumber: student_works[i].student_id,
classroom: student_works[i].group_name, classroom: student_works[i].group_name,
cost_time: student_works[i].cost_time, cost_time: student_works[i].cost_time,
submitstate:student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时提交" :student_works[i].work_status === 2 ? "延时提交" : "未提交", submitstate:student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时完成" :student_works[i].work_status === 2 ? "延时完成" : "未提交",
// updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"", // updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata, updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -2356,7 +2356,7 @@ class Listofworksstudentone extends Component {
if(item.title==="效率分") { if(item.title==="效率分") {
continue continue
} }
if(item.title==="最终成绩") { if(item.title==="当前成绩") {
continue continue
} }
if(item.title==="学号") { if(item.title==="学号") {
@ -2394,7 +2394,7 @@ class Listofworksstudentone extends Component {
if(item.title==="效率分") { if(item.title==="效率分") {
continue continue
} }
if(item.title==="最终成绩") { if(item.title==="当前成绩") {
continue continue
} }
if(item.title==="学号") { if(item.title==="学号") {
@ -2431,7 +2431,7 @@ class Listofworksstudentone extends Component {
if(item.title==="效率分") { if(item.title==="效率分") {
continue continue
} }
if(item.title==="最终成绩") { if(item.title==="当前成绩") {
continue continue
} }
if(item.title==="学号") { if(item.title==="学号") {
@ -2468,7 +2468,7 @@ class Listofworksstudentone extends Component {
if(item.title==="效率分") { if(item.title==="效率分") {
continue continue
} }
if(item.title==="最终成绩") { if(item.title==="当前成绩") {
continue continue
} }
if(item.title==="学号") { if(item.title==="学号") {
@ -2502,7 +2502,7 @@ class Listofworksstudentone extends Component {
if(item.title==="效率分") { if(item.title==="效率分") {
continue continue
} }
if(item.title==="最终成绩") { if(item.title==="当前成绩") {
continue continue
} }
if(item.title==="学号") { if(item.title==="学号") {
@ -3366,7 +3366,7 @@ class Listofworksstudentone extends Component {
<i className="iconfont icon-xiajiantou ml5 font-12 "></i> <i className="iconfont icon-xiajiantou ml5 font-12 "></i>
<ul className="edu-position-hide undis mt10"> <ul className="edu-position-hide undis mt10">
<li> <a onClick={(e) => this.funordert("update_time")} data-remote="true" className=" font-12" style={{textAlign: "center"}}>更新时间</a></li> <li> <a onClick={(e) => this.funordert("update_time")} data-remote="true" className=" font-12" style={{textAlign: "center"}}>更新时间</a></li>
<li> <a onClick={(e) => this.funordert("work_score")} data-remote="true" className=" font-12" style={{textAlign: "center"}}>最终成绩</a></li> <li> <a onClick={(e) => this.funordert("work_score")} data-remote="true" className=" font-12" style={{textAlign: "center"}}>当前成绩</a></li>
<li> <a onClick={(e) => this.funordert("student_id")} data-remote="true" className=" font-12" style={{textAlign: "center"}}>学生学号</a></li> <li> <a onClick={(e) => this.funordert("student_id")} data-remote="true" className=" font-12" style={{textAlign: "center"}}>学生学号</a></li>
</ul> </ul>
</li> </li>

@ -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) {
this.props.showNotification(`${result.data.message}`); try {
this.setState({ this.props.showNotification(`${result.data.message}`);
Showupdateinstructions: false }catch (e) {
})
var homeworkid = this.props.match.params.homeworkid; }
// console.log(homeworkid) try {
this.Gettitleinformation(homeworkid) var homeworkid = this.props.match.params.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{ {/* hr{*/}
display:none; {/* display:none;*/}
} {/* }*/}
` {/* `*/}
} {/* }*/}
</style> {/* </style>*/}
<div className={"font-16 color-dark fl pl20 "} > {/* <div className={"font-16 color-dark fl pl20 "} >*/}
<div className={"markdown-body"} {/* <div className={"markdown-body"}*/}
dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g, "▁▁▁")}}></div> {/* dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g, "▁▁▁")}}></div>*/}
{/* /!*{}}></div>
{/* /!*{jobsettingsdata.data.description}*!/*/} {/* </div>*/}
{/* <textarea>*/} {/* </span>*/}
{/* {*/} {/* </div>}*/}
{/* this.state.namestring*/}
{/* }*/} {/*<div className=" clearfix edu-back-white poll_list pd10">*/}
{/* </textarea>*/} {/*<div className="font-16 color-green fl pl20 mt10">作业说明:</div>*/}
</div> {/*{*/}
{/* <div className="justify break_full_word new_li markdown-body"*/} {/* this.props.isAdmin() && this.props.isAdmin() === true ?*/}
{/* id="challenge_editorMd_description">*/}
{/* <p id="ReactMarkdown" style={{overflow:'hidden'}}>*/} {/* (Showupdateinstructions && Showupdateinstructions === true ? "" :*/}
{/* /!*{ChallengesDataList === undefined ? "" :ChallengesDataList.description===null?""*!/*/} {/* <Tooltip placement="top" title="编辑"><i*/}
{/* <textarea className="w200">*/} {/* className="color-green font-18 iconfont icon-bianjidaibeijing fr pr20 "*/}
{/* {jobsettingsdata.data.description}*/} {/* onClick={() => this.jobdescriptiondisplaybj()}></i></Tooltip>*/}
{/* </textarea>*/} {/* ) : ""*/}
{/* /!*}*!/*/} {/*}*/}
{/* </p>*/}
{/*</div>*/}
{/*</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 ? "" :
<Tooltip placement="top" title="编辑"><i
className="color-green font-18 iconfont icon-bianjidaibeijing fr pr20 "
onClick={() => this.jobdescriptiondisplaybj()}></i></Tooltip>
) : ""
}
</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>
} }

@ -1,76 +1,75 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames' import classNames from 'classnames'
import { getImageUrl, toPath, LinkAfterLogin } from 'educoder' import { getImageUrl, toPath, LinkAfterLogin } from 'educoder'
import match_adImg from '../../images/ad/match_ad.jpg' import match_adImg from '../../images/ad/match_ad.jpg'
const $ = window.$ const $ = window.$
class RightMyPublish extends Component { class RightMyPublish extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
} }
} }
handleKeyPress = (event) => { handleKeyPress = (event) => {
if(event.type !== 'keypress' || event.key == 'Enter'){ if(event.type !== 'keypress' || event.key == 'Enter'){
this.props.setSearchValue( this.props.searchValue, true); this.props.setSearchValue( this.props.searchValue, true);
// $(window).trigger('setSearchValue', $('#shixun_search_input').val()) // $(window).trigger('setSearchValue', $('#shixun_search_input').val())
} }
} }
handleInput = (event) => { handleInput = (event) => {
this.props.setSearchValue(event.target.value); this.props.setSearchValue(event.target.value);
} }
render() { render() {
const { match, history, currentPage, my_memos_count, setSearchValue, searchValue } = this.props const { match, history, currentPage, my_memos_count, setSearchValue, searchValue } = this.props
return ( return (
<React.Fragment> <React.Fragment>
<div className="clearfix edu-back-white padding40-20 publishMemoSection"> <div className="clearfix edu-back-white padding40-20 publishMemoSection">
{/*<div className="searchFor h40 mt15 mb5 ml20"> {/*<div className="searchFor h40 mt15 mb5 ml20">
<div className="searchCon fl"> <div className="searchCon fl">
<input type="text" className="searchinput" name="search" value="" placeholder="请输入帖子标题的关键字进行搜索"> <input type="text" className="searchinput" name="search" value="" placeholder="请输入帖子标题的关键字进行搜索">
</input> </input>
<span className="search_close" onclick="colse_searchbox();" data-tip-down="清除">×</span> <span className="search_close" onclick="colse_searchbox();" data-tip-down="清除">×</span>
</div> </div>
<i className="fa fa-search mr5 fl color-dark-grey search_icon" <i className="fa fa-search mr5 fl color-dark-grey search_icon"
onClick="$('#search_memos').submit();" style={{margin:'8px'}} data-tip-down="搜索"></i> onClick="$('#search_memos').submit();" style={{margin:'8px'}} data-tip-down="搜索"></i>
</div>*/} </div>*/}
<div className="search-new">
<div className="search-new"> <input type="text" className="search-new-input fl" placeholder="搜索您想了解的话题" id="shixun_search_input"
<input type="text" className="search-new-input fl" placeholder="搜索您想了解的话题" id="shixun_search_input" onKeyPress={this.handleKeyPress} onChange={ this.handleInput } value={searchValue}
onKeyPress={this.handleKeyPress} onChange={ this.handleInput } value={searchValue} >
> </input>
</input> <span className="search-span"></span>
<span className="search-span"></span> <img src={getImageUrl("images/educoder/icon/search.svg")} className="fl mt5"
<img src={getImageUrl("images/educoder/icon/search.svg")} className="fl mt5" onClick={ this.handleKeyPress }>
onClick={ this.handleKeyPress }>
</img>
</img> </div>
</div> <LinkAfterLogin {...this.props} to={'/forums/new'} className="sendMyQuestion edu-default-btn edu-blueback-btn edu-txt-center font-16 mb30">发布话题</LinkAfterLogin>
<LinkAfterLogin {...this.props} to={'/forums/new'} className="sendMyQuestion edu-default-btn edu-blueback-btn edu-txt-center font-16 mb30">发布话题</LinkAfterLogin> {/*<p className="edu-txt-center font-16">
{/*<p className="edu-txt-center font-16"> <span>我的发布</span><br/>
<span>我的发布</span><br/> <Link to={`/forums/categories/my_published`} className="color-blue">{my_memos_count}</Link>
<Link to={`/forums/categories/my_published`} className="color-blue">{my_memos_count}</Link> </p>*/}
</p>*/} </div>
</div>
<div className="clearfix edu-back-white advertisement" >
<div className="clearfix edu-back-white advertisement" > <a href="/competitions" target="_blank"><img src={match_adImg}></img></a>
<a href="/competitions" target="_blank"><img src={match_adImg}></img></a> </div>
</div> </React.Fragment>
</React.Fragment> );
); }
} }
}
export default RightMyPublish;
export default RightMyPublish;

@ -111,7 +111,7 @@
} }
.logincloseIcon{ .logincloseIcon{
position: absolute; position: absolute;
top: -100px; top: -100px !important;
right: -27px; right: -27px;
z-index: 100000; z-index: 100000;
} }

@ -955,12 +955,9 @@ submittojoinclass=(value)=>{
{/*<Link to={'/crowdsourcing'}>众包创新</Link>*/} {/*<Link to={'/crowdsourcing'}>众包创新</Link>*/}
{/*</li>*/} {/*</li>*/}
{/*<li className={`${activeForums === true ? 'active' : ''}`}> <Link to={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</Link></li>*/} {/*<li className={`${activeForums === true ? 'active' : ''}`}> <Link to={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</Link></li>*/}
{/*<li*/} <li
{/* style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}}*/} style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth === null ? 'none' : 'block'}}
{/*><a href={this.props.Headertop===undefined?"":this.props.Headertop.auth}>工程认证</a></li>*/} ><a href={this.props.Headertop === undefined ? "" : this.props.Headertop.auth}>工程认证</a></li>
<li className="fl edu-menu-panel careershover " <li className="fl edu-menu-panel careershover "
style={{display: this.props.Headertop === undefined ?'none' : this.props.Headertop.career_url.length > 0 ? 'block' : 'none'}}> style={{display: this.props.Headertop === undefined ?'none' : this.props.Headertop.career_url.length > 0 ? 'block' : 'none'}}>

Loading…
Cancel
Save