From 543262ae3c04d64d25993cbedca3d5d3c3d0dc60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 16 Jul 2019 14:04:24 +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 --- .../courses/shixunHomework/Listofworksstudentone.js | 11 ++++++++--- .../courses/shixunHomework/ShixunHomeworkPage.js | 4 ++-- .../courses/shixunHomework/ShixunStudentWork.js | 2 +- public/react/src/modules/login/EducoderInteresse.js | 1 - public/react/src/modules/user/common.css | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 4cb5aecea..8192e6a17 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -350,6 +350,9 @@ class Listofworksstudentone extends Component { if(result === undefined){ return } + try { + + if (result.status === 200) { if(this.props.isNotMember()===false) { this.setState({ @@ -374,10 +377,12 @@ class Listofworksstudentone extends Component { } } - } - + } + }catch (e) { + console.log(e); + } }).catch((error) => { - console.log(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 029d99c27..e29e97914 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -188,14 +188,14 @@ class ShixunHomeworkPage extends Component { 代码查重 : "" : ""} {this.state.view_report === true ? + to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/shixun_work_report`}> 查看实训报告 : ""} { teacherdata === undefined ? "" : teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" : {teacherdata.commit_des} + href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdata.commit_des} } {teacherdata === undefined ? "" : ( - this.Viewstudenttraininginformation("/courses/"+this.state.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+this.props.match.params.homeworkid+"/review_detail/"+record.operating)} >查看 + this.Viewstudenttraininginformation("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+this.props.match.params.homeworkid+"/review_detail/"+record.operating)} >查看 ) }, diff --git a/public/react/src/modules/login/EducoderInteresse.js b/public/react/src/modules/login/EducoderInteresse.js index ca4ced919..343c6a004 100644 --- a/public/react/src/modules/login/EducoderInteresse.js +++ b/public/react/src/modules/login/EducoderInteresse.js @@ -59,7 +59,6 @@ class EducoderInteresse extends Component { display: "flex", justifyContent: "center", width: "100%", - height: "600px", marginTop: "20px", }}> diff --git a/public/react/src/modules/user/common.css b/public/react/src/modules/user/common.css index 669b78fab..77a3aee7d 100644 --- a/public/react/src/modules/user/common.css +++ b/public/react/src/modules/user/common.css @@ -73,7 +73,7 @@ display: flex; flex-direction:column; margin-left: 73px; - margin-top: 15px; + margin-top: 8px; } .ysldivhomediv2{ width: 110px; From 95ebd4b7094df70555f55d0491387f46df4a2294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 16 Jul 2019 14:06:39 +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 --- .../src/modules/courses/exercise/Testpapersettinghomepage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index be5ab4e52..26f7718ce 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -114,7 +114,6 @@ class Testpapersettinghomepage extends Component{ axios.get(url).then((response) => { console.log(response); - debugger if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ From 15c320d9625fdf4e13049621a6066de0e994484b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 16 Jul 2019 14:26:27 +0800 Subject: [PATCH 3/4] &sec_key=${sec_key} --- public/react/src/modules/page/MainContentContainer.js | 6 +++--- public/react/src/modules/user/account/AccountNav.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/page/MainContentContainer.js b/public/react/src/modules/page/MainContentContainer.js index c343efcf2..534f212a6 100644 --- a/public/react/src/modules/page/MainContentContainer.js +++ b/public/react/src/modules/page/MainContentContainer.js @@ -671,11 +671,11 @@ class MainContentContainer extends Component { // 之前的task_commit方法 gameBuild(fileUpdateResponse, first) { const { st, challenge, output_sets, onRunCodeTestFinish, resetTestSetsExpandedArray, showSnackbar, time_limit, game } = this.props - const { resubmit, content_modified } = fileUpdateResponse.data; + const { resubmit, content_modified, sec_key } = fileUpdateResponse.data; const timeOut = time_limit; // http://localhost:3000/myshixuns/so5w6iap97/stages/zl6kx8f7vfpo/game_build?first=1&resubmit=GDBEX741_1993 // const game_build_url = `${locationPath}/game_build?first=${first}&resubmit=${resubmit}&content_modified=${content_modified}` - const game_build_url = `/tasks/${game.identifier}/game_build.json?first=${first}&resubmit=${resubmit}&content_modified=${content_modified}` + const game_build_url = `/tasks/${game.identifier}/game_build.json?first=${first}&resubmit=${resubmit}&content_modified=${content_modified}&sec_key=${sec_key}` // var timeOut = parseInt(<%= @myshixun.main_mirror.try(:time_limit) %>); // 超时参数 @@ -702,7 +702,7 @@ class MainContentContainer extends Component { var gameStatusIntervalId = setInterval(()=>{ // let game_status_url = `${locationPath}/game_status?port=${port}&resubmit=${resubmit||""}&time_out=${timeOutFlag}` - let game_status_url = `/tasks/${game.identifier}/game_status.json?port=${port}&resubmit=${resubmit||""}&time_out=${timeOutFlag}` + let game_status_url = `/tasks/${game.identifier}/game_status.json?port=${port}&resubmit=${resubmit||""}&time_out=${timeOutFlag}&sec_key=${sec_key}` axios.get(game_status_url, { // withCredentials: true, diff --git a/public/react/src/modules/user/account/AccountNav.js b/public/react/src/modules/user/account/AccountNav.js index cf6d4ca06..3e2b66d7c 100644 --- a/public/react/src/modules/user/account/AccountNav.js +++ b/public/react/src/modules/user/account/AccountNav.js @@ -16,7 +16,7 @@ class AccountNav extends Component { let { basicInfo } = this.props console.log(this.props); const path = window.location.pathname - const isBasic = path.indexOf('basic') != -1 || path == "/account" + const isBasic = path.indexOf('profile') != -1 || path == "/account" const isCertification = path.indexOf('certification') != -1 const isSecure = path.indexOf('secure') != -1 return ( From c216bdf27a7f66e7637331199e0c16062d4daa14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 16 Jul 2019 14:43:00 +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 --- .../exercise/Testpapersettinghomepage.js | 17 +++++++++++------ .../courses/shixunHomework/Listofworks.js | 7 ------- .../courses/shixunHomework/ShixunStudentWork.js | 7 ------- .../courses/shixunHomework/ShixunWorkReport.js | 6 ------ .../shixunHomework/Trainingjobsetting.js | 7 +------ .../shixunHomework/Workquestionandanswer.js | 6 ------ .../react/src/modules/modals/DownloadMessage.js | 8 +++++++- 7 files changed, 19 insertions(+), 39 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index 26f7718ce..81d5a6a27 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -169,12 +169,17 @@ class Testpapersettinghomepage extends Component{ Loadtype:false }) } - + DownloadType=()=>{ + this.setState({ + DownloadType:false, + DownloadMessageval:undefined + }) + } Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) + this.setState({ + DownloadType:false, + DownloadMessageval:undefined + }) } render(){ let {tab,visible,Commonheadofthetestpaper}=this.state; @@ -187,7 +192,7 @@ class Testpapersettinghomepage extends Component{ {...this.props} value={this.state.DownloadMessageval} modalCancel={this.Downloadcal} - modalsType={this.state.DownloadType} + modalsType={this.DownloadType} />
{/* 公用的提示弹框 */} diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index d92848219..cf8a087ec 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -1360,13 +1360,6 @@ class Listofworks extends Component { // }); } - Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) - } - ChangeTab=(e)=>{ this.props.ChangeTab(e); } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 3a2ebccd5..17e51258f 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -501,13 +501,6 @@ class ShixunStudentWork extends Component { // console.log(error) // }); } - - Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) - } ChangeTab=(e)=>{ this.props.ChangeTab(e); } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 03630725d..b19821e53 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -94,12 +94,6 @@ class ShixunWorkReport extends Component { } } } - Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) - } render() { let{data} =this.state; let category_id=data===undefined?"":data.category.category_id; diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 2bfe2091e..ae1058d8a 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1714,12 +1714,7 @@ class Trainingjobsetting extends Component { // }); } - Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) - } + testscripttip =(e)=>{ if(e === 0){ this.setState({ diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index 01c3088f4..52a214b7e 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -344,12 +344,6 @@ class Workquestionandanswer extends Component { // console.log(error) // }); } - Downloadcal=()=>{ - this.setState({ - DownloadType:false, - DownloadMessageval:undefined - }) - } ChangeTab=(e)=>{ this.props.ChangeTab(e); } diff --git a/public/react/src/modules/modals/DownloadMessage.js b/public/react/src/modules/modals/DownloadMessage.js index e1b217151..d14fccb1e 100644 --- a/public/react/src/modules/modals/DownloadMessage.js +++ b/public/react/src/modules/modals/DownloadMessage.js @@ -19,7 +19,13 @@ class DownloadMessage extends Component { this.modalCancel(); window.open(`/users/${this.props.user.login}/private_messages`) } - + + DownloadType=()=>{ + this.setState({ + DownloadType:false, + DownloadMessageval:undefined + }) + } Downloadcal=()=>{ this.setState({ DownloadType:false,