From 1aa713a8958cd8e04a1bd62a669cd5e771df8258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 31 Aug 2019 11:59:55 +0800 Subject: [PATCH 01/15] =?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/ShixunWorkReport.js | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 092b038f3..508ea5ca6 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -1,8 +1,9 @@ import React, {Component} from "react"; -import {WordsBtn,markdownToHTML} from 'educoder'; +import {WordsBtn,markdownToHTML,ActionBtn,queryString,downloadFile} from 'educoder'; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd"; import {Link,Switch,Route,Redirect} from 'react-router-dom'; import axios from 'axios'; + import ConclusionEvaluation from './shixunreport/ConclusionEvaluation'; import OfficialAcademicTranscript from './shixunreport/OfficialAcademicTranscript'; import Coursesshixundetails from './shixunreport/Coursesshixundetails'; @@ -32,9 +33,19 @@ class ShixunWorkReport extends Component { } -/// 确认是否下载 - confirmysl(url){ - axios.get(url).then((response) => { + /// 确认是否下载 + confirmysl(url,child){ + let params ={} + if(child!=undefined){ + params =child._getRequestParams()!==undefined?child._getRequestParams():{}; + } + console.log("170"); + console.log(params); + const urll=url+`?${queryString.stringify(params)}`; + axios.get(urll+ '&export=true').then((response) => { + if(response===undefined){ + return + } if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ @@ -53,17 +64,16 @@ class ShixunWorkReport extends Component { }) } }else { + this.setState({ donwloading: true }) + this.props.showNotification(`正在下载中`); - window.open("/api"+url, '_blank'); + + window.open("/api"+url+'?&export=true', '_blank'); } }).catch((error) => { console.log(error) }); } - //打开pdf - confpdf = (url) =>{ - window.open(url); - } Downloadcal=()=>{ this.setState({ DownloadType:false, @@ -163,8 +173,8 @@ class ShixunWorkReport extends Component { 返回 {this.props.isAdmin() ? this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)} - onClick={()=>this.confpdf(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)} + onClick={()=>this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)} + >导出实训报告数据 : ""} From 7977966640c70ec574f888159fa0871f6f859be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 31 Aug 2019 12:13:02 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/ShixunWorkReport.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 508ea5ca6..b7ad2dc20 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -35,6 +35,7 @@ class ShixunWorkReport extends Component { /// 确认是否下载 confirmysl(url,child){ + this.setState({ isspinning: true }) let params ={} if(child!=undefined){ params =child._getRequestParams()!==undefined?child._getRequestParams():{}; @@ -64,11 +65,9 @@ class ShixunWorkReport extends Component { }) } }else { - this.setState({ donwloading: true }) - this.props.showNotification(`正在下载中`); - - window.open("/api"+url+'?&export=true', '_blank'); + window.open("/api"+url+'?export=true', '_blank'); + this.setState({ isspinning: false }) } }).catch((error) => { console.log(error) @@ -172,10 +171,9 @@ class ShixunWorkReport extends Component { {/*{this.props.isAdmin()?导出实训报告数据:""}*/} 返回 {this.props.isAdmin() ? this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)} - - >导出实训报告数据 : ""} + > 导出实训报告数据 : ""}
From b461eef525147f5947ce03885029156aeb0b03f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 31 Aug 2019 12:34:48 +0800 Subject: [PATCH 03/15] =?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 | 1 + .../shixunHomework/shixunreport/OfficialAcademicTranscript.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index b7ad2dc20..b5d50abb9 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -29,6 +29,7 @@ class ShixunWorkReport extends Component { spinning:true, DownloadType:false, DownloadMessageval:undefined, + isspinning:false } } diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index eaf78b328..fd00aa699 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -40,6 +40,8 @@ class OfficialAcademicTranscript extends Component { }).catch((error)=>{ }) + }else{ + this.props.showNotification("调分为空将不会修改之前的分数"); } } From 6e4c13b02863abbecae635e4cc6e58e735fdba3c Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 31 Aug 2019 12:40:39 +0800 Subject: [PATCH 04/15] =?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/views/student_works/adjust_review_score.json.jbuilder | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/student_works/adjust_review_score.json.jbuilder b/app/views/student_works/adjust_review_score.json.jbuilder index 09eab5b66..30fb5b115 100644 --- a/app/views/student_works/adjust_review_score.json.jbuilder +++ b/app/views/student_works/adjust_review_score.json.jbuilder @@ -1,4 +1,5 @@ json.status 0 json.message "调分成功" json.work_score number_with_precision(@work.work_score, precision: 1) -json.challenge_score number_with_precision(@work.final_score, precision: 1) \ No newline at end of file +json.challenge_score number_with_precision(@work.final_score, precision: 1) +json.overall_appraisal @work.overall_appraisal \ No newline at end of file From 4247bedad775538fbf816ffce463e0f886e5a476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 31 Aug 2019 13:06:50 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A?= =?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/ShixunWorkReport.js | 12 ++++++++++ .../OfficialAcademicTranscript.js | 22 +++++++++++++------ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index b5d50abb9..434101f33 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -134,6 +134,17 @@ class ShixunWorkReport extends Component { goback = () => { this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.state.data.homework_common_id}/list?tab=0`); } + + setupdalist=(challenge_score,overall_appraisal,work_score)=>{ + let {data}=this.state; + let newdata=data; + newdata.challenge_score=challenge_score; + newdata.overall_appraisal=overall_appraisal; + newdata.work_score=work_score; + this.setState({ + data:newdata + }) + } render() { let{data} =this.state; console.log(data) @@ -199,6 +210,7 @@ class ShixunWorkReport extends Component { data={data} jumptopic={this.jumptopic} getdatalist={()=>this.getdatalist()} + setupdalist={(challenge_score,overall_appraisal,work_score)=>this.setupdalist(challenge_score,overall_appraisal,work_score)} />
diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index fd00aa699..8e826d8c8 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -22,7 +22,8 @@ class OfficialAcademicTranscript extends Component { this.props.jumptopic(e); } - editgame_scores=(score,id)=>{ + editgame_scores=(e,id)=>{ + let score=e.target.value; if(score!=null&&score!=undefined&&score!=""){ let work_id=this.props.data.work_id; let url=`/student_works/${work_id}/adjust_review_score.json` @@ -34,6 +35,8 @@ class OfficialAcademicTranscript extends Component { if(result.data.status===0){ this.props.getdatalist() this.props.showNotification(result.data.message); + + this.props.setupdalist(result.data.challenge_score,result.data.overall_appraisal,result.data.work_score) }else{ this.props.showNotification(result.data.message); } @@ -84,9 +87,11 @@ class OfficialAcademicTranscript extends Component { className:"TaskForms", render: (text, record) => ( - this.myjumptopic("id"+record.customs)} title={record.taskname.name.length>56?record.taskname.name:""} > - {record.taskname.name}{record.taskname.complete_status===2?延时:record.taskname.complete_status===3?延时:""} - + this.myjumptopic("id"+record.customs)} title={record.taskname.name.length>56?record.taskname.name:""} > + {record.taskname.name} + + {record.taskname.complete_status===2?延时:record.taskname.complete_status===3?延时:""} + ), }, { @@ -160,7 +165,7 @@ class OfficialAcademicTranscript extends Component { render: (text, record) => ( this.editgame_scores(e,record.challenge_id.id)} + onBlur={(e) => this.editgame_scores(e,record.challenge_id.id)} min={0} max={record.game_scores.game_score_full} /> {/*查看*/} @@ -224,11 +229,11 @@ class OfficialAcademicTranscript extends Component { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - max-width: 450px; + max-width: 225px; text-align: left !important; } .TaskForms{ - max-width: 450px; + max-width: 260px; text-align: left !important; padding: 16px !important; } @@ -241,6 +246,9 @@ class OfficialAcademicTranscript extends Component { border-radius: 0px; width: 66px; } + .linhe15{ + line-height: 15px; + } `} {datas===undefined?"": Date: Sat, 31 Aug 2019 13:10:08 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A?= =?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/shixunreport/OfficialAcademicTranscript.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index 8e826d8c8..750b1c69e 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -33,7 +33,7 @@ class OfficialAcademicTranscript extends Component { challenge_id:id }).then((result)=>{ if(result.data.status===0){ - this.props.getdatalist() + // this.props.getdatalist() this.props.showNotification(result.data.message); this.props.setupdalist(result.data.challenge_score,result.data.overall_appraisal,result.data.work_score) @@ -87,7 +87,7 @@ class OfficialAcademicTranscript extends Component { className:"TaskForms", render: (text, record) => ( - this.myjumptopic("id"+record.customs)} title={record.taskname.name.length>56?record.taskname.name:""} > + this.myjumptopic("id"+record.customs)} title={record.taskname.name.length>15?record.taskname.name:""} > {record.taskname.name} {record.taskname.complete_status===2?延时:record.taskname.complete_status===3?延时:""} From 6d80a53e6d3fce45cb2e444c3fac2cba05eef5d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 31 Aug 2019 13:26:25 +0800 Subject: [PATCH 07/15] b --- .../OfficialAcademicTranscript.js | 93 +++++++++++-------- 1 file changed, 56 insertions(+), 37 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index 750b1c69e..fe8bf988d 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -14,42 +14,6 @@ class OfficialAcademicTranscript extends Component { } componentDidMount() { - - } - myjumptopic=(e)=>{ - console.log("获取到值"); - console.log(e); - this.props.jumptopic(e); - } - - editgame_scores=(e,id)=>{ - let score=e.target.value; - if(score!=null&&score!=undefined&&score!=""){ - let work_id=this.props.data.work_id; - let url=`/student_works/${work_id}/adjust_review_score.json` - axios.post(url,{ - type:"report", - score:score, - challenge_id:id - }).then((result)=>{ - if(result.data.status===0){ - // this.props.getdatalist() - this.props.showNotification(result.data.message); - - this.props.setupdalist(result.data.challenge_score,result.data.overall_appraisal,result.data.work_score) - }else{ - this.props.showNotification(result.data.message); - } - }).catch((error)=>{ - - }) - }else{ - this.props.showNotification("调分为空将不会修改之前的分数"); - } - } - - render() { - let {data}=this.props; let datas=[]; @@ -68,8 +32,63 @@ class OfficialAcademicTranscript extends Component { // adjustmentminute:asdasd }) }) + + this.setState({ + datas:datas + }) + } + } + myjumptopic=(e)=>{ + console.log("获取到值"); + console.log(e); + this.props.jumptopic(e); + } + + editgame_scores=(e,id,maxsum)=>{ + let{datas}=this.state; + let newdatas=datas; + let score=e.target.value; + + if(score!=null&&score!=undefined&&score!=""){ + if(scoremaxsum){ + this.props.showNotification(`调分不能大于${maxsum}`); + }else{ + let work_id=this.props.data.work_id; + let url=`/student_works/${work_id}/adjust_review_score.json` + axios.post(url,{ + type:"report", + score:score, + challenge_id:id + }).then((result)=>{ + if(result.data.status===0){ + // this.props.getdatalist() + this.props.showNotification(result.data.message); + this.props.setupdalist(result.data.challenge_score,result.data.overall_appraisal,result.data.work_score) + newdatas.map((item,key)=>{ + if(item.challenge_id.id===id){ + item.game_scores.game_score=score + } + }) + this.setState({ + datas:newdatas + }) + }else{ + this.props.showNotification(result.data.message); + } + }).catch((error)=>{ + + }) + } + + }else{ + this.props.showNotification("调分为空将不会修改之前的分数"); } + } + render() { + let {datas}=this.state; let columns=[{ title: '关卡', @@ -165,7 +184,7 @@ class OfficialAcademicTranscript extends Component { render: (text, record) => ( this.editgame_scores(e,record.challenge_id.id)} + onBlur={(e) => this.editgame_scores(e,record.challenge_id.id,record.game_scores.game_score_full)} min={0} max={record.game_scores.game_score_full} /> {/*查看*/} From 618fe608b85118a7e3c02d55b5292ba1c62297bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 31 Aug 2019 13:28:58 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A?= =?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/shixunreport/OfficialAcademicTranscript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index fe8bf988d..ec6a5dea4 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -185,7 +185,7 @@ class OfficialAcademicTranscript extends Component { this.editgame_scores(e,record.challenge_id.id,record.game_scores.game_score_full)} - min={0} max={record.game_scores.game_score_full} + // min={0} max={record.game_scores.game_score_full} /> {/*查看*/} From 883177636da910540ddee57f7e45f02149123bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 31 Aug 2019 13:38:01 +0800 Subject: [PATCH 09/15] b --- .../shixunHomework/shixunreport/OfficialAcademicTranscript.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index ec6a5dea4..f6f2067ad 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -50,7 +50,7 @@ class OfficialAcademicTranscript extends Component { let score=e.target.value; if(score!=null&&score!=undefined&&score!=""){ - if(scoremaxsum){ this.props.showNotification(`调分不能大于${maxsum}`); @@ -183,7 +183,7 @@ class OfficialAcademicTranscript extends Component { render: (text, record) => ( - this.editgame_scores(e,record.challenge_id.id,record.game_scores.game_score_full)} // min={0} max={record.game_scores.game_score_full} /> From 1f8e03c737a8a62ba8b26eb4582fe81510c828ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 31 Aug 2019 13:43:31 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A?= =?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/templates/shared/main.css | 2 +- public/react/public/css/css_min_all.css | 2 +- public/react/public/css/edu-common.css | 2 +- .../shixunreport/OfficialAcademicTranscript.js | 16 ++++++++++++---- public/stylesheets/css/edu-common.css | 2 +- public/stylesheets/educoder/edu-main.css | 2 +- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/templates/shared/main.css b/app/templates/shared/main.css index 9e9bc4f50..884f6fa37 100644 --- a/app/templates/shared/main.css +++ b/app/templates/shared/main.css @@ -344,7 +344,7 @@ a.edu-txt-w40,.edu-txt-w40{ width:40px; display: inline-block;text-align: center .bor-grey01{border:1px solid #E6EAEB;} .bor-orange{border:1px solid #FF7500;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} diff --git a/public/react/public/css/css_min_all.css b/public/react/public/css/css_min_all.css index 5ffdc4db7..9bbf43e9b 100755 --- a/public/react/public/css/css_min_all.css +++ b/public/react/public/css/css_min_all.css @@ -533,7 +533,7 @@ input::-ms-clear{display:none;} .bor-grey-d{border:1px solid #ddd;} .bor-grey01{border:1px solid #E6EAEB;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} /*延时*/ diff --git a/public/react/public/css/edu-common.css b/public/react/public/css/edu-common.css index a82fa22d2..6817312ad 100755 --- a/public/react/public/css/edu-common.css +++ b/public/react/public/css/edu-common.css @@ -536,7 +536,7 @@ input::-ms-clear{display:none;} .bor-grey-d{border:1px solid #ddd;} .bor-grey01{border:1px solid #E6EAEB;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} /*延时*/ diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index f6f2067ad..19dce082e 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -9,7 +9,8 @@ class OfficialAcademicTranscript extends Component { super(props); this.state = { loadingstate:true, - datas:undefined + datas:undefined, + customsids:undefined } } @@ -52,8 +53,14 @@ class OfficialAcademicTranscript extends Component { if(score!=null&&score!=undefined&&score!=""){ if(score<0){ this.props.showNotification("调分不能小于0"); + this.setState({ + customsids:id + }) }else if(score>maxsum){ this.props.showNotification(`调分不能大于${maxsum}`); + this.setState({ + customsids:id + }) }else{ let work_id=this.props.data.work_id; let url=`/student_works/${work_id}/adjust_review_score.json` @@ -72,7 +79,8 @@ class OfficialAcademicTranscript extends Component { } }) this.setState({ - datas:newdatas + datas:newdatas, + customsids:undefined }) }else{ this.props.showNotification(result.data.message); @@ -88,7 +96,7 @@ class OfficialAcademicTranscript extends Component { } render() { - let {datas}=this.state; + let {datas,customsids}=this.state; let columns=[{ title: '关卡', @@ -183,7 +191,7 @@ class OfficialAcademicTranscript extends Component { render: (text, record) => ( - this.editgame_scores(e,record.challenge_id.id,record.game_scores.game_score_full)} // min={0} max={record.game_scores.game_score_full} /> diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index d785959fb..ad1d2598c 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -526,7 +526,7 @@ input::-ms-clear{display:none;} .bor-grey01{border:1px solid #E6EAEB;} .bor-orange{border:1px solid #FF7500;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} /*延时*/ diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index c66453b4c..62e052104 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -345,7 +345,7 @@ a.edu-txt-w40,.edu-txt-w40{ width:40px; display: inline-block;text-align: center .bor-grey01{border:1px solid #E6EAEB;} .bor-orange{border:1px solid #FF7500;} .bor-blue{border:1px solid #5faee3;} -.bor-red{border:1px solid #db0505;} +.bor-red{border:1px solid #db0505 !important;} .bor-none{border:none;} .bor-outnone{outline:none; border:0px;} From 21c71f92abe0c658155d75f303678175a3de4270 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 31 Aug 2019 13:45:47 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E8=B0=83=E5=88=86=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/services/homeworks_service.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb index 6659ec760..f6868afba 100644 --- a/app/services/homeworks_service.rb +++ b/app/services/homeworks_service.rb @@ -298,6 +298,9 @@ class HomeworksService else 0 end + else + adjust_score = work.challenge_work_scores.select{|work_score| work_score.challenge_id == game.challenge_id}.last + final_score += adjust_score.score if adjust_score.present? end end From 04df39ee1f24a392c33f43e163504e6370028f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 31 Aug 2019 13:46:52 +0800 Subject: [PATCH 12/15] b --- .../shixunHomework/shixunreport/OfficialAcademicTranscript.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index 19dce082e..2195228e1 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -52,12 +52,12 @@ class OfficialAcademicTranscript extends Component { if(score!=null&&score!=undefined&&score!=""){ if(score<0){ - this.props.showNotification("调分不能小于0"); + this.props.showNotification("不能小于0"); this.setState({ customsids:id }) }else if(score>maxsum){ - this.props.showNotification(`调分不能大于${maxsum}`); + this.props.showNotification(`不能大于关卡分值${maxsum}`); this.setState({ customsids:id }) From eb1216e2afa41dba7192faf80fcdec28e112ab33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 31 Aug 2019 13:51:49 +0800 Subject: [PATCH 13/15] b --- public/react/src/modules/tpm/TPMIndexHOC.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 1782cff56..a81a273bb 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -35,14 +35,14 @@ if (!window['indexHOCLoaded']) { // $('head').append($('') // .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`)); $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?8`)); + .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?6`)); $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?8`)); + .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?6`)); // index.html有加载 $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?8`)); + .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?6`)); // $('head').append($('') From b9dafd27720b244cb70b2c1a47114c8dc02938bf Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 31 Aug 2019 13:52:26 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javascripts/admins/shixuns/index.js | 5 +- .../shixun_work/shixun_work.html.erb | 10 ++- .../admins/shixun_settings/index.html.erb | 3 +- .../shixun_settings/shared/_list.html.erb | 16 +++-- app/views/admins/shixuns/index.html.erb | 4 +- .../admins/shixuns/shared/_list.html.erb | 64 ++++++++++--------- 6 files changed, 58 insertions(+), 44 deletions(-) diff --git a/app/assets/javascripts/admins/shixuns/index.js b/app/assets/javascripts/admins/shixuns/index.js index 62239aa0e..849e13b5b 100644 --- a/app/assets/javascripts/admins/shixuns/index.js +++ b/app/assets/javascripts/admins/shixuns/index.js @@ -5,9 +5,10 @@ $(document).on('turbolinks:load', function() { allowClear: true }); + let search_form = $(".search-form"); + //导出 $(".shixuns-list-form").on("click","#shixuns-export",function () { - let search_form = $(".search-form"); window.location.href = "/admins/shixuns.xls?" + search_form.serialize(); - }) + }); } }); \ No newline at end of file diff --git a/app/templates/shixun_work/shixun_work.html.erb b/app/templates/shixun_work/shixun_work.html.erb index f4aec2ea6..a6ef48c3e 100644 --- a/app/templates/shixun_work/shixun_work.html.erb +++ b/app/templates/shixun_work/shixun_work.html.erb @@ -66,15 +66,19 @@
- - + + + + <% @games.each_with_index do |game, index| %> + <% challenge_score = @homework.challenge_score game.challenge_id %> + <% game_score = @work.work_challenge_score game, challenge_score %> + + <% end %> diff --git a/app/views/admins/shixun_settings/index.html.erb b/app/views/admins/shixun_settings/index.html.erb index 4aacfb22e..8fd7a2526 100644 --- a/app/views/admins/shixun_settings/index.html.erb +++ b/app/views/admins/shixun_settings/index.html.erb @@ -22,8 +22,7 @@ <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %> - <%= link_to "清除",admins_shixun_settings_path(status:nil,tag:nil,search_type:nil,keyword:nil),class: "btn btn-default" %> - + <%= link_to "清除",admins_shixun_settings_path,class: "btn btn-default",'data-disable-with': '清除中...' %>
导出
diff --git a/app/views/admins/shixun_settings/shared/_list.html.erb b/app/views/admins/shixun_settings/shared/_list.html.erb index 14a97d002..0235e5ef8 100644 --- a/app/views/admins/shixun_settings/shared/_list.html.erb +++ b/app/views/admins/shixun_settings/shared/_list.html.erb @@ -1,5 +1,5 @@
关卡任务名称开启时间任务名称开启时间 评测次数 完成时间 耗时 经验值关卡得分调分
<%= index + 1 %> @@ -88,6 +92,8 @@ <%= finished_time game.end_time %> <%= ApplicationController.helpers.time_consuming game %> <%= game.final_score %> / <%= game.challenge.all_score %><%= game_score %> / <%= challenge_score %><%= game_score %>
- + @@ -19,11 +19,15 @@ - <% shixun_settings.each_with_index do |shixun,index| %> - - <% page_no = (@params_page.to_i - 1) * 20 + index + 1 %> - <%= render partial: "admins/shixun_settings/shared/td",locals: {shixun: shixun,page_no:page_no} %> - + <% if shixun_settings.present? %> + <% shixun_settings.each_with_index do |shixun,index| %> + + <% page_no = (@params_page.to_i - 1) * 20 + index + 1 %> + <%= render partial: "admins/shixun_settings/shared/td",locals: {shixun: shixun,page_no:page_no} %> + + <% end %> + <% else %> + <%= render 'admins/shared/no_data_for_table' %> <% end %>
序号 ID 实训名称
diff --git a/app/views/admins/shixuns/index.html.erb b/app/views/admins/shixuns/index.html.erb index 23f0b9400..92fa670ba 100644 --- a/app/views/admins/shixuns/index.html.erb +++ b/app/views/admins/shixuns/index.html.erb @@ -3,7 +3,7 @@ <% end %>
- <%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',remote:true) do %> + <%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',id:"shixuns-search-form",remote:true) do %>
<% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %> @@ -22,7 +22,7 @@
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %> - <%= link_to "清除",admins_shixuns_path(status:nil,tag:nil,search_type:nil,keyword:nil),class: "btn btn-default" %> + <%= link_to "清除",admins_shixuns_path,class: "btn btn-default",id:"shixuns-clear-search",'data-disable-with': '清除中...' %> <% end %> 导出
diff --git a/app/views/admins/shixuns/shared/_list.html.erb b/app/views/admins/shixuns/shared/_list.html.erb index afa457a77..64fb32d56 100644 --- a/app/views/admins/shixuns/shared/_list.html.erb +++ b/app/views/admins/shixuns/shared/_list.html.erb @@ -14,36 +14,40 @@ 操作 - <% shixuns.each_with_index do |shixun,index| %> - - <%= (@params_page.to_i - 1) * 20 + index + 1%> - <%= shixun.identifier %> - <%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %> - - <%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %> - - - <% if shixun.try(:fork_from).nil? %> - -- - <% else%> - <%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%> - <% end%> - - <%= shixun.challenges.where(:st => 0).size %> - <%= shixun.challenges.where(:st => 1).size %> - <%= shixun_authentication_status shixun %> - <%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %> - <%= format_time shixun.created_at %> - - class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>"> - - - - <% if shixun.status == 0 %> - <%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %> - <% end %> - - + <% if shixuns.present? %> + <% shixuns.each_with_index do |shixun,index| %> + + <%= (@params_page.to_i - 1) * 20 + index + 1%> + <%= shixun.identifier %> + <%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %> + + <%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %> + + + <% if shixun.try(:fork_from).nil? %> + -- + <% else%> + <%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%> + <% end%> + + <%= shixun.challenges.where(:st => 0).size %> + <%= shixun.challenges.where(:st => 1).size %> + <%= shixun_authentication_status shixun %> + <%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %> + <%= format_time shixun.created_at %> + + class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>"> + + + + <% if shixun.status == 0 %> + <%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %> + <% end %> + + + <% end %> + <% else %> + <%= render 'admins/shared/no_data_for_table' %> <% end %> From 469fa25837ff4bb0cb7acf6a0a9a9445aa5402ec Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Sat, 31 Aug 2019 14:27:11 +0800 Subject: [PATCH 15/15] =?UTF-8?q?TPM=E6=B7=BB=E5=8A=A0=E6=96=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.js | 1 - .../modules/courses/members/studentsList.js | 36 ++-- public/react/src/modules/tpm/TPMBanner.js | 2 +- public/react/src/modules/tpm/TPMIndex.js | 39 +++- .../tpm/shixunchild/Repository/Repository.js | 21 +- .../Repository/RepositoryAddFile.js | 203 +++++++++++++++--- 6 files changed, 233 insertions(+), 69 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index b40af3e0b..49c2eab99 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -372,7 +372,6 @@ class App extends Component { path="/interesse" component={Interestpage} /> - diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 8071e2680..0b9a9dc86 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -595,23 +595,25 @@ class studentsList extends Component{ { isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 } { isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 } + .drop_down_menu li a { + padding: 0px; + font-size: 14px; + } + .drop_down_menu { + width: 93px; + } + .drop_down_menu li { + overflow: visible; + width:100%; + box-sizing:boder-box; + float:unset; + } + .drop_down_menu, .drop_down_normal { + padding-top: 10px; + padding-bottom: 8px; + } + + `} { isAdmin &&
  • 导出 diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index fc9c53be1..0009e1f98 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -581,7 +581,7 @@ class TPMBanner extends Component { return ( shixunsDetails===undefined?"": -
    +
    {AccountProfiletype===true? import('./TPMChallengeContainer'), @@ -116,6 +118,13 @@ const TPMUpdatepropaede = Loadable({ }) + +// 版本库添加文件 +const AddFile = Loadable({ + loader: () => import('./shixunchild/Repository/RepositoryAddFile'), + loading: Loading, +}) + const interceptorUrlArray = ['repository.json', 'commits.json', 'propaedeutics.json' , 'challenges.json', 'discusses.json', 'ranking_list.json', 'collaborators.json'] const cacheInterceptorUrlMap = {} @@ -258,15 +267,18 @@ class TPMIndex extends Component { // } render() { - + let url = window.location.href; + let flag = url.indexOf("add_file")>-1; return (
    - - - + { + !flag && + + } + ) }> - () - }> + () + }> + + () + }> {/* */} {/* jfinalshop/WebRoot */} @@ -83,7 +84,12 @@ class Repository extends Component { Git使用指南 - {/* */} + { + this.props.current_user && this.props.current_user.admin ==true ? + +添加文件:"" + } + +
    {/* 用户、最近提交时间 */} { - trees === undefined || trees === null ?
    -
    - -

    暂时还没有相关数据哦!

    -
    -
    : + trees === undefined || trees === null ? :
    {author.name}{ - this.setState({ - visible:true - }) + componentDidMount(){ + let cmOptions = createCMOptions(this.props.mirror_name) + const extend_editor = window.CodeMirror.fromTextArea(window.$('#codemirror-file-edit')[0] + , cmOptions); + + // tpi没setValue也可以 + extend_editor.setValue('') + extend_editor.refresh(); + + // 拖拽也需要用 : window.editor_CodeMirror.refresh() + window.editor_tempCodeMirror = extend_editor; + this.extend_editor = extend_editor; } - cancelAdd = () =>{ - this.setState({ - visible:false + + checkPath= (rule, value, callback) =>{ + if (value.indexOf("/") > -1 && value.length==1 ) { + callback('请输入正确的文件路径'); + }else{ + callback(); + } + } + + handleSubmit = () =>{ + this.props.form.validateFieldsAndScroll((err, values) => { + if(!err){ + let shixunId = this.props.match.params.shixunId; + let url = `/shixuns/${shixunId}/add_file.json` + axios.post(url,{ + path:values.path, + message:values.message, + content:this.extend_editor.getValue() + }).then((result)=>{ + if(result){ + this.props.history.push(`${result.data.url}`) + } + }).catch((error)=>{ + console.log(error); + }) + } }) } render(){ - let { visible } = this.state + const {getFieldDecorator} = this.props.form; + let { shixunId } = this.props.match.params; return( - - +添加文件 - -
    +
    + +

    + + 实训项目 + 版本库 + 添加新文件 + +

    +
    +
    + + {getFieldDecorator('path', { + rules: [ + {required: true, message: "文件名不能为空"}, + { + validator:this.checkPath + }] + })( + + )} + +
    +
    +

    + +

    + +
    + +
    + + {getFieldDecorator('message', { + rules: [{required: true, message: "请输入提交信息"}], + })( + + )} +
    -
    - 取消 - 提交 +
    + + 取消
    - - + + +
    ) } }