@ -141,7 +141,7 @@ class Trainingjobsetting extends Component {
// console.log(homeworkid)
let url = ` /homework_commons/ ${ homeworkid } /settings.json ` ;
axios . get ( url ) . then ( ( result ) => {
if ( result . status === 200 ) {
if ( result != undefined ) {
// console.log(result.data.code_review)
// console.log("设置页")
// console.log(JSON.stringify(result))
@ -637,11 +637,12 @@ class Trainingjobsetting extends Component {
//允许补交
onChanges = ( e ) => {
// debugger
// console.log("640");
// console.log(this.state.end_time);
if ( e . target . value === "允许补交" ) {
if ( this . state . end _time !== null && this . state . end _time !== undefined ) {
// console.log(this.state.end_time);
var times = this . state . end_tim e. format ( 'YYYY-MM-DD HH:mm' ) ;
var times = this . state . deadlin e. format ( 'YYYY-MM-DD HH:mm' ) ;
this . setState ( {
late _time : moment ( handleDateString ( times ) ) . add ( 1 , 'months' ) ,
late _times : moment ( handleDateString ( times ) ) . add ( 1 , 'months' ) . format ( 'YYYY-MM-DD HH:mm' ) ,
@ -955,26 +956,60 @@ class Trainingjobsetting extends Component {
disabledEndDate = ( end _time ) => {
const publish _time = this . state . publish _time ;
if ( ! end _time || ! publish _time ) {
// disabledEndDate = (end_time) => {
// const publish_time = this.state.publish_time;
// if (!end_time || !publish_time) {
// return false;
// }
// return end_time.valueOf() <= publish_time.valueOf();
//
// }
// disabledEndDates = (end_time) => {
// const publish_time = this.state.end_time
// if (!end_time || !publish_time) {
// return false;
// }
// console.log("end_time.valueOf()")
// // console.log(end_time.valueOf());
// // console.log(publish_time.valueOf());
// return end_time.valueOf() <= publish_time.valueOf();
//
//
// }
disabledStartDatestart = ( startValue ) => {
const endValue = this . state . end _time
if ( ! startValue || ! endValue ) {
return false ;
}
return end _time . valueOf ( ) <= publish _time . valueOf ( ) ;
var endValues = moment ( endValue ) . subtract ( 1 , 'days' ) ;
return startValue . valueOf ( ) > endValues . valueOf ( ) ;
} ;
}
disabledEndDates = ( end _time ) => {
const publish _time = this . state . end _time
if ( ! end _time || ! publish _time ) {
disabledEndDateend = ( endValue ) => {
const startValue = this . state . publish _time ;
if ( ! endValue || ! startValue ) {
return false ;
}
console . log ( "end_time.valueOf()" )
// console.log(end_time.valueOf());
// console.log(publish_time.valueOf());
return end _time . valueOf ( ) <= publish _time . valueOf ( ) ;
var endValuesys = moment ( startValue ) . subtract ( 1 , 'days' ) ;
return endValue . valueOf ( ) <= endValuesys . valueOf ( ) ;
} ;
disabledEndDateendd = ( endsValue ) => {
const endValues = this . state . end _time
if ( ! endsValue || ! endValues ) {
return false ;
}
var endValuesyss = moment ( endValues ) . subtract ( 1 , 'days' ) ;
return endsValue . valueOf ( ) <= endValuesyss . valueOf ( ) ;
} ;
onChangedata = ( field , value , dateString ) => {
this . setState ( {
[ field ] : handleDateString ( dateString ) ,
@ -1085,7 +1120,10 @@ class Trainingjobsetting extends Component {
// console.log(value);
console . log ( dateString ) ;
// console.log(handleDateString(dateString));
this . onChangedata ( 'publish_time' , value , dateString ) ;
// this.onChangedata('publish_time', value, dateString);
this . setState ( {
publish _time : moment ( handleDateString ( dateString ) )
} )
if ( this . state . allowreplenishment === "允许补交" ) {
this . setState ( {
end _time : moment ( handleDateString ( dateString ) ) . add ( 1 , 'months' ) ,
@ -1123,13 +1161,15 @@ class Trainingjobsetting extends Component {
deadline : undefined ,
} )
} else {
// console.log(moment(value, "YYYY-MM-DD HH:mm"));
// console.log(moment(this.state.publish_time, "YYYY-MM-DD HH:mm"));
if ( moment ( value , "YYYY-MM-DD HH:mm" ) <= moment ( this . state . publish _time , "YYYY-MM-DD HH:mm" ) ) {
this . setState ( {
unit _e _tip : "截止时间不能早于发布时间" ,
p _flag : true ,
borredss : "bor-reds" ,
end _time : undefined ,
deadline : undefined ,
end _time : value . format ( 'YYYY-MM-DD HH:mm' ) ,
deadline : value . format ( 'YYYY-MM-DD HH:mm' ) ,
} )
return
@ -1144,11 +1184,13 @@ class Trainingjobsetting extends Component {
} catch ( e ) {
}
this . onChangedata ( 'end_time' , value , dateString ) ;
// this.onChangedata('end_time', value, dateString);
if ( this . state . allowreplenishment === "允许补交" ) {
this . setState ( {
late _time : moment ( handleDateString ( dateString ) ) . add ( 1 , 'months' ) ,
late _times : moment ( handleDateString ( dateString ) ) . add ( 1 , 'months' ) . format ( 'YYYY-MM-DD HH:mm' ) ,
end _time : moment ( handleDateString ( dateString ) ) ,
deadline : moment ( handleDateString ( dateString ) ) . format ( 'YYYY-MM-DD HH:mm' ) ,
late _time : moment ( handleDateString ( dateString ) ) . add ( 2 , 'months' ) ,
late _times : moment ( handleDateString ( dateString ) ) . add ( 2 , 'months' ) . format ( 'YYYY-MM-DD HH:mm' ) ,
} )
}
@ -1164,7 +1206,7 @@ class Trainingjobsetting extends Component {
} )
return ;
}
let { publish _time , unifiedsetting, rulesdata } = this . state ;
let { publish _time , end_time , unifiedsetting, rulesdata } = this . state ;
if ( unifiedsetting === true ) {
if ( moment ( value , "YYYY-MM-DD HH:mm" ) <= moment ( publish _time ) ) {
@ -1172,20 +1214,30 @@ class Trainingjobsetting extends Component {
hand _ _e _tip : "补交时间不能早于发布时间" ,
hand _flags : true ,
handclass : "bor-reds" ,
late _times : undefined ,
late _time : undefined ,
late _times : value . format ( 'YYYY-MM-DD HH:mm' ) ,
late _time : value . format ( 'YYYY-MM-DD HH:mm' ) ,
} )
} else {
}
else if ( moment ( value , "YYYY-MM-DD HH:mm" ) <= moment ( end _time ) ) {
this . setState ( {
hand _ _e _tip : "补交时间不能早于截止时间" ,
hand _flags : true ,
handclass : "bor-reds" ,
late _times : value . format ( 'YYYY-MM-DD HH:mm' ) ,
late _time : value . format ( 'YYYY-MM-DD HH:mm' ) ,
} )
}
else {
try {
this . setState ( {
late _times : value . format ( 'YYYY-MM-DD HH:mm' ) ,
late _time : value . format ( 'YYYY-MM-DD HH:mm' ) ,
hand _ _e _tip : "" ,
hand _flags : false ,
handclass : "" ,
} )
this . onChangedata ( 'late_time' , value , dateString ) ;
} catch ( e ) {
}
@ -1206,11 +1258,11 @@ class Trainingjobsetting extends Component {
} else {
this . setState ( {
late _times : value . format ( 'YYYY-MM-DD HH:mm' ) ,
late _time : value . format ( 'YYYY-MM-DD HH:mm' ) ,
hand _ _e _tip : "" ,
hand _flags : false ,
handclass : undefined ,
} )
this . onChangedata ( 'late_time' , value , dateString ) ;
}
}
@ -1587,6 +1639,19 @@ class Trainingjobsetting extends Component {
{ this . props . isAdmin ( ) ? this . state . code _review === false ? "" : < Link
to = { ` /courses/ ${ this . state . props . match . params . coursesId } / ${ this . state . shixuntypes } / ${ this . state . props . match . params . homeworkid } /student_work ` } > 代码查重 < / L i n k > : " " }
< style > {
`
. poll _list a . active : after {
content : '' ;
width : 57 px ;
left : 10 px ;
bottom : 0 px ;
height : 2 px ;
background - color : # 4 CACFF ;
position : absolute ;
}
`
} < / s t y l e >
< Link className = "active"
to = { ` /courses/ ${ this . state . props . match . params . coursesId } / ${ this . state . shixuntypes } / ${ this . state . props . match . params . homeworkid } /settings ` }
> 设置 < / L i n k >
@ -1611,7 +1676,7 @@ class Trainingjobsetting extends Component {
< div className = "stud-class-set bor-bottom-greyE edu-back-white" >
< div className = " mt20 pl20" >
< p className = " clearfix " >
< span className = "font-16 fl " style = { { "color" : "#05101A" } } > 发布设置 < span className = "ml15 color-grey-9" style = { { "font-size" : "14px" , "text-align" : "left" } } > ( 课堂管理员、 教师 、 助教拥有设置权限 ) < / s p a n > < / s p a n >
< span className = "font-16 fl " style = { { "color" : "#05101A" } } > 发布设置 < span className = "ml15 color-grey-9" style = { { "font-size" : "14px" , "text-align" : "left" } } > ( 选中则所有分班使用相同的发布设置, 否则各个分班单独设置 ) < / s p a n > < / s p a n >
{
! flagPageEdit && this . props . isAdmin ( ) === true ?
< a className = "fr" onClick = { this . editSetting } > < Tooltip title = "编辑" > < i
@ -1647,7 +1712,7 @@ class Trainingjobsetting extends Component {
< DatePicker
showToday = { false }
id = { "publishtimeid" }
disabledDate = { this . disabled DateTime }
disabledDate = { this . disabled StartDatestart }
disabledTime = { disabledDateTime }
className = { borreds }
showTime = { { format : 'HH:mm' } }
@ -1679,7 +1744,6 @@ class Trainingjobsetting extends Component {
< DatePicker
showToday = { false }
id = { "end_timeid" }
disabledDate = { this . disabledDateTime }
disabledTime = { disabledDateTime }
showTime = { { format : 'HH:mm' } }
className = { borredss }
@ -1712,6 +1776,7 @@ class Trainingjobsetting extends Component {
>
< PollDetailTabForthRules
rules = { rules }
moduleName = { "作业" }
course _group = { rulest }
flagPageEdit = { flagPageEdit }
rulesCheckInfo = { ( info ) => this . rulesCheckInfo ( info ) }
@ -1760,7 +1825,6 @@ class Trainingjobsetting extends Component {
< DatePicker
showToday = { false }
id = { "late_timeid" }
disabledDate = { this . disabledEndDates }
disabledTime = { disabledDateTime }
format = "YYYY-MM-DD HH:mm"
value = { late _time && moment ( late _time , dataformat ) }
@ -1806,7 +1870,7 @@ class Trainingjobsetting extends Component {
< RadioGroup className = "ml60 mt20" onChange = { this . onChangeslevel } value = { this . state . level } >
< Radio style = { radioStyle } disabled = { ! flagPageEdit } className = "c_grey" value = { "扣分" } > 按查看答案级别扣分 < span
className = "color-grey-9 font-14 ml15" style = { { "text-align" : "left" } } > ( 根据学员选择查看的实训答案级别 ( 解题思路 、 完整答案 ) , 扣减相应的分值 ) < / s p a n > < / R a d i o >
className = "color-grey-9 font-14 ml15" style = { { "text-align" : "left" } } > 根据学员选择查看的实训答案级别 ( 解题思路 、 完整答案 ) , 扣减相应的分值 < / s p a n > < / R a d i o >
< Radio style = { radioStyle } disabled = { ! flagPageEdit } className = "c_grey mt15"
value = { "满分" } > 不扣分 < / R a d i o >
< / R a d i o G r o u p >
@ -1820,7 +1884,7 @@ class Trainingjobsetting extends Component {
checked = { this . state . completionefficiencyscore } style = { { "color" : "#666666" } } > 效率分 < span
className = { "font-14 color-grey-9 font-14 ml15" } style = { { "text-align" : "left" } } > ( 选中 , 则学生最终成绩包含效率分 ) < / s p a n > < / C h e c k b o x >
< / d i v >
< div className = "ml80 mt 2 0">
< div className = "ml80 mt 3 0">
< span className = "c_grey mr10" style = { { "color" : "#999999" } } > 分值 < / s p a n >
< InputNumber min = { 0 } disabled = { ! flagPageEdit } max = { 100 } className = "ml10 h40 mr10 color-grey-9"
style = { { width : "100px" , "color" : "#999999" } }
@ -1867,7 +1931,7 @@ class Trainingjobsetting extends Component {
< / d i v >
< / d i v >
{ /*公开设置*/ }
< div className = "stud-class-set bor-bottom-greyE bor-top-greyE edu-back-white mt35 ">
< div className = "stud-class-set bor-top-greyE edu-back-white mt35 pb 5 ">
< div className = " clearfix edu-back-white poll_list mt20" >
< div className = { "font-16 color-dark fl pl20 " } style = { { "color" : "#05101A" } } > 公开设置 < / d i v >
< / d i v >
@ -1879,7 +1943,6 @@ class Trainingjobsetting extends Component {
< / d i v >
< / d i v >