From 070aa17b450a3ea4f79f6214da12e80742710fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 7 Sep 2019 15:05:49 +0800 Subject: [PATCH 01/54] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 97 +------------------ 1 file changed, 5 insertions(+), 92 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 2253cc1f3..272cdcd50 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2553,9 +2553,9 @@ class Listofworksstudentone extends Component { let course_is_end = this.props.current_user&&this.props.current_user.course_is_end; // if(this.props.isAdmin() === false){ - // if(teacherdata.student_works!==undefined){ - // if(teacherdata.student_works.length>0){ - // + // if(teacherdata&&teacherdata.student_works){ + // if(teacherdata&&teacherdata.student_works.length>0){ + // console.log("这是双层页面。。。。"); // // } // } @@ -3243,42 +3243,9 @@ class Listofworksstudentone extends Component { :"") } } - {/* {teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":*/} - {/*{computeTimetype===true?*/} - {/* (this.props.isNotMember()===false?
*/} - {/* 查看最新成绩*/} - {/*
:""):*/} - {/* teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/} - {/* (this.props.isNotMember()===false?
*/} - {/* 查看最新成绩*/} - {/*
:"")*/} - {/*}*/} - {/*
}*/} - - {/*因为计算按钮占了和这个位置,和设计沟通学生视角取消这个按钮*/} - {/*
*/} - {/**/} - {/*
*/} - - - +s -
+
- {data === undefined ? "" : } {JSON.stringify(datas) === "[]" ? @@ -2749,15 +2822,15 @@ class Studentshavecompletedthelist extends Component {
{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.answer_users}已交{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.answer_users}已交 {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.unanswer_users}未交 + style={{color: "#666666"}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.unanswer_users}未交 {Teacherliststudentlist && Teacherliststudentlist.exercise_types.exercise_end_time === "--" ? "" : - 剩余提交时间:} + 剩余提交时间:} {Teacherliststudentlist && Teacherliststudentlist.exercise_types.exercise_end_time === "--" ? "" : {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_end_time}} + style={{color: '#FF6800'}}> {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_end_time}}
Date: Mon, 9 Sep 2019 14:45:35 +0800 Subject: [PATCH 09/54] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Studentshavecompletedthelist.js | 62 +++++++++---------- .../courses/exercise/yslexercisetable.css | 18 +++++- 2 files changed, 47 insertions(+), 33 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 84ee5eb56..1e2c9702b 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -108,29 +108,29 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'stduynumber', key: 'stduynumber', align: 'center', - className: "edu-txt-center font-14 maxnamewidth145", - width:'145px', + className: "edu-txt-center font-14 maxnamewidth175", + width:'175px', render: (text, record) => ( - {record.stduynumber === null ? -- : record.stduynumber === "" ? -- : - {record.stduynumber} } @@ -142,27 +142,27 @@ class Studentshavecompletedthelist extends Component { key: 'classroom', dataIndex: 'classroom', align: 'center', - className: "edu-txt-center font-14 maxnamewidth145", - width:'145px', + className: "edu-txt-center font-14 maxnamewidth255", + width:'255px', render: (text, record) => ( - + {record.classroom === null ? -- : record.classroom === "" ? -- : - {record.classroom} } @@ -366,30 +366,30 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'stduynumber', key: 'stduynumber', align: 'center', - className: "edu-txt-center tabletd font-14 maxnamewidth145", - width:'145px', + className: "edu-txt-center tabletd font-14 maxnamewidth175", + width:'175px', render: (text, record) => ( - {record.stduynumber === null ? -- : record.stduynumber === "" ? -- : - {record.stduynumber} } @@ -401,27 +401,27 @@ class Studentshavecompletedthelist extends Component { key: 'classroom', dataIndex: 'classroom', align: 'center', - className: "edu-txt-center tabletd font-14 maxnamewidth145", - width:'145px', + className: "edu-txt-center tabletd font-14 maxnamewidth255", + width:'255px', render: (text, record) => ( - {record.classroom === null ? --: record.classroom === "" ? --: - {record.classroom} } diff --git a/public/react/src/modules/courses/exercise/yslexercisetable.css b/public/react/src/modules/courses/exercise/yslexercisetable.css index 42810b7de..2727ca2ff 100644 --- a/public/react/src/modules/courses/exercise/yslexercisetable.css +++ b/public/react/src/modules/courses/exercise/yslexercisetable.css @@ -26,8 +26,22 @@ white-space:nowrap; cursor: default; } -.maxnamewidth145{ - max-width: 145px; +.maxnamewidth215{ + max-width: 215px; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + cursor: default; +} +.maxnamewidth255{ + max-width: 255px; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + cursor: default; +} +.maxnamewidth175{ + max-width: 175px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; From bd46760cba016b0f9f4c7cda4387bc85ba08cbd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 9 Sep 2019 15:03:44 +0800 Subject: [PATCH 10/54] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Studentshavecompletedthelist.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 1e2c9702b..60065f43e 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -97,7 +97,7 @@ class Studentshavecompletedthelist extends Component { {record.name === "--" ? {record.name} : - {record.name} + {record.name} } @@ -127,11 +127,11 @@ class Studentshavecompletedthelist extends Component { textAlign: "center", width:'175px', }}>-- : - {record.stduynumber} + }} title={record.stduynumber}>{record.stduynumber} } @@ -159,11 +159,11 @@ class Studentshavecompletedthelist extends Component { textAlign: "center", width:'255px', }}>-- : - {record.classroom} + }} title={record.classroom}>{record.classroom} } @@ -386,11 +386,11 @@ class Studentshavecompletedthelist extends Component { width:'175px', }}>-- : - {record.stduynumber} + }} title={record.stduynumber}>{record.stduynumber} } @@ -418,11 +418,11 @@ class Studentshavecompletedthelist extends Component { textAlign: "center", width:'255px', }}>--: - {record.classroom} + }} title={record.classroom}>{record.classroom} } From 56da2248633346a300e22e8189bb4770a489ee43 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:12:43 +0800 Subject: [PATCH 11/54] secret_repository_tab={true} --- public/react/src/modules/tpm/TPMIndex.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/react/src/modules/tpm/TPMIndex.js b/public/react/src/modules/tpm/TPMIndex.js index 2cbcd8cb4..67779af8d 100644 --- a/public/react/src/modules/tpm/TPMIndex.js +++ b/public/react/src/modules/tpm/TPMIndex.js @@ -287,6 +287,10 @@ class TPMIndex extends Component { (props) => () }> + () + }> ( Date: Mon, 9 Sep 2019 19:15:23 +0800 Subject: [PATCH 12/54] sendgetfilepath --- .../src/modules/tpm/component/modal/RepositoryChooseModal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js index 0f1043ef9..e37cc3cf0 100644 --- a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js +++ b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js @@ -87,6 +87,9 @@ function RepositoryChooseModal(props) { const goblakepath=(path,key)=>{ } + } + function sendgetfilepath() { + } return ( { return( - goblakepath(item.path,key,item)}>{item.val} + // goblakepath(item.path,key,item)}>{item.val} ) }) } From ebd05488d1ce5ef034911242058abfd4d0acf422 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:17:22 +0800 Subject: [PATCH 13/54] goblakepath --- .../component/modal/RepositoryChooseModal.js | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js index e37cc3cf0..58839f334 100644 --- a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js +++ b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js @@ -37,7 +37,7 @@ function RepositoryChooseModal(props) { const path = item || key ? newPathArray[newPathArray.length - 1] : '' - let id = this.props.match.params.shixunId; + let id = props.match.params.shixunId; let url ="/shixuns/"+id+"/repository.json"; axios.post(url,{ path: path @@ -55,7 +55,8 @@ function RepositoryChooseModal(props) { }); } const savegetfilepath=(value)=>{ - let {selectpath,saveshixunfilepath,pathtype} = this.state + const state = {} + let {selectpath,saveshixunfilepath,pathtype} = state if(pathtype===1){ let newselectpath; @@ -78,18 +79,19 @@ function RepositoryChooseModal(props) { newselectpath=selectpath } } - this.setState({ - // selectpatharr:newarr, - selectpath: newselectpath, + // this.setState({ + // // selectpatharr:newarr, + // selectpath: newselectpath, - }) + // }) } - const goblakepath=(path,key)=>{ + + } + const goblakepath=(path,key)=>{ - } } function sendgetfilepath() { - + } return ( { return( - // goblakepath(item.path,key,item)}>{item.val} + goblakepath(item.path,key,item)}>{item.val} ) }) } @@ -133,7 +135,7 @@ function RepositoryChooseModal(props) { this.saveselectpath(e)} + onInput={(e)=>saveselectpath(e)} value={path}/> From 7529f1c2bcd103779ea3ece670081bd31419b1da Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:23:18 +0800 Subject: [PATCH 14/54] secret_repository --- .../react/src/modules/tpm/shixunchild/Repository/Repository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js index e80b06b21..807eeaaf9 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js @@ -188,7 +188,7 @@ class Repository extends Component { {commits===undefined?"":commits[0].time} :{commits===undefined?"":commits[0].title} - 提交记录 From b3c3c0f148eabf3ca78f625896758bfd6bc83afe Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:23:31 +0800 Subject: [PATCH 15/54] secret_repository --- .../react/src/modules/tpm/shixunchild/Repository/Repository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js index 807eeaaf9..58379b1e8 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js @@ -188,7 +188,7 @@ class Repository extends Component { {commits===undefined?"":commits[0].time} :{commits===undefined?"":commits[0].title} - 提交记录 From c71e1a99648ba274731bc4ec142b6c7ab0b5f4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 19:27:53 +0800 Subject: [PATCH 16/54] =?UTF-8?q?=E8=AF=84=E9=98=85=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/AppraiseModal.js | 36 ++-- .../shixunHomework/ShixunWorkReport.js | 191 +++++++++++------- .../shixunHomework/ShowAppraiseList.js | 172 ++++++++++++++++ .../OfficialAcademicTranscript.js | 2 +- 4 files changed, 315 insertions(+), 86 deletions(-) create mode 100644 public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js diff --git a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js index 1a8c6cc75..9d1efa5b0 100644 --- a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js +++ b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js @@ -10,7 +10,6 @@ class AppraiseModal extends Component{ group_ids:[], fileList:[], Inputsval:undefined, - valuetype:0, textareavaltype:false, comment:undefined, hidden_comment:undefined @@ -18,11 +17,23 @@ class AppraiseModal extends Component{ } componentDidMount() { - - this.setState({ - valuetype:this.props.work_type===undefined?0:this.props.work_type, - textareaval:this.props.work_comment, - }) + let{data,work_comment,work_comment_hidden}=this.props; + + if(this.props.showAppraisetype==="child"){ + data.stage_list.map((item,key)=>{ + if(this.props.challenge_id===item.challenge_id){ + this.setState({ + comment:item.challenge_comment, + hidden_comment:item.challenge_comment_hidden, + }) + } + }) + }else{ + this.setState({ + comment:work_comment, + hidden_comment:work_comment_hidden, + }) + } } @@ -38,11 +49,10 @@ class AppraiseModal extends Component{ }) } Saves=()=>{ - let{textareaval,valuetype,comment,hidden_comment}=this.state; + let{comment,hidden_comment}=this.state; let commenttype=comment===undefined||comment===null||comment===""; let hidden_commenttype=hidden_comment===undefined||hidden_comment===null||hidden_comment===""; - if(commenttype===true&&hidden_commenttype===true){ this.setState({ textareavaltype:true @@ -50,20 +60,20 @@ class AppraiseModal extends Component{ return } - //comment 是 text 可见的评阅内容 // hidden_comment 是 text 不可见的评阅内容 // challenge_id 否 int 关卡id(关卡评阅才需传关卡id) - + let challenge_id=this.props.showAppraisetype==="child"?this.props.challenge_id:undefined let url=`/student_works/${this.props.match.params.homeworkid}/shixun_work_comment.json` axios.post(url, { - comment:textareaval, - hidden_comment:valuetype + comment:comment, + hidden_comment:hidden_comment, + challenge_id:challenge_id }).then((response) => { if(response.data.status===0){ this.props.showNotification(response.data.message) - this.props.showCancel(textareaval,valuetype) + this.props.showCancel(comment,hidden_comment,challenge_id) }else{ this.props.showNotification(response.data.message) } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 31e749867..374aef8d4 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -11,6 +11,7 @@ import Coursesshixundetails from './shixunreport/Coursesshixundetails'; import Shixunechart from './shixunreport/Shixunechart'; import DownloadMessageysl from "../../modals/DownloadMessageysl" import AppraiseModal from "../coursesPublic/AppraiseModal"; +import ShowAppraiseList from './ShowAppraiseList'; import {UnControlled as CodeMirror} from 'react-codemirror2'; import 'codemirror/mode/cmake/cmake'; import 'codemirror/mode/xml/xml'; @@ -34,9 +35,8 @@ class ShixunWorkReport extends Component { DownloadMessageval:undefined, isspinning:false, showAppraiseModaltype:false, - work_comment_hidden:false, - showAppraiseModalsshow:true, - work_comment:null + work_comment_hidden:undefined, + work_comment:undefined, } } @@ -102,7 +102,7 @@ class ShixunWorkReport extends Component { let homeworkid=this.props.match.params.homeworkid; let url = `/student_works/${homeworkid}/shixun_work_report.json` axios.get(url).then((result) => { - if (result.data.status === 403||result.data.status === 401||result.data.status === 407||result.data.status === 408||result.data.status === 409) { + if (result.data.status === 403 || result.data.status === 401 || result.data.status === 407 || result.data.status === 408|| result.data.status === 409 || result.data.status === 500) { }else{ this.setState({ @@ -155,76 +155,138 @@ class ShixunWorkReport extends Component { }) } - showAppraiseModal=(type,id)=>{ + showAppraiseModal=(type,id,show,hidden)=>{ + let{data}=this.state; + debugger if(type==="child"){ + data.stage_list.forEach((item,key)=>{ + if(item.challenge_id===id){ + item.challenge_comment=show; + item.challenge_comment_hidden=hidden; + } + }) this.setState({ + showAppraiseModaltype:true, showAppraisetype:type, - challenge_id:id + challenge_id:id, + data:data }) }else{ this.setState({ + showAppraiseModaltype:true, showAppraisetype:type, - challenge_id:undefined + challenge_id:undefined, + work_comment:show, + work_comment_hidden:hidden }) } - - let{work_comment,work_comment_hidden}=this.state; - this.setState({ - showAppraiseModaltype:true, - work_comment_hidden:work_comment===null||work_comment===undefined?this.state.work_type?true:false:work_comment_hidden, - }) } hideAppraiseModal=()=>{ - let{work_comment,work_comment_hidden}=this.state; this.setState({ showAppraiseModaltype:false, - work_comment_hidden:work_comment===null||work_comment===undefined?this.state.work_type===1?true:false:work_comment_hidden, }) } - showAppraiseModals=(list,type)=>{ + showAppraiseModals=(show,hidden,id)=>{ + + let{data,showAppraisetype}=this.state; + + debugger + if(showAppraisetype==="child"){ + data.stage_list.forEach((item,key)=>{ + if(item.challenge_id===id){ + item.challenge_comment=show; + item.challenge_comment_hidden=hidden; + } + }) + this.setState({ + showAppraiseModaltype:false, + data:data + }) + }else{ + this.setState({ + showAppraiseModaltype:false, + work_comment:show, + work_comment_hidden:hidden + }) + } - this.setState({ - showAppraiseModaltype:false, - work_comment_hidden:type===0?false:true, - work_comment:list, - work_type:type, - showAppraiseModals:true, - showAppraiseModalsshow:true, - }) } - isdeleteModal=()=>{ + isdeleteModal=(comment_id,visible_comment)=>{ this.setState({ modalsType: true, modalsTopval:"是否确认删除?", - modalSave: ()=>this.isdeleteModals(), - modalCancel:()=>this.hideisdeleteModal(), + modalSave: ()=>this.isdeleteModals(comment_id,visible_comment), + modalCancel:()=>this.hideisdeleteModals(), }) } - hideisdeleteModal=()=>{ + hideisdeleteModals=()=>{ this.setState({ - modalsType: false, + modalsType:false, modalsTopval:"是否确认删除?", - modalSave: ()=>this.isdeleteModals(), - modalCancel:()=>this.hideisdeleteModal(), + modalSave: "", + modalCancel:"", }) } - isdeleteModals=()=>{ + + hideisdeleteModal=(comment_id,visible_comment)=>{ + + + let{data,work_comment,work_comment_hidden,showAppraisetype}=this.state; + if(showAppraisetype==="child"){ + data.stage_list.forEach((item,key)=>{ + if(item.comment_id===comment_id){ + if(visible_comment===true){ + item.challenge_comment=null; + }else{ + item.challenge_comment_hidden=null; + } + } + }) + this.setState({ + modalsType:false, + modalsTopval:"是否确认删除?", + modalSave: "", + modalCancel:"", + data:data + }) + }else{ + if(visible_comment===true){ + this.setState({ + modalsType:false, + modalsTopval:"是否确认删除?", + modalSave: "", + modalCancel:"", + work_comment:visible_comment===true?null:work_comment, + }) + }else{ + this.setState({ + modalsType:false, + modalsTopval:"是否确认删除?", + modalSave: "", + modalCancel:"", + work_comment_hidden:visible_comment===false?null:work_comment_hidden + }) + } + + } + + } + + isdeleteModals=(comment_id,visible_comment)=>{ let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json` - axios.delete(url).then((response) => { + axios.delete(url, { data: { + comment_id:comment_id, + visible_comment:visible_comment + }}).then((response) => { // const { status } = response.data; if(response.data.status===0){ this.props.showNotification(response.data.message) - this.setState({ - showAppraiseModalsshow:false, - work_comment_hidden:false, - work_comment:undefined, - work_type:0, - }) - this.hideisdeleteModal() + + this.hideisdeleteModal(comment_id,visible_comment) }else{ this.props.showNotification(response.data.message) } @@ -234,7 +296,7 @@ class ShixunWorkReport extends Component { }); } render() { - let{data,showAppraiseModaltype,work_comment_hidden,showAppraiseModalsshow,work_comment} =this.state; + let{data,showAppraiseModaltype,work_comment_hidden,work_comment} =this.state; let category_id=data===undefined?"":data.category===null?"":data.category.category_id; let homework_common_id=data===undefined?"":data.homework_common_id; @@ -243,7 +305,9 @@ class ShixunWorkReport extends Component { // let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment===null||work_comment===undefined?false:true:work_comment===null||work_comment===undefined?false:true; let showAppraiseModals=work_comment===null||work_comment===undefined?false:true; - console.log(showAppraiseModals) + console.log(data) + console.log(work_comment_hidden) + console.log(work_comment) return ( data===undefined?"": @@ -262,10 +326,12 @@ class ShixunWorkReport extends Component { {...this.state} visible={showAppraiseModaltype} Cancel={()=>this.hideAppraiseModal()} - showCancel={(list,type)=>this.showAppraiseModals(list,type)} + showCancel={(show,hidden,id)=>this.showAppraiseModals(show,hidden,id)} work_comment={this.state.work_comment} work_type={work_comment===null||work_comment===undefined?this.state.work_type:work_comment_hidden===true?1:0} />:""} + +
+ + {/*{work_comment===null||work_comment===undefined?"评阅":"编辑评阅"}*/} + {data===undefined?"":work_comment===undefined||work_comment===null||work_comment===""?"": +
+
+ +
+ 总体评阅评阅内容 + + {this.props&&this.props.isAdminOrTeacher()===true?this.props.isdeleteModal(data.comment_id,true)} + >删除:""} + + {this.props&&this.props.isAdminOrTeacher()===true?this.props.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)} + >编辑:""} + +
+ +
+
+
+
+
+
+
+ +
+
} + + + + {data===undefined?"":work_comment_hidden===undefined||work_comment_hidden===null||work_comment_hidden===""?"":this.props&&this.props.isAdminOrTeacher()===true? +
+
+ +
+ 总体评阅评阅内容(仅对课堂老师可见) + + {this.props&&this.props.isAdminOrTeacher()===true?this.props.isdeleteModal(data.comment_id,false)} + >删除:""} + + {this.props&&this.props.isAdminOrTeacher()===true?this.props.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)} + >编辑:""} + +
+ +
+
+
+
+
+
+
+ +
+
:""} + + + + {data===undefined?"":data.stage_list.map((item,key)=>{ + let challenge_comment_hidden=item.challenge_comment_hidden===undefined||item.challenge_comment_hidden===null||item.challenge_comment_hidden===""; + let challenge_comment=item.challenge_comment===undefined||item.challenge_comment===null||item.challenge_comment===""; + return( +
+ {challenge_comment===false?
+
+ +
+ 第{key+1}关评阅内容 + {this.props&&this.props.isAdminOrTeacher()===true?this.props.isdeleteModal(item.comment_id,true)} + >删除:""} + + {this.props&&this.props.isAdminOrTeacher()===true?this.props.showAppraiseModal("child",item.challenge_id,item.challenge_comment,item.challenge_comment_hidden)} + >编辑:""} +
+
+
+
+
+
+
+
+ +
+
:""} + + + {challenge_comment_hidden===false&&this.props&&this.props.isAdminOrTeacher()===true?
+
+
+ 第{key+1}关评阅内容(仅对课堂老师可见) + + {this.props&&this.props.isAdminOrTeacher()===true?this.props.isdeleteModal(item.comment_id,false)} + >删除:""} + + {this.props&&this.props.isAdminOrTeacher()===true?this.props.showAppraiseModal("child",item.challenge_id,item.challenge_comment,item.challenge_comment_hidden)} + >编辑:""} +
+
+
+
+
+
+
+
+ +
+
:""} + +
) + }) + } + + +
+ ) + } +} +export default ShowAppraiseList; + diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index fe88ef87d..0cb75dee3 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -207,7 +207,7 @@ class OfficialAcademicTranscript extends Component { render: (text, record) => ( - {console.log(record)} + this.props.showAppraiseModal("child",record.challenge_id.id,record.challenge_comment,record.challenge_comment_hidden)} From 971276504b2c559b55b614aac7acfccda92f1afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 19:29:19 +0800 Subject: [PATCH 17/54] bd --- .../paths/PathDetail/PathDetailIndex.js | 832 +++++++++--------- .../modules/tpm/component/TPMRightSection.js | 368 ++++---- 2 files changed, 600 insertions(+), 600 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index f432c18b2..bd7b02e7d 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -14,24 +14,24 @@ import TPMRightSection from "../../tpm/component/TPMRightSection"; import styled from "styled-components"; const getItemStyle = (isDragging, draggableStyle) => ({ - // change background colour if dragging - background: isDragging ? '#dceeff' : '', - // styles we need to apply on draggables - ...draggableStyle, + // change background colour if dragging + background: isDragging ? '#dceeff' : '', + // styles we need to apply on draggables + ...draggableStyle, }); const getItems = count => - Array.from({ length: count }, (v, k) => k).map(k => ({ - id: `item-${k}`, - content: `item ${k}` - })); + Array.from({ length: count }, (v, k) => k).map(k => ({ + id: `item-${k}`, + content: `item ${k}` + })); // a little function to help us with reordering the result const reorder = (list, startIndex, endIndex) => { - const result = Array.from(list); - const [removed] = result.splice(startIndex, 1); - result.splice(endIndex, 0, removed); + const result = Array.from(list); + const [removed] = result.splice(startIndex, 1); + result.splice(endIndex, 0, removed); - return result; + return result; }; const List = styled.div` @@ -66,90 +66,90 @@ const DragHandle = styled.div` `; const $ =window.$ class PathDetailIndex extends Component{ - constructor(props){ - super(props) - this.state={ + constructor(props){ + super(props) + this.state={ progress:undefined, tags:undefined, members:undefined, - detailInfoList:undefined, - clickdetailInfoListtype:false, - Modalstype:false, - Modalstopval:undefined, - Modalsbottomval:undefined, - cardsModalcancel:this.cardsModalcancel, - cardsModalsave:this.cardsModalsave, - user_id:undefined, - loadtype:false, + detailInfoList:undefined, + clickdetailInfoListtype:false, + Modalstype:false, + Modalstopval:undefined, + Modalsbottomval:undefined, + cardsModalcancel:this.cardsModalcancel, + cardsModalsave:this.cardsModalsave, + user_id:undefined, + loadtype:false, courses:undefined, - items: getItems(10), + items: getItems(10), pathtopskey:1 - } - this.onDragEnd = this.onDragEnd.bind(this); + } + this.onDragEnd = this.onDragEnd.bind(this); - } - onDragEnd(result) { - // dropped outside the list - if (!result.destination) { - return; - } + } + onDragEnd(result) { + // dropped outside the list + if (!result.destination) { + return; + } - try { + try { - }catch (e) { + }catch (e) { - } - const items = reorder( - this.state.members, - result.source.index, - result.destination.index - ); + } + const items = reorder( + this.state.members, + result.source.index, + result.destination.index + ); - this.setState({ - detailInfoList:this.state.detailInfoList, + this.setState({ + detailInfoList:this.state.detailInfoList, members:items, - items - }); - console.log(this.state.members) - console.log("items 数组数组数组数组") - console.log(items) - } - cardsModalcancel=()=>{ - this.setState({ - Modalstype:false, - }) - // TODO 这个是临时处理,还需要优化,这里要看怎么区分处理 - if (this.state.Modalstopval == '你确定要删除该成员吗?') { - return; - } + items + }); + console.log(this.state.members) + console.log("items 数组数组数组数组") + console.log(items) + } + cardsModalcancel=()=>{ + this.setState({ + Modalstype:false, + }) + // TODO 这个是临时处理,还需要优化,这里要看怎么区分处理 + if (this.state.Modalstopval == '你确定要删除该成员吗?') { + return; + } this.props.history.goBack() - } + } - cardsModalsave=()=>{ - this.setState({ - Modalstype:false, - }) + cardsModalsave=()=>{ + this.setState({ + Modalstype:false, + }) this.props.history.goBack() - } - // 加载markdown - updatamakedown=(id)=>{ - setTimeout(()=>{ - var shixunDescr = window.editormd.markdownToHTML(id, { - htmlDecode: "style,script,iframe", - taskList: true, - tex: true, - flowChart: true, - sequenceDiagram: true - }); - $("#"+id+" p:first").addClass("ReactMarkdown"); - }, 200) - } + } + // 加载markdown + updatamakedown=(id)=>{ + setTimeout(()=>{ + var shixunDescr = window.editormd.markdownToHTML(id, { + htmlDecode: "style,script,iframe", + taskList: true, + tex: true, + flowChart: true, + sequenceDiagram: true + }); + $("#"+id+" p:first").addClass("ReactMarkdown"); + }, 200) + } - componentDidMount(){ - this.getdatasindex() - } + componentDidMount(){ + this.getdatasindex() + } - getdatasindex=(key)=>{ + getdatasindex=(key)=>{ let pathid=this.props.match.params.pathId; let url="/paths/"+pathid+".json"; @@ -168,7 +168,7 @@ class PathDetailIndex extends Component{ if(result.data.allow_visit===true){ this.setState({ detailInfoList:result.data, - courses:result.data.courses, + courses:result.data.courses, pathtopskey:key===undefined?1:key, // items: getItems(result.data.members.length), }) @@ -205,157 +205,157 @@ class PathDetailIndex extends Component{ }) } - updatadetailInfoList=()=>{ - this.getdatasindex(); - } - - clickNewsubscript=(val)=>{ - if(val===0){ - this.setState({ - clickdetailInfoListtype:true - }) - }else{ - this.setState({ - clickdetailInfoListtype:false - }) - } + updatadetailInfoList=()=>{ + this.getdatasindex(); + } - } + clickNewsubscript=(val)=>{ + if(val===0){ + this.setState({ + clickdetailInfoListtype:true + }) + }else{ + this.setState({ + clickdetailInfoListtype:false + }) + } - timeStamp=(value)=>{ - var secondTime = parseInt(value);// 秒 - var minuteTime = 0;// 分 - var hourTime = 0;// 小时 - if(secondTime > 60) {//如果秒数大于60,将秒数转换成整数 - //获取分钟,除以60取整数,得到整数分钟 - minuteTime = parseInt(secondTime / 60); - //获取秒数,秒数取佘,得到整数秒数 - secondTime = parseInt(secondTime % 60); - //如果分钟大于60,将分钟转换成小时 - if(minuteTime > 60) { - //获取小时,获取分钟除以60,得到整数小时 - hourTime = parseInt(minuteTime / 60); - //获取小时后取佘的分,获取分钟除以60取佘的分 - minuteTime = parseInt(minuteTime % 60); - } - } - var result = "" + parseInt(secondTime) + "秒"; - - if(minuteTime > 0) { - result = "" + parseInt(minuteTime) + "分" + result; - } - if(hourTime > 0) { - result = "" + parseInt(hourTime) + "小时" + result; - } - return result; - } + } + timeStamp=(value)=>{ + var secondTime = parseInt(value);// 秒 + var minuteTime = 0;// 分 + var hourTime = 0;// 小时 + if(secondTime > 60) {//如果秒数大于60,将秒数转换成整数 + //获取分钟,除以60取整数,得到整数分钟 + minuteTime = parseInt(secondTime / 60); + //获取秒数,秒数取佘,得到整数秒数 + secondTime = parseInt(secondTime % 60); + //如果分钟大于60,将分钟转换成小时 + if(minuteTime > 60) { + //获取小时,获取分钟除以60,得到整数小时 + hourTime = parseInt(minuteTime / 60); + //获取小时后取佘的分,获取分钟除以60取佘的分 + minuteTime = parseInt(minuteTime % 60); + } + } + var result = "" + parseInt(secondTime) + "秒"; + + if(minuteTime > 0) { + result = "" + parseInt(minuteTime) + "分" + result; + } + if(hourTime > 0) { + result = "" + parseInt(hourTime) + "小时" + result; + } + return result; + } - shanchuallow=(id)=>{ - this.setState({ - user_id:id, - Modalstype:true, - Modalstopval:"你确定要删除该成员吗?", - cardsModalsave:this.delectshanchuallow, - loadtype:false - }) - } - delectshanchuallow=()=>{ - let{user_id}=this.state; - let pathid=this.props.match.params.pathId; - let url="/paths/"+pathid+"/delete_member.json"; - let param={user_id:user_id}; - axios.delete(url,{data:param}).then((response) => { - if(response.data.status===1){ - if (this.props.current_user.user_id == user_id) { - this.props.history.push('/paths') - return; - } - this.props.showNotification(response.data.message) - this.setState({ - Modalstype:false, - // Modalstopval:response.data.message, - loadtype:false, - // cardsModalsave:this.cardsModalsave, - }) - this.updatadetailInfoList(); - } - }).catch((error) => { - console.log(error) - }) - } + shanchuallow=(id)=>{ + this.setState({ + user_id:id, + Modalstype:true, + Modalstopval:"你确定要删除该成员吗?", + cardsModalsave:this.delectshanchuallow, + loadtype:false + }) + } - //上移 - moveup=(data)=>{ - // console.log(data); - let pathid=this.props.match.params.pathId; - let url=`/paths/${pathid}/up_member_position.json`; - axios.post(url,{ - user_id:data.id - }).then((response) => { - if(response.status === 200){ - console.log("上移"); - // console.log(this.state.detailInfoList.members); - // console.log(response); - - this.setState({ - detailInfoList:this.state.detailInfoList, + delectshanchuallow=()=>{ + let{user_id}=this.state; + let pathid=this.props.match.params.pathId; + let url="/paths/"+pathid+"/delete_member.json"; + let param={user_id:user_id}; + axios.delete(url,{data:param}).then((response) => { + if(response.data.status===1){ + if (this.props.current_user.user_id == user_id) { + this.props.history.push('/paths') + return; + } + this.props.showNotification(response.data.message) + this.setState({ + Modalstype:false, + // Modalstopval:response.data.message, + loadtype:false, + // cardsModalsave:this.cardsModalsave, + }) + this.updatadetailInfoList(); + } + }).catch((error) => { + console.log(error) + }) + } + + //上移 + moveup=(data)=>{ + // console.log(data); + let pathid=this.props.match.params.pathId; + let url=`/paths/${pathid}/up_member_position.json`; + axios.post(url,{ + user_id:data.id + }).then((response) => { + if(response.status === 200){ + console.log("上移"); + // console.log(this.state.detailInfoList.members); + // console.log(response); + + this.setState({ + detailInfoList:this.state.detailInfoList, members:response.data.members - }); - // console.log(this.state.detailInfoList.members); + }); + // console.log(this.state.detailInfoList.members); - } + } - }).catch((error) => { - console.log(error) - }) - } + }).catch((error) => { + console.log(error) + }) + } - //下移 - movedown =(data) => { - // console.log(data); - let pathid=this.props.match.params.pathId; - let url=`/paths/${pathid}/down_member_position.json`; - axios.post(url,{ - user_id:data.id - }).then((response) => { - if( response.status === 200){ - console.log("下移"); - // console.log(this.state.detailInfoList.members); - // console.log(response); - this.setState({ - detailInfoList:this.state.detailInfoList, - members:response.data.members - }); - // console.log(this.state.detailInfoList.members); - } - - }).catch((error) => { - console.log(error) - }) - } - render(){ - - this.updatamakedown("shixuns_propaedeutics"); - this.updatamakedown("subject_learning_notes"); - let {detailInfoList, - clickdetailInfoListtype, - Modalstype, - Modalstopval, - Modalsbottomval, - cardsModalcancel, - cardsModalsave, - loadtype, + //下移 + movedown =(data) => { + // console.log(data); + let pathid=this.props.match.params.pathId; + let url=`/paths/${pathid}/down_member_position.json`; + axios.post(url,{ + user_id:data.id + }).then((response) => { + if( response.status === 200){ + console.log("下移"); + // console.log(this.state.detailInfoList.members); + // console.log(response); + this.setState({ + detailInfoList:this.state.detailInfoList, + members:response.data.members + }); + // console.log(this.state.detailInfoList.members); + } + + }).catch((error) => { + console.log(error) + }) + } + render(){ + + this.updatamakedown("shixuns_propaedeutics"); + this.updatamakedown("subject_learning_notes"); + let {detailInfoList, + clickdetailInfoListtype, + Modalstype, + Modalstopval, + Modalsbottomval, + cardsModalcancel, + cardsModalsave, + loadtype, progress, members, tags, courses, - } = this.state + } = this.state - return( -
+ return( +
- - -
- this.getdatasindex(key)}> -
-
-
-

- 简介 - {/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/} - {/**/} - {/**/} - {/**/} - {/**/} - {/**/} - {/*:""*/} - {/*}*/} -

-
-
- {detailInfoList === undefined ? "" :detailInfoList.description===null?"": -
- } -
-
-
- - -
-
-
-

- 课程须知 - {/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/} - {/**/} - {/**/} - {/**/} - {/**/} - {/**/} - {/*:""*/} - {/*}*/} -

-
- {detailInfoList === undefined ? "" :detailInfoList.learning_notes===null?"": -
+ + +
+ this.getdatasindex(key)}> +
+
+
+

+ 简介 + {/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/} + {/**/} + {/**/} + {/**/} + {/**/} + {/**/} + {/*:""*/} + {/*}*/} +

+
+
+ {detailInfoList === undefined ? "" :detailInfoList.description===null?"": +
} -
-
- {tags === undefined ? "" :tags === null ? "": -
-

技能标签 {tags.length}

- -
-
- { - tags && tags.map((item,key)=>{ - return( - {item.tag_name} - ) - }) - } -
-
- - -
20&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"} - onClick={()=>this.clickNewsubscript(0)} - >... -
-
- - -
this.clickNewsubscript(1)}> -
-
- -
- } - { - this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" : -
-

- 关卡数 - - {progress.my_score} / {progress.all_score} - -

-

- 已学 {progress.learned}% - 学习耗时{this.timeStamp(progress.time)} -

-
-
- } - - { - members ===undefined ?"":members === null ?"": -
-

教学团队

- - { members===undefined? - members && members.map((item,key)=>{ - return( -
- ) - }) - :detailInfoList===undefined?"":detailInfoList.allow_add_member===true? - members && members.map((item,key)=>{ - return( -
- - 头像 - - -
-

{item.name} - {/* 新增role 判断是否能删除 1 管理员 2 合作者 */} - - { - detailInfoList===undefined?"":detailInfoList.allow_add_member===true && item.role == 2? - this.shanchuallow(item.id)}>:"" - } -

-
-

{item.school}{item.identity}

-
- { - detailInfoList===undefined?"":detailInfoList.allow_add_member===true?
- {key!=0?:""} - {key+1== members.length?"":} -
- :"" - } - -
-
- ) - }) - : members && members.map((item,key)=>{ - return( -
- - 头像 - - -
-

{item.name} - {/*{*/} - {/* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/} - {/* this.shanchuallow(item.id)}>:""*/} - {/*}*/} -

-
-

{item.school}{item.identity}

-
-
-
- ) - })} - -
- } - - - - -
-
-
- -
- ) - } +
+
+
+ + +
+
+
+

+ 课程须知 + {/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/} + {/**/} + {/**/} + {/**/} + {/**/} + {/**/} + {/*:""*/} + {/*}*/} +

+
+ {detailInfoList === undefined ? "" :detailInfoList.learning_notes===null?"": +
+ } +
+
+ {tags === undefined ? "" :tags === null ? "": +
+

技能标签 {tags.length}

+ +
+
+ { + tags && tags.map((item,key)=>{ + return( + {item.tag_name} + ) + }) + } +
+
+ + +
20&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"} + onClick={()=>this.clickNewsubscript(0)} + >... +
+
+ + +
this.clickNewsubscript(1)}> +
+
+ +
+ } + { + this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" : +
+

+ 我的进展 + + {progress.my_score} / {progress.all_score} + +

+

+ 已学 {progress.learned}% + 学习耗时{this.timeStamp(progress.time)} +

+
+
+ } + + { + members ===undefined ?"":members === null ?"": +
+

教学团队

+ + { members===undefined? + members && members.map((item,key)=>{ + return( +
+ + 头像 + + +
+

{item.name} + {/*{*/} + {/* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/} + {/* this.shanchuallow(item.id)}>:""*/} + {/*}*/} +

+
+

{item.school}{item.identity}

+
+
+
+ ) + }) + :detailInfoList===undefined?"":detailInfoList.allow_add_member===true? + members && members.map((item,key)=>{ + return( +
+ + 头像 + + +
+

{item.name} + {/* 新增role 判断是否能删除 1 管理员 2 合作者 */} + + { + detailInfoList===undefined?"":detailInfoList.allow_add_member===true && item.role == 2? + this.shanchuallow(item.id)}>:"" + } +

+
+

{item.school}{item.identity}

+
+ { + detailInfoList===undefined?"":detailInfoList.allow_add_member===true?
+ {key!=0?:""} + {key+1== members.length?"":} +
+ :"" + } + +
+
+ ) + }) + : members && members.map((item,key)=>{ + return( +
+ + 头像 + + +
+

{item.name} + {/*{*/} + {/* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/} + {/* this.shanchuallow(item.id)}>:""*/} + {/*}*/} +

+
+

{item.school}{item.identity}

+
+
+
+ ) + })} + +
+ } + + + + +
+
+
+ +
+ ) + } } export default PathDetailIndex; \ No newline at end of file diff --git a/public/react/src/modules/tpm/component/TPMRightSection.js b/public/react/src/modules/tpm/component/TPMRightSection.js index f824e7d83..904ef40b8 100644 --- a/public/react/src/modules/tpm/component/TPMRightSection.js +++ b/public/react/src/modules/tpm/component/TPMRightSection.js @@ -13,192 +13,192 @@ import {Icon,Tooltip} from 'antd'; // import "antd/dist/antd.css"; class TPMRightSection extends Component { - constructor(props) { - super(props) - this.state = { - - TPMRightSection:false, - clickNewsubscripttype:false - } - } - - // componentDidMount() { - // let id=this.props.match.params.shixunId; - // - // let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`; - // - // axios.get(shixunsDetailsURL).then((response)=> { - // if(response.status===200){ - // this.setState({ - // TPMRightSectionData: response.data - // }); - // } - // }).catch((error)=>{ - // console.log(error) - // }); - // } - - // shouldComponentUpdate(nextProps, nextState) { - // return nextProps.TPMRightSectionData !== this.state.TPMRightSectionData - // } - clickNewsubscript=(val)=>{ - if(val===0){ - this.setState({ - TPMRightSection:true, - clickNewsubscripttype:true - }) - }else{ - this.setState({ - TPMRightSection:false, - clickNewsubscripttype:false - }) - } - - } - render() { - let {TPMRightSection,clickNewsubscripttype}=this.state; - let {TPMRightSectionData}=this.props - - return ( -
- { - TPMRightSectionData===undefined?"": -
-
-

创建者

-
- - 头像 - -
- -

{TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":TPMRightSectionData.creator.name}

-
- 发布 {TPMRightSectionData.user_shixuns_count} - {/*粉丝 {TPMRightSectionData.fans_count}*/} - {/* 取消关注 */} -
- -
-
-
- { - TPMRightSectionData === undefined ? "" :TPMRightSectionData.tags===undefined?"": TPMRightSectionData.tags.length === 0 ? "" : -
-

技能标签 {TPMRightSectionData.tags.length}

-
-
- { TPMRightSectionData.tags.map((item,key)=>{ - return( - {item.tag_name} - )}) - } -
-
- - -
15&&clickNewsubscripttype===false?"newsubscript mb9 color-grey-9":"newsubscript mb9 color-grey-9 none"} - - data-tip-down="显示全部" - onClick={()=>this.clickNewsubscript(0)}>... -
- - -
this.clickNewsubscript(1)}> -
- -
- - - } - - -
-

所属课程

-
- { - TPMRightSectionData===undefined?"":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.map((i,k)=>{ - - return( - -
- - - 实训 - - -
- {i.name} -

- - - {i.stages_count} - - - {/**/} - {/*{i.score_count}*/} - {/**/} - - - {i.members_count} - - -

-
- -
- - ) - }) - } -
-
- -
-

推荐实训

-
- { - TPMRightSectionData===undefined?"":TPMRightSectionData.recommands===undefined?"":TPMRightSectionData.recommands.map((item,key)=>{ - return( -
- - 69?1526971094 - -
- - {item.name} - -

- {item.stu_num} 人学习 -

-

{item.level}

-
-
- ) - }) - } -
-
- -
- } -
- ) + constructor(props) { + super(props) + this.state = { + + TPMRightSection:false, + clickNewsubscripttype:false + } + } + + // componentDidMount() { + // let id=this.props.match.params.shixunId; + // + // let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`; + // + // axios.get(shixunsDetailsURL).then((response)=> { + // if(response.status===200){ + // this.setState({ + // TPMRightSectionData: response.data + // }); + // } + // }).catch((error)=>{ + // console.log(error) + // }); + // } + + // shouldComponentUpdate(nextProps, nextState) { + // return nextProps.TPMRightSectionData !== this.state.TPMRightSectionData + // } + clickNewsubscript=(val)=>{ + if(val===0){ + this.setState({ + TPMRightSection:true, + clickNewsubscripttype:true + }) + }else{ + this.setState({ + TPMRightSection:false, + clickNewsubscripttype:false + }) + } + + } + render() { + let {TPMRightSection,clickNewsubscripttype}=this.state; + let {TPMRightSectionData}=this.props + + return ( +
+ { + TPMRightSectionData===undefined?"": +
+
+

创建者

+
+ + 头像 + +
+ +

{TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":TPMRightSectionData.creator.name}

+
+ 发布 {TPMRightSectionData.user_shixuns_count} + {/*粉丝 {TPMRightSectionData.fans_count}*/} + {/* 取消关注 */} +
+ +
+
+
+ { + TPMRightSectionData === undefined ? "" :TPMRightSectionData.tags===undefined?"": TPMRightSectionData.tags.length === 0 ? "" : +
+

技能标签 {TPMRightSectionData.tags.length}

+
+
+ { TPMRightSectionData.tags.map((item,key)=>{ + return( + {item.tag_name} + )}) + } +
+
+ + +
15&&clickNewsubscripttype===false?"newsubscript mb9 color-grey-9":"newsubscript mb9 color-grey-9 none"} + + data-tip-down="显示全部" + onClick={()=>this.clickNewsubscript(0)}>... +
+ + +
this.clickNewsubscript(1)}> +
+ +
+ + + } + + +
+

相关实践课程

+
+ { + TPMRightSectionData===undefined?"":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.map((i,k)=>{ + + return( + +
+ + + 实训 + + +
+ {i.name} +

+ + + {i.stages_count} + + + {/**/} + {/*{i.score_count}*/} + {/**/} + + + {i.members_count} + + +

+
+ +
+ + ) + }) + } +
+
+ +
+

推荐实训

+
+ { + TPMRightSectionData===undefined?"":TPMRightSectionData.recommands===undefined?"":TPMRightSectionData.recommands.map((item,key)=>{ + return( +
+ + 69?1526971094 + +
+ + {item.name} + +

+ {item.stu_num} 人学习 +

+

{item.level}

+
+
+ ) + }) + } +
+
+ +
+ } +
+ ) - } + } } export default TPMRightSection; From 43106e48cf53e7a060665c09d56177405e8dc757 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:32:52 +0800 Subject: [PATCH 18/54] RepositoryChooseModal --- .../component/modal/RepositoryChooseModal.js | 300 +++++++++--------- 1 file changed, 150 insertions(+), 150 deletions(-) diff --git a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js index 58839f334..4b72ae2bd 100644 --- a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js +++ b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js @@ -1,153 +1,153 @@ -import React, { useState, useEffect, memo } from 'react'; -import axios from 'axios' -import { Modal, Input } from 'antd'; - -function RepositoryChooseModal(props) { - const [trees, setTrees] = useState([]) - const [path, setPath] = useState('') - const [pathArray, setPathArray] = useState([{val: "根目录/", path: ""}]) - const [modalVisible, setModalVisible] = useState(true) - - useEffect(() => { - repository('') - }, []) - function onOk() { - - } - function onCancel() { - - } - /** - 点nav 会传入key - 点item 会传入 newPath - - item => name, type type tree/leaf - */ - const repository=(item, key, newPath)=>{ - let newPathArray = [] // - // - if (key) { - for(var i=0; i<=key; i++){ - newPathArray.push(pathArray[i]) - } - } else if (item) { - newPathArray = pathArray.slice(0) - newPathArray.push({val: item.name, path: pathArray[pathArray.length - 1] + "/" + item.name}) - } +// import React, { useState, useEffect, memo } from 'react'; +// import axios from 'axios' +// import { Modal, Input } from 'antd'; + +// function RepositoryChooseModal(props) { +// const [trees, setTrees] = useState([]) +// const [path, setPath] = useState('') +// const [pathArray, setPathArray] = useState([{val: "根目录/", path: ""}]) +// const [modalVisible, setModalVisible] = useState(true) + +// useEffect(() => { +// repository('') +// }, []) +// function onOk() { + +// } +// function onCancel() { + +// } +// /** +// 点nav 会传入key +// 点item 会传入 newPath + +// item => name, type type tree/leaf +// */ +// const repository=(item, key, newPath)=>{ +// let newPathArray = [] // +// // +// if (key) { +// for(var i=0; i<=key; i++){ +// newPathArray.push(pathArray[i]) +// } +// } else if (item) { +// newPathArray = pathArray.slice(0) +// newPathArray.push({val: item.name, path: pathArray[pathArray.length - 1] + "/" + item.name}) +// } - const path = item || key ? newPathArray[newPathArray.length - 1] : '' +// const path = item || key ? newPathArray[newPathArray.length - 1] : '' - let id = props.match.params.shixunId; - let url ="/shixuns/"+id+"/repository.json"; - axios.post(url,{ - path: path - }).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - setTrees(response.data.trees) - setPath(path) - pathArray(newPathArray) - } - - }).catch((error) => { - console.log(error) - }); - } - const savegetfilepath=(value)=>{ - const state = {} - let {selectpath,saveshixunfilepath,pathtype} = state - - if(pathtype===1){ - let newselectpath; - - if(saveshixunfilepath==="shixunfilepathplay"){ - newselectpath=value - }else{ - const type = selectpath.split(';'); - let types=false; - for(var i=0; i { +// if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + +// }else{ +// setTrees(response.data.trees) +// setPath(path) +// pathArray(newPathArray) +// } + +// }).catch((error) => { +// console.log(error) +// }); +// } +// const savegetfilepath=(value)=>{ +// const state = {} +// let {selectpath,saveshixunfilepath,pathtype} = state + +// if(pathtype===1){ +// let newselectpath; + +// if(saveshixunfilepath==="shixunfilepathplay"){ +// newselectpath=value +// }else{ +// const type = selectpath.split(';'); +// let types=false; +// for(var i=0; i{ - - } - function sendgetfilepath() { - - } - return ( - -
-
- -
- - saveselectpath(e)} - value={path}/> -
- - onOk()}>确定 - onCancel()}>取消 -
-
-
- ) - -} - -export default RepositoryChooseModal \ No newline at end of file +// } +// const goblakepath=(path,key)=>{ + +// } +// function sendgetfilepath() { + +// } +// return ( +// +//
+//
+// +//
+// +// saveselectpath(e)} +// value={path}/> +//
+ +// onOk()}>确定 +// onCancel()}>取消 +//
+//
+//
+// ) + +// } + +// export default RepositoryChooseModal \ No newline at end of file From 776352ab5225bc4a70be3cd151cabc4553a6e8ef Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:33:18 +0800 Subject: [PATCH 19/54] RepositoryChooseModal --- public/react/src/modules/tpm/TPMRepository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMRepository.js b/public/react/src/modules/tpm/TPMRepository.js index c4d0dce67..0f8e31258 100644 --- a/public/react/src/modules/tpm/TPMRepository.js +++ b/public/react/src/modules/tpm/TPMRepository.js @@ -11,7 +11,7 @@ import Repository from './shixunchild/Repository/Repository' import TPMRightSection from './component/TPMRightSection' import TPMNav from './component/TPMNav' -import RepositoryChooseModal from './component/modal/RepositoryChooseModal' +// import RepositoryChooseModal from './component/modal/RepositoryChooseModal' class TPMRepository extends Component { constructor(props) { From 63ff1be3428fc721261f22a54cf09ec33b34a506 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:39:03 +0800 Subject: [PATCH 20/54] is_secret_repository --- public/react/src/modules/tpm/TPMsettings/TPMsettings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 5e27cb41c..0887c4d18 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -449,7 +449,7 @@ export default class TPMsettings extends Component { multi_webssh:false }); } else { - if (this.state.init_is_secret_repository && !this.state.vnc) { + if (this.state.init_is_secret_repository && !this.state.vnc && this.state.is_secret_repository == true) { this.confirmDeleteSecretRepo({ onOk: () => { this.setState({ @@ -615,7 +615,7 @@ export default class TPMsettings extends Component { // } const vnc = e.target.checked; if (!vnc) { - if (this.state.init_is_secret_repository && this.state.webssh != 2) { + if (this.state.init_is_secret_repository && this.state.webssh != 2 && this.state.is_secret_repository == true) { this.confirmDeleteSecretRepo({ onOk: () => { this.setState({ From 0a2bf3f79cc80a71d4145a00ef56abb99a664f80 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 9 Sep 2019 19:51:25 +0800 Subject: [PATCH 21/54] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 11 +++++------ .../student_works/shixun_work_comment.json.jbuilder | 3 +++ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 app/views/student_works/shixun_work_comment.json.jbuilder diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 39401d079..6dcbea254 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -478,16 +478,15 @@ class StudentWorksController < ApplicationController ActiveRecord::Base.transaction do challenge = @homework.shixuns.first&.challenges.find_by(id: params[:challenge_id]) unless params[:challenge_id].blank? if challenge.present? - comment = @work.shixun_work_comments.find_by(challenge_id: challenge.id) || + @comment = @work.shixun_work_comments.find_by(challenge_id: challenge.id) || ShixunWorkComment.new(student_work_id: @work.id, user_id: current_user.id, challenge_id: challenge.id) else - comment = @work.shixun_work_comments.find_by(challenge_id: 0) || + @comment = @work.shixun_work_comments.find_by(challenge_id: 0) || ShixunWorkComment.new(student_work_id: @work.id, user_id: current_user.id, challenge_id: 0) end - comment.comment = params[:comment] - comment.hidden_comment = params[:hidden_comment] - comment.save! - normal_status("评阅成功") + @comment.comment = params[:comment] + @comment.hidden_comment = params[:hidden_comment] + @comment.save! end end diff --git a/app/views/student_works/shixun_work_comment.json.jbuilder b/app/views/student_works/shixun_work_comment.json.jbuilder new file mode 100644 index 000000000..f9f47cba5 --- /dev/null +++ b/app/views/student_works/shixun_work_comment.json.jbuilder @@ -0,0 +1,3 @@ +json.comment_id @comment.id +json.status 0 +json.message "评阅成功" \ No newline at end of file From 7b5966b2e2c1235265f94580f0cfcc49cac76533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 20:00:46 +0800 Subject: [PATCH 22/54] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/AppraiseModal.js | 3 +- .../shixunHomework/ShixunWorkReport.js | 9 ++-- .../OfficialAcademicTranscript.js | 47 +++++++++---------- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js index 9d1efa5b0..a78e5be62 100644 --- a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js +++ b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js @@ -72,8 +72,9 @@ class AppraiseModal extends Component{ challenge_id:challenge_id }).then((response) => { if(response.data.status===0){ + debugger this.props.showNotification(response.data.message) - this.props.showCancel(comment,hidden_comment,challenge_id) + this.props.showCancel(comment,hidden_comment,response.data.comment_id) }else{ this.props.showNotification(response.data.message) } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 374aef8d4..e1b6590b5 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -157,7 +157,7 @@ class ShixunWorkReport extends Component { showAppraiseModal=(type,id,show,hidden)=>{ let{data}=this.state; - debugger + if(type==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ @@ -192,12 +192,13 @@ class ShixunWorkReport extends Component { let{data,showAppraisetype}=this.state; - debugger + if(showAppraisetype==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ item.challenge_comment=show; item.challenge_comment_hidden=hidden; + item.challenge_id=id; } }) this.setState({ @@ -205,10 +206,12 @@ class ShixunWorkReport extends Component { data:data }) }else{ + data.comment_id=id this.setState({ showAppraiseModaltype:false, work_comment:show, - work_comment_hidden:hidden + work_comment_hidden:hidden, + data:data }) } diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index 0cb75dee3..be99c7035 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -15,31 +15,7 @@ class OfficialAcademicTranscript extends Component { } componentDidMount() { - let {data}=this.props; - - let datas=[]; - if(data!=undefined){ - data.stage_list===undefined?"":data.stage_list.forEach((item,key)=>{ - datas.push({ - customs: key+1, - taskname:{name:item.name,complete_status:item.complete_status}, - openingtime:item.open_time, - evaluating: item.evaluate_count, - finishtime:item.finished_time, - elapsedtime:item.time_consuming, - empvalue:{myself:item.myself_experience,experience:item.experience}, - game_scores:{game_score:item.game_score,game_score_full:item.game_score_full}, - challenge_id:{id:item.challenge_id}, - challenge_comment: item.challenge_comment, - challenge_comment_hidden: item.challenge_comment_hidden, - // adjustmentminute:asdasd - }) - }) - this.setState({ - datas:datas - }) - } } myjumptopic=(e)=>{ console.log("获取到值"); @@ -98,7 +74,28 @@ class OfficialAcademicTranscript extends Component { } render() { - let {datas,customsids}=this.state; + let {customsids}=this.state; + let {data}=this.props; + + let datas=[]; + if(data!=undefined){ + data.stage_list===undefined?"":data.stage_list.forEach((item,key)=>{ + datas.push({ + customs: key+1, + taskname:{name:item.name,complete_status:item.complete_status}, + openingtime:item.open_time, + evaluating: item.evaluate_count, + finishtime:item.finished_time, + elapsedtime:item.time_consuming, + empvalue:{myself:item.myself_experience,experience:item.experience}, + game_scores:{game_score:item.game_score,game_score_full:item.game_score_full}, + challenge_id:{id:item.challenge_id}, + challenge_comment: item.challenge_comment, + challenge_comment_hidden: item.challenge_comment_hidden, + // adjustmentminute:asdasd + }) + }) + } let columns=[{ title: '关卡', From f3434a1d005177a4ad457fcddac29bd3e5750871 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:07:29 +0800 Subject: [PATCH 23/54] 1 --- app/controllers/games_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 26a7ff8db..a0edd01c3 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -541,6 +541,8 @@ class GamesController < ApplicationController testSet << test_cases end + logger.info("##############testSet: #{testSet}") + testCases = Base64.urlsafe_encode64(testSet.to_json) unless testSet.blank? # 评测类型: 0,1,2 用于webssh的评测, 3用于vnc podType = @shixun.vnc_evaluate ? 3 : @shixun.webssh From 75c5b3425c0e8578fecbc8d3b7748f9e13c052cf Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:20:20 +0800 Subject: [PATCH 24/54] 1 --- app/controllers/games_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index a0edd01c3..28ea599b1 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -564,6 +564,7 @@ class GamesController < ApplicationController # 私密仓库的设置 secret_rep = @shixun.shixun_secret_repository + logger.info("############secret_rep: #{secret_rep}") if secret_rep&.repo_name secretGitUrl = repo_url secret_rep.repo_path br_params.merge({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) From cd63277f3d6108a4963c51b436b0869fbcefe3f3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:23:26 +0800 Subject: [PATCH 25/54] 1 --- app/controllers/games_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 28ea599b1..434846ea1 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -566,7 +566,10 @@ class GamesController < ApplicationController secret_rep = @shixun.shixun_secret_repository logger.info("############secret_rep: #{secret_rep}") if secret_rep&.repo_name + logger.info("############repo_path: #{secret_rep.repo_path}") secretGitUrl = repo_url secret_rep.repo_path + logger.info("############secretGitUrl: #{secretGitUrl}") + logger.info("############secret_dir_path: #{secret_rep.secret_dir_path}") br_params.merge({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) end From 6b451e1200b66dd13b311a70324544ccdad7e807 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:24:21 +0800 Subject: [PATCH 26/54] 1 --- app/controllers/games_controller.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 434846ea1..33a7b6fcb 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -566,11 +566,8 @@ class GamesController < ApplicationController secret_rep = @shixun.shixun_secret_repository logger.info("############secret_rep: #{secret_rep}") if secret_rep&.repo_name - logger.info("############repo_path: #{secret_rep.repo_path}") secretGitUrl = repo_url secret_rep.repo_path - logger.info("############secretGitUrl: #{secretGitUrl}") - logger.info("############secret_dir_path: #{secret_rep.secret_dir_path}") - br_params.merge({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) + br_params.merge!({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) end # 中间层交互 From f9eef7af3463886e3cb5dc86fdd26a53b8c0015e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:24:47 +0800 Subject: [PATCH 27/54] 1 --- app/controllers/games_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 33a7b6fcb..cb798b4c9 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -568,6 +568,7 @@ class GamesController < ApplicationController if secret_rep&.repo_name secretGitUrl = repo_url secret_rep.repo_path br_params.merge!({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) + logger.info("#######br_params:#{br_params}") end # 中间层交互 From 064acfc443575944129ba95e14b2b86153bc6ccb Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:37:38 +0800 Subject: [PATCH 28/54] 1 --- app/controllers/games_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index cb798b4c9..b35f2996f 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -567,7 +567,7 @@ class GamesController < ApplicationController logger.info("############secret_rep: #{secret_rep}") if secret_rep&.repo_name secretGitUrl = repo_url secret_rep.repo_path - br_params.merge!({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) + br_params.merge!({secretGitUrl: Base64.urlsafe_encode64(secretGitUrl), secretDir: secret_rep.secret_dir_path}) logger.info("#######br_params:#{br_params}") end From 83b29bc1d6030f9f3eee972e040adc4bca7eac61 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 21:00:17 +0800 Subject: [PATCH 29/54] =?UTF-8?q?=E5=8A=A0=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 3f415f706..24a11cb3b 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -479,6 +479,7 @@ class ShixunsController < ApplicationController else # 如果有仓库,就要删 if @shixun.shixun_secret_repository&.repo_name + @shixun.shixun_secret_repository.lock! GitService.delete_repository(repo_path: @shixun.shixun_secret_repository.repo_path) @shixun.shixun_secret_repository.destroy end From b96465c06d4c261363719d36a44964c263de42a5 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 21:03:21 +0800 Subject: [PATCH 30/54] saving --- public/react/src/modules/tpm/TPMsettings/TPMsettings.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 0887c4d18..a46654fe6 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -859,7 +859,8 @@ export default class TPMsettings extends Component { // }); // } submit_edit_shixun = () => { - + if (this.saving == true) return; + this.saving = true; if(this.state.status===-1){ this.props.showSnackbar("该实训已被删除,保存失败!"); return @@ -1002,6 +1003,7 @@ export default class TPMsettings extends Component { axios.put(Url, data).then((response) => { // console.log(response) + this.saving = false; if(response.status){ if (response.data.status === -1) { this.props.showSnackbar(response.data.message); @@ -1013,6 +1015,7 @@ export default class TPMsettings extends Component { }).catch((error) => { console.log(error) + this.saving = false; }) From 3a3a956ef7fe25ae65a64893134eeb63adbd9555 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 21:23:25 +0800 Subject: [PATCH 31/54] =?UTF-8?q?fork=E7=A7=81=E5=AF=86=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 24a11cb3b..8d735c25e 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -220,6 +220,16 @@ class ShixunsController < ApplicationController evaluate_script: @shixun.evaluate_script) end + # 同步私密版本库 + if @shixun.shixun_secret_repository + repo_name = "#{current_user.login}/secret_#{@shixun.identifier}" + secret_repo = "#{current_user.login}/secret_#{@new_shixun.identifier}" + ShixunSecretRepository.create!(shixun_id: @new_shixun.id, + repo_name: "#{repo_name}", + secret_dir_path: @shixun.secret_dir_path) + GitService.fork_repository(repo_path: "#{repo_name}.git", fork_repository_path: (secret_repo + ".git")) + end + # 同步镜像 if @shixun.mirror_repositories.present? @shixun.mirror_repositories.each do |mirror| From 641c6c4dddc682b12df49b267964b520012e9beb Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 21:24:51 +0800 Subject: [PATCH 32/54] =?UTF-8?q?=E7=A7=81=E5=AF=86=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E5=AE=9E=E8=AE=ADfork=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 8d735c25e..85b724ca9 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -223,11 +223,11 @@ class ShixunsController < ApplicationController # 同步私密版本库 if @shixun.shixun_secret_repository repo_name = "#{current_user.login}/secret_#{@shixun.identifier}" - secret_repo = "#{current_user.login}/secret_#{@new_shixun.identifier}" + fork_repository_name = "#{current_user.login}/secret_#{@new_shixun.identifier}" ShixunSecretRepository.create!(shixun_id: @new_shixun.id, repo_name: "#{repo_name}", secret_dir_path: @shixun.secret_dir_path) - GitService.fork_repository(repo_path: "#{repo_name}.git", fork_repository_path: (secret_repo + ".git")) + GitService.fork_repository(repo_path: "#{repo_name}.git", fork_repository_path: (fork_repository_name + ".git")) end # 同步镜像 From 8242a058abdac000b38d4579be301f009137b72b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 21:32:20 +0800 Subject: [PATCH 33/54] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 85b724ca9..5f69f1b91 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -226,7 +226,7 @@ class ShixunsController < ApplicationController fork_repository_name = "#{current_user.login}/secret_#{@new_shixun.identifier}" ShixunSecretRepository.create!(shixun_id: @new_shixun.id, repo_name: "#{repo_name}", - secret_dir_path: @shixun.secret_dir_path) + secret_dir_path: @shixun.shixun_secret_repository.secret_dir_path) GitService.fork_repository(repo_path: "#{repo_name}.git", fork_repository_path: (fork_repository_name + ".git")) end From 7493d798622e0e1de469a8b5cbd07f4fd4571ebd Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 9 Sep 2019 21:36:24 +0800 Subject: [PATCH 34/54] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 6dcbea254..ab62cbd45 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -493,15 +493,16 @@ class StudentWorksController < ApplicationController # 删除实训作品评阅 def destroy_work_comment ActiveRecord::Base.transaction do - tip_exception("visible_comment参数有误") if params[:visible_comment].nil? + # tip_exception("visible_comment参数有误") if params[:visible_comment].nil? comment = @work.shixun_work_comments.find_by!(id: params[:comment_id]) - params[:visible_comment] ? comment.comment = nil : comment.hidden_comment = nil - if comment.comment.nil? && comment.hidden_comment.nil? - comment.destroy! - else - comment.save! - end + comment.destroy! + # params[:visible_comment] ? comment.comment = nil : comment.hidden_comment = nil + # if comment.comment.nil? && comment.hidden_comment.nil? + # comment.destroy! + # else + # comment.save! + # end normal_status("删除成功") end end From 7b28dc0cbc1a879b06ef07a48a82b258928dccf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 21:59:32 +0800 Subject: [PATCH 35/54] =?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/coursesPublic/AppraiseModal.js | 2 +- .../shixunHomework/ShixunWorkReport.js | 71 +++++---- .../shixunHomework/ShowAppraiseList.js | 141 +++++++++--------- 3 files changed, 103 insertions(+), 111 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js index a78e5be62..f1ee18bb7 100644 --- a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js +++ b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js @@ -74,7 +74,7 @@ class AppraiseModal extends Component{ if(response.data.status===0){ debugger this.props.showNotification(response.data.message) - this.props.showCancel(comment,hidden_comment,response.data.comment_id) + this.props.showCancel(comment,hidden_comment,challenge_id,response.data.comment_id) }else{ this.props.showNotification(response.data.message) } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index e1b6590b5..a8efd3060 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -157,7 +157,7 @@ class ShixunWorkReport extends Component { showAppraiseModal=(type,id,show,hidden)=>{ let{data}=this.state; - + debugger if(type==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ @@ -188,17 +188,17 @@ class ShixunWorkReport extends Component { showAppraiseModaltype:false, }) } - showAppraiseModals=(show,hidden,id)=>{ + showAppraiseModals=(show,hidden,id,comment_id)=>{ let{data,showAppraisetype}=this.state; - + debugger if(showAppraisetype==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ item.challenge_comment=show; item.challenge_comment_hidden=hidden; - item.challenge_id=id; + item.comment_id=comment_id } }) this.setState({ @@ -206,7 +206,7 @@ class ShixunWorkReport extends Component { data:data }) }else{ - data.comment_id=id + data.comment_id=comment_id; this.setState({ showAppraiseModaltype:false, work_comment:show, @@ -216,11 +216,11 @@ class ShixunWorkReport extends Component { } } - isdeleteModal=(comment_id,visible_comment)=>{ + isdeleteModal=(comment_id,visible_comment,type)=>{ this.setState({ modalsType: true, modalsTopval:"是否确认删除?", - modalSave: ()=>this.isdeleteModals(comment_id,visible_comment), + modalSave: ()=>this.isdeleteModals(comment_id,visible_comment,type), modalCancel:()=>this.hideisdeleteModals(), }) } @@ -235,20 +235,25 @@ class ShixunWorkReport extends Component { } - hideisdeleteModal=(comment_id,visible_comment)=>{ + hideisdeleteModal=(comment_id,visible_comment,type)=>{ - let{data,work_comment,work_comment_hidden,showAppraisetype}=this.state; - if(showAppraisetype==="child"){ - data.stage_list.forEach((item,key)=>{ - if(item.comment_id===comment_id){ - if(visible_comment===true){ - item.challenge_comment=null; - }else{ - item.challenge_comment_hidden=null; + let{data,work_comment,work_comment_hidden}=this.state; + + if(type==="child"){ + data.stage_list.map((item,key)=>{ + console.log(item) + if(item.comment_id!=null){ + if(item.comment_id===comment_id){ + if(visible_comment===true){ + item.challenge_comment=null; + }else{ + item.challenge_comment_hidden=null; + } } } }) + this.setState({ modalsType:false, modalsTopval:"是否确认删除?", @@ -256,40 +261,36 @@ class ShixunWorkReport extends Component { modalCancel:"", data:data }) + }else{ - if(visible_comment===true){ - this.setState({ - modalsType:false, - modalsTopval:"是否确认删除?", - modalSave: "", - modalCancel:"", - work_comment:visible_comment===true?null:work_comment, - }) - }else{ + this.setState({ modalsType:false, modalsTopval:"是否确认删除?", modalSave: "", modalCancel:"", - work_comment_hidden:visible_comment===false?null:work_comment_hidden + work_comment:null, + work_comment_hidden:null }) - } + } } - isdeleteModals=(comment_id,visible_comment)=>{ + isdeleteModals=(comment_id,visible_comment,type)=>{ + let newcomment_id=comment_id; + let newvisible_comment=visible_comment; + let newtype=type; + let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json` axios.delete(url, { data: { comment_id:comment_id, - visible_comment:visible_comment }}).then((response) => { // const { status } = response.data; if(response.data.status===0){ this.props.showNotification(response.data.message) - - this.hideisdeleteModal(comment_id,visible_comment) + this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype) }else{ this.props.showNotification(response.data.message) } @@ -308,9 +309,7 @@ class ShixunWorkReport extends Component { // let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment===null||work_comment===undefined?false:true:work_comment===null||work_comment===undefined?false:true; let showAppraiseModals=work_comment===null||work_comment===undefined?false:true; - console.log(data) - console.log(work_comment_hidden) - console.log(work_comment) + return ( data===undefined?"": @@ -329,7 +328,7 @@ class ShixunWorkReport extends Component { {...this.state} visible={showAppraiseModaltype} Cancel={()=>this.hideAppraiseModal()} - showCancel={(show,hidden,id)=>this.showAppraiseModals(show,hidden,id)} + showCancel={(show,hidden,id,comment_id)=>this.showAppraiseModals(show,hidden,id,comment_id)} work_comment={this.state.work_comment} work_type={work_comment===null||work_comment===undefined?this.state.work_type:work_comment_hidden===true?1:0} />:""} @@ -551,7 +550,7 @@ class ShixunWorkReport extends Component { this.isdeleteModal(comment_id,visible_comment)} + isdeleteModal={(comment_id,visible_comment,type)=>this.isdeleteModal(comment_id,visible_comment,type)} showAppraiseModal={(type,id,show,hidden)=>this.showAppraiseModal(type,id,show,hidden)} /> diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index 66ac56a63..f53ad2cd9 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -11,16 +11,12 @@ class ShowAppraiseList extends Component{ } } - componentDidMount() { - - - } - render(){ - let {data,work_comment,work_comment_hidden}=this.props; - console.log(data) + let {data, work_comment,work_comment_hidden}=this.props; + let work_commenttype=work_comment===undefined||work_comment===null||work_comment===""; + let work_comment_hiddentype=work_comment===undefined||work_comment===null||work_comment===""; return(
- {data===undefined?"":work_comment===undefined||work_comment===null||work_comment===""?"": + {data===undefined?"":work_commenttype===true&&work_comment_hiddentype===true?"":
} - - - - {data===undefined?"":work_comment_hidden===undefined||work_comment_hidden===null||work_comment_hidden===""?"":this.props&&this.props.isAdminOrTeacher()===true? - }
-
:""} +
} + + {data===undefined?"":data.stage_list.map((item,key)=>{ let challenge_comment_hidden=item.challenge_comment_hidden===undefined||item.challenge_comment_hidden===null||item.challenge_comment_hidden===""; let challenge_comment=item.challenge_comment===undefined||item.challenge_comment===null||item.challenge_comment===""; + return( -
- {challenge_comment===false?
+
+ {challenge_comment===false&&challenge_comment_hidden==false?
- 第{key+1}关评阅内容 + 第{key+1}关{item.name} {this.props&&this.props.isAdminOrTeacher()===true?this.props.isdeleteModal(item.comment_id,true)} + onClick={()=>this.props.isdeleteModal(item.comment_id,true,"child")} >删除:""} {this.props&&this.props.isAdminOrTeacher()===true?this.props.showAppraiseModal("child",item.challenge_id,item.challenge_comment,item.challenge_comment_hidden)} >编辑:""}
-
-
-
-
-
-
-
- -
-
:""} - - {challenge_comment_hidden===false&&this.props&&this.props.isAdminOrTeacher()===true?
-
-
- 第{key+1}关评阅内容(仅对课堂老师可见) - - {this.props&&this.props.isAdminOrTeacher()===true?this.props.isdeleteModal(item.comment_id,false)} - >删除:""} + {this.props&&this.props.isAdminOrTeacher()===true? +
+
+ 学生不可见(仅对课堂老师可见) +
+
+ {challenge_comment_hidden===true?"":
+
+
} +
+
+ 学生可见(学生可查看老师的评阅内容) +
+
+ {challenge_comment===true?"":
+
+
} +
- {this.props&&this.props.isAdminOrTeacher()===true?this.props.showAppraiseModal("child",item.challenge_id,item.challenge_comment,item.challenge_comment_hidden)} - >编辑:""} -
-
-
-
-
+
:
+
+
+
+
-
-
+
}
:""} From 06c750162b7c4bf0e376e0a3161598568a0bb485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:02:58 +0800 Subject: [PATCH 36/54] =?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/shixunHomework/ShixunWorkReport.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index a8efd3060..ab801fe40 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -245,11 +245,8 @@ class ShixunWorkReport extends Component { console.log(item) if(item.comment_id!=null){ if(item.comment_id===comment_id){ - if(visible_comment===true){ - item.challenge_comment=null; - }else{ - item.challenge_comment_hidden=null; - } + item.challenge_comment=null; + item.challenge_comment_hidden=null; } } }) From bcfbca145175c9ac7d4f802e9d5befbd7d508c07 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 22:03:15 +0800 Subject: [PATCH 37/54] absolute --- public/react/src/modules/page/VNCContainer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/react/src/modules/page/VNCContainer.js b/public/react/src/modules/page/VNCContainer.js index d8e5a0b1f..85532dad1 100644 --- a/public/react/src/modules/page/VNCContainer.js +++ b/public/react/src/modules/page/VNCContainer.js @@ -144,6 +144,11 @@ class VNCContainer extends Component { .codeEvaluateDrawer .ant-drawer-body { padding: 0px; } + .codeEvaluateDrawer .ant-drawer-content-wrapper, .codeEvaluateDrawer .ant-drawer-mask { + position: absolute; + } + + .codeEvaluateFloatButton { bottom: 180px !important; left: unset; From 8722cbf36da24a7c7529332e41e94ed84a77331c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 22:09:19 +0800 Subject: [PATCH 38/54] closable={false} --- public/react/src/modules/page/VNCContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/page/VNCContainer.js b/public/react/src/modules/page/VNCContainer.js index 85532dad1..ecc2c8a41 100644 --- a/public/react/src/modules/page/VNCContainer.js +++ b/public/react/src/modules/page/VNCContainer.js @@ -216,7 +216,7 @@ class VNCContainer extends Component { mask={true} title="" width={firstDrawerWidth} - // closable={false} + closable={false} onClose={this.onBottomDrawerClose} visible={this.state.bottomDrawer} className={'codeEvaluateDrawer'} From ab146018c8633eb1d12822e96bc6d69dbe311dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:11:03 +0800 Subject: [PATCH 39/54] =?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/ShixunWorkReport.js | 3 +-- .../modules/courses/shixunHomework/ShowAppraiseList.js | 9 +++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index ab801fe40..0f1264865 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -157,7 +157,7 @@ class ShixunWorkReport extends Component { showAppraiseModal=(type,id,show,hidden)=>{ let{data}=this.state; - debugger + if(type==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ @@ -192,7 +192,6 @@ class ShixunWorkReport extends Component { let{data,showAppraisetype}=this.state; - debugger if(showAppraisetype==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index f53ad2cd9..05fdacfed 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -42,6 +42,11 @@ class ShowAppraiseList extends Component{ color: #000; font-size:15px; } + + .borderbom{ + margin-bottom: 20px; + border-bottom: 2px solid #fafafa; + } ` } @@ -67,7 +72,7 @@ class ShowAppraiseList extends Component{
学生不可见(仅对课堂老师可见)
-
+
{work_comment_hidden===true?"":
@@ -124,7 +129,7 @@ class ShowAppraiseList extends Component{
学生不可见(仅对课堂老师可见)
-
+
{challenge_comment_hidden===true?"":
From d1e9c861244501da9440b68a034921aeeb13a941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:13:13 +0800 Subject: [PATCH 40/54] b --- .../src/modules/courses/shixunHomework/ShowAppraiseList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index 05fdacfed..b32d6a0e6 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -40,7 +40,7 @@ class ShowAppraiseList extends Component{ } .000w{ color: #000; - font-size:15px; + font-size:16px; } .borderbom{ From c583ef53471ee1b6c811f3a31fe94ea75b722e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:15:04 +0800 Subject: [PATCH 41/54] b --- .../courses/shixunHomework/ShowAppraiseList.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index b32d6a0e6..34e978bef 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -34,11 +34,11 @@ class ShowAppraiseList extends Component{ text-align: center; line-height: 22px; } - .666w{ + .666{ color: #666; font-size:14px; } - .000w{ + .000{ color: #000; font-size:16px; } @@ -47,6 +47,9 @@ class ShowAppraiseList extends Component{ margin-bottom: 20px; border-bottom: 2px solid #fafafa; } + pd30bt{ + padding: 30px 30px 0px 30px; + } ` } @@ -70,7 +73,7 @@ class ShowAppraiseList extends Component{ {this.props&&this.props.isAdminOrTeacher()===true?
- 学生不可见(仅对课堂老师可见) + 学生不可见(仅对课堂老师可见)
{work_comment_hidden===true?"":
@@ -79,7 +82,7 @@ class ShowAppraiseList extends Component{
}
- 学生可见(学生可查看老师的评阅内容) + 学生可见(学生可查看老师的评阅内容)
{work_comment===true?"":
@@ -127,7 +130,7 @@ class ShowAppraiseList extends Component{ {this.props&&this.props.isAdminOrTeacher()===true?
- 学生不可见(仅对课堂老师可见) + 学生不可见(仅对课堂老师可见)
{challenge_comment_hidden===true?"":
@@ -136,7 +139,7 @@ class ShowAppraiseList extends Component{
}
- 学生可见(学生可查看老师的评阅内容) + 学生可见(学生可查看老师的评阅内容)
{challenge_comment===true?"":
From 51a534823756c31e1c26b08d034a18bd793beeb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:27:44 +0800 Subject: [PATCH 42/54] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/ShowAppraiseList.js | 87 +++++++++---------- .../modules/courses/shixunHomework/style.css | 13 +++ 2 files changed, 55 insertions(+), 45 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index 34e978bef..1a5b4a136 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -2,6 +2,7 @@ import React,{ Component } from "react"; import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd"; import { WordNumberTextarea,markdownToHTML } from 'educoder'; import axios from 'axios'; +import './style.css'; class ShowAppraiseList extends Component{ constructor(props){ @@ -15,8 +16,8 @@ class ShowAppraiseList extends Component{ render(){ let {data, work_comment,work_comment_hidden}=this.props; - let work_commenttype=work_comment===undefined||work_comment===null||work_comment===""; - let work_comment_hiddentype=work_comment===undefined||work_comment===null||work_comment===""; + let work_commenttype=this.props&&this.props.isAdmin()===true?false:work_comment===undefined||work_comment===null||work_comment===""; + let work_comment_hiddentype=this.props&&this.props.isAdmin()===true?false:work_comment===undefined||work_comment===null||work_comment===""; return(
@@ -60,39 +54,41 @@ class ShowAppraiseList extends Component{
总体评阅评阅内容 - {this.props&&this.props.isAdminOrTeacher()===true?this.props.isdeleteModal(data.comment_id,true,"main")} >删除:""} - {this.props&&this.props.isAdminOrTeacher()===true?this.props.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)} >编辑:""}
- {this.props&&this.props.isAdminOrTeacher()===true? -
+ {this.props&&this.props.isAdmin()===true? +
+
+ 学生可见(学生可查看老师的评阅内容) +
+
+ {work_comment===true?"":
+
+
} +
+
- 学生不可见(仅对课堂老师可见) + 学生不可见(仅对课堂老师可见)
-
+
{work_comment_hidden===true?"":
}
-
- 学生可见(学生可查看老师的评阅内容) -
-
- {work_comment===true?"":
-
-
} -
+
:
-
+
@@ -108,8 +104,8 @@ class ShowAppraiseList extends Component{ {data===undefined?"":data.stage_list.map((item,key)=>{ - let challenge_comment_hidden=item.challenge_comment_hidden===undefined||item.challenge_comment_hidden===null||item.challenge_comment_hidden===""; - let challenge_comment=item.challenge_comment===undefined||item.challenge_comment===null||item.challenge_comment===""; + let challenge_comment_hidden=this.props&&this.props.isAdmin()===true?false:item.challenge_comment_hidden===undefined||item.challenge_comment_hidden===null||item.challenge_comment_hidden===""; + let challenge_comment=this.props&&this.props.isAdmin()===true?false:item.challenge_comment===undefined||item.challenge_comment===null||item.challenge_comment===""; return(
@@ -118,38 +114,39 @@ class ShowAppraiseList extends Component{
第{key+1}关{item.name} - {this.props&&this.props.isAdminOrTeacher()===true?this.props.isdeleteModal(item.comment_id,true,"child")} >删除:""} - {this.props&&this.props.isAdminOrTeacher()===true?this.props.showAppraiseModal("child",item.challenge_id,item.challenge_comment,item.challenge_comment_hidden)} >编辑:""}
- {this.props&&this.props.isAdminOrTeacher()===true? -
+ {this.props&&this.props.isAdmin()===true? +
- 学生不可见(仅对课堂老师可见) + 学生可见(学生可查看老师的评阅内容)
-
- {challenge_comment_hidden===true?"":
+
+ {challenge_comment===true?"":
+ dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}>
}
+
- 学生可见(学生可查看老师的评阅内容) + 学生不可见(仅对课堂老师可见)
-
- {challenge_comment===true?"":
+
+ {challenge_comment_hidden===true?"":
+ dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment_hidden).replace(/▁/g, "▁▁▁")}}>
}
:
-
+
diff --git a/public/react/src/modules/courses/shixunHomework/style.css b/public/react/src/modules/courses/shixunHomework/style.css index c2affa32c..c3976515b 100644 --- a/public/react/src/modules/courses/shixunHomework/style.css +++ b/public/react/src/modules/courses/shixunHomework/style.css @@ -53,4 +53,17 @@ } .ysyslxh{ background: #fafafa; +} + +.z666{ + color: #666; + font-size:14px; +} +.z000{ + color: #000; + font-size:16px; +} + +.pd30bt{ + padding: 10px 30px 0px 30px; } \ No newline at end of file From ccb64e8b3f8739d09ca2034124a30dac81905cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:39:01 +0800 Subject: [PATCH 43/54] b --- .../courses/coursesPublic/AppraiseModal.js | 3 +- .../shixunHomework/ShixunWorkReport.js | 37 +++++++++++-------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js index f1ee18bb7..120e57b2b 100644 --- a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js +++ b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js @@ -72,9 +72,8 @@ class AppraiseModal extends Component{ challenge_id:challenge_id }).then((response) => { if(response.data.status===0){ - debugger - this.props.showNotification(response.data.message) this.props.showCancel(comment,hidden_comment,challenge_id,response.data.comment_id) + this.props.showNotification(response.data.message) }else{ this.props.showNotification(response.data.message) } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 0f1264865..bb8ccae4a 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -216,10 +216,13 @@ class ShixunWorkReport extends Component { } isdeleteModal=(comment_id,visible_comment,type)=>{ + let newcomment_id=comment_id; + let newvisible_comment=visible_comment; + let newtype=type; this.setState({ modalsType: true, modalsTopval:"是否确认删除?", - modalSave: ()=>this.isdeleteModals(comment_id,visible_comment,type), + modalSave: ()=>this.isdeleteModals(newcomment_id,newvisible_comment,newtype), modalCancel:()=>this.hideisdeleteModals(), }) } @@ -278,22 +281,24 @@ class ShixunWorkReport extends Component { let newcomment_id=comment_id; let newvisible_comment=visible_comment; let newtype=type; + if(comment_id!=null){ + let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json` + axios.delete(url, { data: { + comment_id:comment_id, + }}).then((response) => { + // const { status } = response.data; + if(response.data.status===0){ + this.props.showNotification(response.data.message) + this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype) + }else{ + this.props.showNotification(response.data.message) + } + }) + .catch(function (error) { + console.log(error); + }); + } - let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json` - axios.delete(url, { data: { - comment_id:comment_id, - }}).then((response) => { - // const { status } = response.data; - if(response.data.status===0){ - this.props.showNotification(response.data.message) - this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype) - }else{ - this.props.showNotification(response.data.message) - } - }) - .catch(function (error) { - console.log(error); - }); } render() { let{data,showAppraiseModaltype,work_comment_hidden,work_comment} =this.state; From e6caa48ff7b91dd0ff00943a9e6df947cac7cbb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:44:00 +0800 Subject: [PATCH 44/54] =?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/ShowAppraiseList.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index 1a5b4a136..660c8e796 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -16,8 +16,8 @@ class ShowAppraiseList extends Component{ render(){ let {data, work_comment,work_comment_hidden}=this.props; - let work_commenttype=this.props&&this.props.isAdmin()===true?false:work_comment===undefined||work_comment===null||work_comment===""; - let work_comment_hiddentype=this.props&&this.props.isAdmin()===true?false:work_comment===undefined||work_comment===null||work_comment===""; + let work_commenttype=work_comment===undefined||work_comment===null||work_comment===""; + let work_comment_hiddentype=work_comment===undefined||work_comment===null||work_comment===""; return(