From 4086d2ce05fab9d9e06c741d27de046e95dfe187 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 27 Jun 2019 17:06:55 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=94=B9=E6=88=90=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=BA=86=E7=9A=84=EF=BC=8C=E9=83=BD=E6=98=AF?= =?UTF-8?q?=E8=A6=81=E6=98=BE=E7=A4=BA=E7=9A=84=EF=BC=8C=E4=B8=8D=E7=AE=A1?= =?UTF-8?q?hidden=E7=9A=84=E5=80=BC=E6=98=AFtrue=E8=BF=98=E6=98=AFfalse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/comment/Comments.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/comment/Comments.js b/public/react/src/modules/comment/Comments.js index 20f48cd92..711ece6fa 100644 --- a/public/react/src/modules/comment/Comments.js +++ b/public/react/src/modules/comment/Comments.js @@ -323,11 +323,14 @@ class Comments extends Component {
- { item.hidden && ((this.props.onlySuperAdminCouldHide && !item.isSuperAdmin) + {/* 改成后端返回了的,都是要显示的,不管hidden的值是true还是false */} + + {/* { item.hidden && ((this.props.onlySuperAdminCouldHide && !item.isSuperAdmin) || !this.props.onlySuperAdminCouldHide && item.admin === false && (item.manager === false || item.manager == undefined)) ?

违规评论已被屏蔽!

- :
- } + : */} +
+ {/* } */}
From aadf46fd5829db53dbb2ce22404b461a920aa133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 27 Jun 2019 17:08:37 +0800 Subject: [PATCH 2/7] b --- public/react/src/modules/tpm/TPMIndexHOC.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index d3054e029..1ae9e34fb 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -34,8 +34,8 @@ if (!window['indexHOCLoaded']) { .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?1525440977`)); // index.html有加载 - $('head').append($('') - .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?1525440977`)); + $('head').append($('') + .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?1525440977`)); // $('head').append($('') From 61cca9b1c2ef3c257496224b58a6ade0eb792540 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 27 Jun 2019 17:11:55 +0800 Subject: [PATCH 3/7] check_test --- public/react/src/context/TPIContextProvider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index b332c50a8..9f384cfe1 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -715,9 +715,9 @@ pop_box_new(htmlvalue, 480, 182); testSetUnlock() { const { game } = this.state; - const url = `/v1/games/${game.identifier}/check_test_sets.json` + const url = `/tasks/${game.identifier}/check_test_sets.json` axios.get(url, { - withCredentials: true, + // withCredentials: true, }) .then((response) => { // TODO status -2 重复操作,直接解锁 From e5638bbeb86806ff54e1d32927a9dc73ed1d0ebb Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 27 Jun 2019 17:25:32 +0800 Subject: [PATCH 4/7] deltaScore --- public/react/src/context/TPIContextProvider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index 9f384cfe1..c723bacf4 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -714,7 +714,7 @@ pop_box_new(htmlvalue, 480, 182); } testSetUnlock() { - const { game } = this.state; + const { game, challenge } = this.state; const url = `/tasks/${game.identifier}/check_test_sets.json` axios.get(url, { // withCredentials: true, @@ -727,7 +727,7 @@ pop_box_new(htmlvalue, 480, 182); return; } else { // 被扣除的金币,是负数 - const deltaScore = response.data.score; + const deltaScore = -challenge.score * 5; // output_sets let { output_sets } = this.state; output_sets = Object.assign({}, output_sets); From 780b4d64ffc2338fb5e0f813feddc8747f5ae0eb Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 27 Jun 2019 17:31:12 +0800 Subject: [PATCH 5/7] test_sets --- public/react/src/context/TPIContextProvider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index c723bacf4..51769b605 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -731,8 +731,8 @@ pop_box_new(htmlvalue, 480, 182); // output_sets let { output_sets } = this.state; output_sets = Object.assign({}, output_sets); - const test_sets_array = JSON.parse("[" + response.data.test_sets + "]"); - output_sets.test_sets_array = test_sets_array; + // const test_sets_array = JSON.parse("[" + response.data.test_sets + "]"); + output_sets.test_sets_array = response.data.test_sets; this.setState({ output_sets: output_sets, grade: this.state.grade + deltaScore, From 2cc8de08982d4784528da8211cf7e8c1c925818c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 27 Jun 2019 17:59:30 +0800 Subject: [PATCH 6/7] tip --- .../src/modules/courses/busyWork/CommonWorkPost.js | 2 ++ .../src/modules/tpm/challengesnew/TPMMDEditor.js | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkPost.js b/public/react/src/modules/courses/busyWork/CommonWorkPost.js index c9c5c7b45..3f65faafa 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkPost.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkPost.js @@ -659,6 +659,8 @@ render(){ {getFieldDecorator('description', { rules: [{ diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js index e70454056..0f00d1c25 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js +++ b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js @@ -41,11 +41,12 @@ function md_clear_data(k,mdu,id){ var id1 = "#e_tip_"+id; var id2 = "#e_tips_"+id; if(k == 'content'){ - $(id2).html(""); + $(id2).html(" "); }else{ - $(id1).html(""); + $(id1).html(" "); } } +window.md_clear_data = md_clear_data // editor 存在了jquery对象上,应用不需要自己写md_rec_data方法了 function md_rec_data(k, mdu, id) { if (window.sessionStorage.getItem(k + mdu) !== null) { @@ -80,8 +81,8 @@ function md_elocalStorage(editor,mdu,id){ var id1 = "#e_tip_"+id; var id2 = "#e_tips_"+id; - $(id1).html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 "); - $(id2).html(""); + $(id2).html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 "); + // $(id2).html(""); } },10000); @@ -302,8 +303,8 @@ export default class TPMMDEditor extends Component {
- {noStorage == true ? ' ' :

} - {noStorage == true ? ' ' :

} + {noStorage == true ? ' ' :

 

} + {/* {noStorage == true ? ' ' :

 

} */}
) From d3c515392f4bd04450b30da8e901b5d4013ca0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 27 Jun 2019 23:02:12 +0800 Subject: [PATCH 7/7] =?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/AccessoryModal.js | 73 +++- .../courses/exercise/Exercisesetting.js | 4 +- .../tasks/GraduationTasksappraise.js | 2 +- .../tasks/GraduationTaskssettinglist.js | 1 + .../shixunHomework/ShixunWorkReport.js | 20 +- .../Shixunworkdetails/ShixunWorkModal.js | 12 + .../OfficialAcademicTranscript.js | 352 +++++++++--------- 7 files changed, 278 insertions(+), 186 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/AccessoryModal.js b/public/react/src/modules/courses/coursesPublic/AccessoryModal.js index 9c57001c8..5baf4e0c6 100644 --- a/public/react/src/modules/courses/coursesPublic/AccessoryModal.js +++ b/public/react/src/modules/courses/coursesPublic/AccessoryModal.js @@ -16,7 +16,8 @@ class AccessoryModal extends Component{ ModalCancel:"", ModalSave:"", loadtype:false, - updatas:false + updatas:false, + shixunsreplace:false } } @@ -103,7 +104,8 @@ class AccessoryModal extends Component{ Modalstype:false, Modalstopval:"", ModalSave:this.ModalCancelModalCancel, - loadtype:false + loadtype:false, + shixunsreplace:false, }) this.props.Cancel() } @@ -115,11 +117,11 @@ class AccessoryModal extends Component{ for(var list of fileList){ newfileList.push(list.response.id) } -debugger + if (newfileList.length == 0) { // this.props.showNotification('请先上传附件') this.setState({ - updatas:true + shixunsreplace:true, }) return; } @@ -130,7 +132,7 @@ debugger attachment_ids:newfileList }).then((result)=>{ console.log(result) - if(result.data.status===0){ + if(result !== undefined){ this.props.setupdate() this.props.showNotification('提交成功') // this.setState({ @@ -139,7 +141,6 @@ debugger // ModalSave:this.ModalCancelModalCancel, // loadtype:true // }) - this.ModalCancelModalCancel() if(this.props.seeworks!=undefined){ this.props.history.push(this.props.seeworks); @@ -155,6 +156,46 @@ debugger description:e.target.value }) } + //确认 + hidestartshixunsreplace=()=>{ + let id=this.props.categoryid; + let {fileList,description} =this.state; + + let newfileList=[]; + for(var list of fileList){ + newfileList.push(list.response.id) + } + let url= this.props.reviseAttachmentUrl || "/graduation_works/"+id+"/revise_attachment.json" + axios.post(url,{ + description:description, + attachment_ids:newfileList + }).then((result)=>{ + console.log(result) + if(result.data.status===0){ + this.props.setupdate() + this.props.showNotification('提交成功') + // this.setState({ + // Modalstype:true, + // Modalstopval:result.data.message, + // ModalSave:this.ModalCancelModalCancel, + // loadtype:true + // }) + + this.ModalCancelModalCancel() + if(this.props.seeworks!=undefined){ + this.props.history.push(this.props.seeworks); + } + } + }).catch((error)=>{ + + }) + } + //取消 + hidestartshixunsreplacetwo=()=>{ + this.setState({ + shixunsreplace:false, + }) + } render(){ let {settextarea,fileList, @@ -163,6 +204,7 @@ debugger ModalCancel, ModalSave, loadtype, + shixunsreplace, }=this.state; let {course_groups}=this.props; const uploadProps = { @@ -186,6 +228,25 @@ debugger return( + + +
+

还未上传附件

+

是否确认提交作品?

+
+
+ this.hidestartshixunsreplace()}>确认 + this.hidestartshixunsreplacetwo()}>取消 +
+
{/*提示*/}

- 发布设置(课堂管理员、教师、助教拥有发布设置权限) + 发布设置 { !flagPageEdit&&this.props.isAdmin()===true ? @@ -660,7 +660,7 @@ class Exercisesetting extends Component{ {getFieldDecorator('time') ( - )} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js index 638a09507..562882bbb 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js @@ -253,7 +253,7 @@ class GraduationTasksappraise extends Component{

补交附件
-
+
补交原因:{firelistdata&&firelistdata.revise_reason}
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 63bc79e91..015971265 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -640,6 +640,7 @@ class GraduationTaskssettinglist extends Component{ title: '姓名', dataIndex: 'name', key: 'name', + className:'edu-txt-center' }, { title: '学号', diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index ee97a77d9..e07b772e9 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -45,7 +45,16 @@ class ShixunWorkReport extends Component { shixuntypes:type[3] }) } - + jumptopic=(anchorName)=>{ +; if (anchorName) { + // 找到锚点 + let anchorElement = document.getElementById(anchorName); + // 如果对应id的锚点存在,就跳转到锚点 + if(anchorElement) { + anchorElement.scrollIntoView(); + } + } + } render() { let{data} =this.state; let category_id=data===undefined?"":data.category.category_id; @@ -100,6 +109,7 @@ class ShixunWorkReport extends Component {
@@ -167,7 +177,7 @@ class ShixunWorkReport extends Component { { data&&data.shixun_detail===undefined?"":data.shixun_detail.map((item,key)=>{ return( -
+

@@ -175,7 +185,7 @@ class ShixunWorkReport extends Component { 第{item.position}关 - + {item.subject} @@ -185,8 +195,8 @@ class ShixunWorkReport extends Component { />

- {item.st===0?
-
+ {item.st===0?
+

最近通过的代码 {item.path} diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index e914ee19c..eaf1c433e 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -74,6 +74,9 @@ class ShixunWorkModal extends Component{ response.data. course_groups.group_list&&response.data.group_list.map((item,key)=>{ newgroup_list.push(item) }) + response.data. course_groups.ungroup_list&&response.data.ungroup_list.map((items,keys)=>{ + newgroup_list.push(items) + }) this.setState({ course_groups:response.data, group_list:newgroup_list, @@ -123,6 +126,15 @@ class ShixunWorkModal extends Component{ isSave=()=>{ let{group_ids}=this.state; + if(group_ids&&group_ids.length === 0){ + this.props.showNotification(`请先选择分班`); + return + } + if(group_ids&&group_ids.length < 2){ + this.props.showNotification(`有效作品数少于2个,无法查重`); + return + } + let url="/homework_commons/"+this.props.match.params.homeworkid+"/homework_code_repeat.json"; axios.post(url, { group_ids: group_ids, diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index 091b94130..fb24e6a3e 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -1,173 +1,181 @@ -import React, {Component} from "react"; -import {WordsBtn} from 'educoder'; -import {Table} from "antd"; -import {Link,Switch,Route,Redirect} from 'react-router-dom'; - -class OfficialAcademicTranscript extends Component { - - constructor(props) { - super(props); - this.state = { - loadingstate:true, - datas:undefined - } - } - - componentDidMount() { - - } - - render() { - - 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}, - // adjustmentminute:asdasd - }) - }) - } - - - - let columns=[{ - title: '关卡', - dataIndex: 'customs', - key: 'customs', - render: (text, record) => ( - - {record.customs} - - ), - }, { - title: '任务名称', - dataIndex: 'taskname', - key: 'taskname', - render: (text, record) => ( - - {record.taskname.name} - {record.taskname.complete_status===2?延时:record.taskname.complete_status===3?延时:""} - - ), - }, { - title: '开启时间', - dataIndex: 'openingtime', - key: 'openingtime', - render: (text, record) => ( - - {record.openingtime} - - ), - }, { - title: '评测次数', - key: 'evaluating', - dataIndex: 'evaluating', - - render: (text, record) => ( - - {record.evaluating} - - ), - }, { - title: '完成时间', - key: 'finishtime', - dataIndex: 'finishtime', - render: (text, record) => ( - - {record.finishtime} - - ), - }, { - title: '耗时', - key: 'elapsedtime', - dataIndex: 'elapsedtime', - - render: (text, record) => ( - - {record.elapsedtime} - - ), - }, { - title: '经验值', - key: 'empvalue', - dataIndex: 'empvalue', - - render: (text, record) => ( - - {record.empvalue.myself}/{record.empvalue.experience} - - ), - }]; - // { - // title: '调分', - // key: 'adjustmentminute', - // dataIndex: 'adjustmentminute', - // - // render: (text, record) => ( - // - // 6小时 50分钟 6秒 - // - // ), - // }, - - - - return ( -

- {/*{data===undefined?"":""}*/} - - {datas===undefined?"":} - - - ) - } -} - +import React, {Component} from "react"; +import {WordsBtn} from 'educoder'; +import {Table} from "antd"; +import {Link,Switch,Route,Redirect} from 'react-router-dom'; + +class OfficialAcademicTranscript extends Component { + + constructor(props) { + super(props); + this.state = { + loadingstate:true, + datas:undefined + } + } + + componentDidMount() { + + } + myjumptopic=(e)=>{ + console.log("获取到值"); + console.log(e); + this.props.jumptopic(e); + } + + render() { + + 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}, + // adjustmentminute:asdasd + }) + }) + } + + + + let columns=[{ + title: '关卡', + dataIndex: 'customs', + key: 'customs', + render: (text, record) => ( + + {record.customs} + + ), + }, { + title: '任务名称', + dataIndex: 'taskname', + key: 'taskname', + render: (text, record) => ( + + this.myjumptopic("id"+record.customs)} >{record.taskname.name} + {record.taskname.complete_status===2?延时:record.taskname.complete_status===3?延时:""} + + ), + }, { + title: '开启时间', + dataIndex: 'openingtime', + key: 'openingtime', + render: (text, record) => ( + + {record.openingtime} + + ), + }, { + title: '评测次数', + key: 'evaluating', + dataIndex: 'evaluating', + + render: (text, record) => ( + + {record.evaluating} + + ), + }, { + title: '完成时间', + key: 'finishtime', + dataIndex: 'finishtime', + render: (text, record) => ( + + {record.finishtime} + + ), + }, { + title: '耗时', + key: 'elapsedtime', + dataIndex: 'elapsedtime', + + render: (text, record) => ( + + {record.elapsedtime} + + ), + }, { + title: '经验值', + key: 'empvalue', + dataIndex: 'empvalue', + + render: (text, record) => ( + + {record.empvalue.myself}/{record.empvalue.experience} + + ), + }]; + // { + // title: '调分', + // key: 'adjustmentminute', + // dataIndex: 'adjustmentminute', + // + // render: (text, record) => ( + // + // 6小时 50分钟 6秒 + // + // ), + // }, + + + + return ( +
+ {/*{data===undefined?"":""}*/} + + {datas===undefined?"":
} + + + ) + } +} + export default OfficialAcademicTranscript; \ No newline at end of file