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这里仅统计是否回答这个问题的全部人数
#
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 #该问题的全部得分
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
question_answer_infos = []
@ -123,19 +138,19 @@ module ExercisesHelper
standard_answer = ex.exercise_standard_answers.pluck(:exercise_choice_id).sort #标准答案的位置
# right_users_count = 0
# 该问题的正确率
if ex.question_type == Exercise::MULTIPLE #多选题
right_user_ids = user_ids
standard_answer.each do |choice_position|
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)
end
right_users_count = right_user_ids.size
else #单选题和判断题
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
end
# if ex.question_type == Exercise::MULTIPLE #多选题
# right_user_ids = user_ids
# standard_answer.each do |choice_position|
# 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)
# end
# # right_users_count = right_user_ids.size
# else #单选题和判断题
# 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
# 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|
@ -181,7 +196,7 @@ module ExercisesHelper
all_user_count += user_count
standard_answer_count += 1
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 )

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

@ -35,6 +35,8 @@ class UseBank extends Component{
}
}
componentDidMount() {
console.log("UseBank");
console.log(this.props);
}
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 { object_type }=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
console.log("题库选用2222");
console.log("UseBank");
console.log(this.props);
return(
<a>
<style>{`
@ -197,11 +202,21 @@ class UseBank extends Component{
width: 170px !important;
}
.bankwidth{
width:32% !important;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
}
.bankwidth2{
width:24% !important;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
}
.with58{
width:58% !important;
Margin-left:15px
}
`}</style>
@ -279,17 +294,39 @@ class UseBank extends Component{
return (
<p className="clearfix mb7" key={item.id}>
<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>
</span>
<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>
{
nav_my==='public' &&
<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>
)
})}

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

@ -45,6 +45,12 @@ class Selectsetting extends Component{
componentDidMount() {
this.getalldata();
}
getalldata=()=>{
let {discussMessageid} =this.props;
let course_id=this.props.course_id;
let url="/files/"+discussMessageid+".json";
@ -70,19 +76,10 @@ class Selectsetting extends Component{
console.log(error);
});
}
getalldata=()=>{
}
componentDidUpdate = (prevProps) => {
if ( prevProps.visible != this.props.visible ) {
console.log(prevProps)
console.log(this.props)
this.setState({
visible:this.props.visible
})
@ -105,7 +102,6 @@ class Selectsetting extends Component{
ModalSave:this.hidecouseShixunModal,
loadtype:false
})
this.props.Cancel()
}
savecouseShixunModal=()=>{
@ -152,9 +148,10 @@ class Selectsetting extends Component{
delay_publish:Radiovalue
}).then((result)=>{
if(result.data.status===0){
this.hidecouseShixunModal()
this.props.setupdate(attachmentId)
this.props.showNotification("设置资源成功");
this.hidecouseShixunModal()
this.props.Cancel()
}
})
@ -233,6 +230,35 @@ class Selectsetting extends Component{
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(){
let {datatime,description,datalist}=this.state;
@ -256,7 +282,7 @@ class Selectsetting extends Component{
lineHeight: '30px',
};
console.log(this.state.Radiovalue)
return(
<div>
<style>
@ -329,7 +355,7 @@ class Selectsetting extends Component{
height: 37px;
}
.isabox{
max-width: 173px;
max-width:280px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -343,7 +369,7 @@ class Selectsetting extends Component{
`}</style>
<div className="pl20 pr20 settingbox">
<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>
{datalist&&datalist.attachment_histories.length===0?"":<span className={"newcolor-orange fl"}>当前版本</span>}
</li>
@ -358,7 +384,7 @@ class Selectsetting extends Component{
{datalist&&datalist.attachment_histories.map((item,key)=>{
return(
<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={"newcolor-orange fl"}>当前版本</span>*/}
</li>
@ -368,6 +394,7 @@ class Selectsetting extends Component{
<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')}
</li>
<a className="fr" onClick={()=>this.delectfils(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>
</div>
)
})}
@ -537,7 +564,7 @@ class Selectsetting extends Component{
</div>
<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>
</div>
</div>

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

@ -672,7 +672,7 @@ class GraduationTasks extends Component{
</Link>
</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>
}

@ -414,7 +414,7 @@ onBoardsNew=()=>{
{/* 参考普通作业 - 题库选用 */}
{/* <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>
<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>
</React.Fragment>):""
}

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

@ -40,6 +40,7 @@ class ShixunHomeworkPage extends Component {
ModalsBottomval:"是否确认重做?",
ModalsType:false,
mylistisSpin:false,
Showupdateinstructions:false,
}
}
@ -170,6 +171,18 @@ class ShixunHomeworkPage extends Component {
}
bindRef = ref => { this.child = ref }
///////////////教师截止
//编辑作业
Showupdateinstructionsboolfalse (bool) {
this.setState({
Showupdateinstructions:bool
})
}
//开始编辑作业
edenwork = ()=>{
this.setState({
Showupdateinstructions:true
})
}
gotohome=()=>{
// console.log(this.props)
let {jobsettingsdatapage}=this.state
@ -304,6 +317,15 @@ class ShixunHomeworkPage extends Component {
teacherdatapage && teacherdatapage.code_review === true ?
<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"}
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}*/}
{/*/>*/}
{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) === 3 ?<Trainingjobsetting triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>:""}
</Spin>

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

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

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

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

Loading…
Cancel
Save