From e74749f4e7620f8298343fe851c65acb1f158812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 17 Jul 2019 18:17:12 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/shixunHomework/Trainingjobsetting.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 411855491..a78acae05 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -361,6 +361,8 @@ class Trainingjobsetting extends Component { return; } else { // 补交结束时间不能早于截止时间 + if(!this.state.flagPageEditsfor ===false){ + if (moment(this.state.late_time, "YYYY-MM-DD HH:mm") <= moment()) { //结束时间小于当前时间 @@ -396,8 +398,7 @@ class Trainingjobsetting extends Component { }) return; } - - + } } } @@ -1946,7 +1947,7 @@ class Trainingjobsetting extends Component { ` } - From ae520fe1585db83055da167937457aab3ae4d973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 17 Jul 2019 18:26:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/Listofworksstudentone.js | 7 +------ .../modules/courses/shixunHomework/ShixunHomeworkPage.js | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index a506ce064..32aa05a0a 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -368,8 +368,6 @@ class Listofworksstudentone extends Component { if(result === undefined){ return } - try { - if (result.status === 200) { if(this.props.isNotMember()===false) { @@ -390,15 +388,12 @@ class Listofworksstudentone extends Component { this.props.Getdataback(result,result.data); if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { this.seacthdata(result.data); - } else { + } else { this.seacthdatas(result.data, result.data.student_works); } } } - }catch (e) { - console.log(e); - } }).catch((error) => { console.log(error); }) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index 1db93c2bd..393d8af05 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -53,6 +53,10 @@ class ShixunHomeworkPage extends Component { } Getdataback = (jobsettingsdata, teacherdata) => { + console.log("56"); + console.log(jobsettingsdata); + console.log(teacherdata); + this.setState({ jobsettingsdata: jobsettingsdata, teacherdata: teacherdata, From 9a8669ae5320a6e7ea163bb607f0559483c3560a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 17 Jul 2019 19:43:01 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/Listofworks.js | 19 ++++++---- .../shixunHomework/Listofworksstudentone.js | 24 +++++++++---- .../shixunHomework/Trainingjobsetting.js | 35 +++++++++++++++++-- 3 files changed, 63 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 7280b0b39..68730b0fe 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -1357,12 +1357,14 @@ class Listofworks extends Component { let url = "/homework_commons/"+homeworkid+"/update_score.json"; axios.get(url).then((response) => { - this.props.showNotification(`${response.data.message}`); + if(response){ + this.props.showNotification(response.data.message); this.setState({ loadingstate: true }) this.Startsorting(this.state.order, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); - }).catch((error) => { + } + }).catch((error) => { console.log(error) }); @@ -1542,11 +1544,16 @@ class Listofworks extends Component {
  • 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} - {this.props.teacherdata&&this.props.teacherdata.publish_immediately===false&&computeTimetype===true?
    + {teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true?
    计算成绩 -
    :
    - 计算成绩 -
    } +
    : +
    + {teacherdata&&teacherdata.homework_status[0]=== "未发布"? "": +
    + 计算成绩 +
    + } +
    }
    diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 32aa05a0a..2ef4621d6 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -985,9 +985,15 @@ class Listofworksstudentone extends Component { {teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"": {computeTimetype===true?
    计算成绩 -
    :
    - 计算成绩 -
    } +
    : +
    + {teacherdata&&teacherdata.homework_status[0]=== "未发布"? "": +
    + 计算成绩 +
    + } +
    + } } @@ -1137,9 +1143,15 @@ class Listofworksstudentone extends Component { {teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"": {computeTimetype===true?
    计算成绩 -
    :
    - 计算成绩 -
    } + : +
    + {teacherdata&&teacherdata.homework_status[0]=== "未发布"? "": +
    + 计算成绩 +
    + } +
    + }
    } diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index a78acae05..0456fe451 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -95,6 +95,7 @@ class Trainingjobsetting extends Component { datasheettwo: undefined, publicwork: undefined, publish_time: undefined, + publish_timebool:false, end_time: undefined, late_time: undefined, endOpen: false, @@ -115,6 +116,8 @@ class Trainingjobsetting extends Component { showmodel:false, code_review:false, testscripttiptype:false, + end_timebool:false, + late_timesbool:false, } // console.log("获取到的值") // console.log("Trainingjobsetting") @@ -217,8 +220,32 @@ class Trainingjobsetting extends Component { } } } + console.log("220"); + var publish_timebools=false; + if(result.data.publish_time){ + publish_timebools= moment(result.data.publish_time,"YYYY-MM-DD HH:mm")<=moment(); + } + console.log("228"); + console.log(publish_timebools); + + var end_timebools =false; + if(result.data.end_time){ + end_timebools == moment(result.data.end_time,"YYYY-MM-DD HH:mm")<=moment(); + } + console.log("233"); + console.log(end_timebools); + var late_timess=false; + if(result.data.late_time){ + late_timess== moment(result.data.end_time,"YYYY-MM-DD HH:mm")<=moment(); + } + console.log("240"); + console.log(late_timess); + this.setState({ + publish_timebool:publish_timebools, + end_timebool:end_timebools, + late_timesbool:late_timess, rules:array, rulest:arrays, rulesdata:rulesdatas, @@ -1737,7 +1764,9 @@ class Trainingjobsetting extends Component { const dataformat = 'YYYY-MM-DD HH:mm'; - let {flagPageEdit,testscripttiptype,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state; + let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state; + console.log(publish_timebool); + console.log(!flagPageEditstwo); const radioStyle = { display: 'block', height: '30px', @@ -1841,7 +1870,7 @@ class Trainingjobsetting extends Component {
    发布时间: - +
    截止时间: - +
    Date: Thu, 18 Jul 2019 09:18:02 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/shixunHomework/Listofworksstudentone.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 2ef4621d6..7d3c37704 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -479,6 +479,7 @@ class Listofworksstudentone extends Component { else if(item.title==="效率分"){ } } + if(this.props.isNotMember()===true&&item.title==="学号") { }else{ @@ -574,8 +575,8 @@ class Listofworksstudentone extends Component { } } - // console.log("554"); - // console.log(columns2); + console.log("554"); + console.log(columns2); this.setState({