From 1f49c1b45dc763756c3efe990816fad06397c37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 28 Jun 2019 15:21:42 +0800 Subject: [PATCH 01/39] b --- public/react/config/webpack.config.dev.js | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index ceddbd81b..dfd54f38b 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -114,21 +114,21 @@ module.exports = { // First, run the linter. // It's important to do this before Babel processes the JS. // 上线然后要注释回来 - // { - // test: /\.(js|jsx|mjs)$/, - // enforce: 'pre', - // use: [ - // { - // options: { - // formatter: eslintFormatter, - // eslintPath: require.resolve('eslint'), - // - // }, - // loader: require.resolve('eslint-loader'), - // }, - // ], - // include: paths.appSrc, - // }, + { + test: /\.(js|jsx|mjs)$/, + enforce: 'pre', + use: [ + { + options: { + formatter: eslintFormatter, + eslintPath: require.resolve('eslint'), + + }, + loader: require.resolve('eslint-loader'), + }, + ], + include: paths.appSrc, + }, { // "oneOf" will traverse all following loaders until one will // match the requirements. When no loader matches it will fall From b6de31849466cdb43672769d60b9b5df02bab145 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 28 Jun 2019 15:36:31 +0800 Subject: [PATCH 02/39] CreateGroupByImportModal --- .../members/modal/CreateGroupByImportModal.js | 158 ++++++++++++++++++ .../modules/courses/members/studentsList.js | 9 +- 2 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js diff --git a/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js b/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js new file mode 100644 index 000000000..fe2a88dce --- /dev/null +++ b/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js @@ -0,0 +1,158 @@ +import React, { Component } from "react"; +import { Modal, Checkbox, Input, Spin, Upload, Divider, Icon } from "antd"; +import axios from 'axios' +import ModalWrapper from "../../common/ModalWrapper" + +import { ConditionToolTip, getUploadActionUrl } from 'educoder' + +const { Dragger } = Upload; + + + +class CreateGroupByImportModal extends Component{ + constructor(props){ + super(props); + this.state={ + } + } + fetchMemberList = (arg_page) => { + } + componentDidMount() { + + + } + onSendOk = () => { + const courseId = this.props.match.params.coursesId + + let url = `/courses/${courseId}/create_group_by_importing_file.json` + let { fileList } =this.state; + + if (!fileList || fileList.length == 0) { + // this.props.showNotification('请先上传附件') + this.setState({ + errorTip :'请先上传附件', + }) + return; + } + let newfileList=[]; + for(var list of fileList){ + newfileList.push(list.response.id) + } + + axios.post(url, { + attachment_ids: newfileList + }) + .then((response) => { + if (response.data.status == 0) { + this.props.showNotification(response.data.message) + this.setVisible(false) + } else { + + } + }) + .catch(function (error) { + console.log(error); + }); + } + setVisible = (visible) => { + if (visible) { + this.setState({ fileList: [] }); + } + this.refs.modalWrapper.setVisible(visible) + + } + handleChange = (info) => { + let fileList = info.fileList; + console.log(fileList) + this.setState({ fileList }); + } + + onOk = () => { + this.onSendOk() + } + + onAttachmentRemove = (file) => { + this.props.confirm({ + content: '是否确认删除?', + + onOk: () => { + this.deleteAttachment(file) + }, + onCancel() { + console.log('Cancel'); + }, + }); + + return false; + } + deleteAttachment = (file) => { + const url = `/attachments/${file.response ? file.response.id : file.uid}.json` + axios.delete(url, { + }) + .then((response) => { + if (response.data) { + // const { status } = response.data; + if (response.data.status === 0) { + + this.setState((state) => { + const index = state.fileList.indexOf(file); + const newFileList = state.fileList.slice(); + newFileList.splice(index, 1); + return { + fileList: newFileList, + }; + }); + } + } + }) + .catch(function (error) { + console.log(error); + }); + } + + render(){ + const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names + , graduationGroup, graduation_groups, courseGroup, course_groups } = this.state + const { moduleName } = this.props + + const props = { + name: 'file', + multiple: true, + action: getUploadActionUrl(), + onRemove: this.onAttachmentRemove, + onChange: this.handleChange + }; + return( + + + +
+ + + +
+ +

+ +

+

点击或拖拽文件到这里上传

+

+ 单个文件最大150MB +

+
+
+ ) + } +} +export default CreateGroupByImportModal; diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 9c6254cbd..ba41f1f9e 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -14,6 +14,8 @@ import axios from 'axios' import _ from 'lodash' import NoneData from "../coursesPublic/NoneData" +import CreateGroupByImportModal from './modal/CreateGroupByImportModal' + const Search =Input.Search; const dataSource = [{ check:, @@ -488,7 +490,10 @@ class studentsList extends Component{ searchPlaceholder={ '请输入姓名、学号进行搜索' } firstRowRight={ - {/* { isSuperAdmin && this.addTeacher()}>导入创建分班 } */} + { isSuperAdmin && + {/* */} + this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班 + } { isAdmin && isParent && this.addDir()}>新建分班 } { isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 } { isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 } @@ -582,11 +587,13 @@ class studentsList extends Component{ ) }) } { isAdmin && +

this.addDir()} >添加分班...

+ } } From c96ad91ac10fe0737ee62bbc15859ad3f335b8c8 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 28 Jun 2019 15:40:18 +0800 Subject: [PATCH 03/39] HH --- public/react/src/modules/courses/Resource/Fileslistitem.js | 4 ++-- public/react/src/modules/courses/busyWork/CommonWorkList.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index a20dcf9c3..afcdf35f4 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -271,7 +271,7 @@ class Fileslistitem extends Component{ return(
{item.course_group_name} - 将发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD hh:mm')} + 将发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD HH:mm')}
) })} @@ -289,7 +289,7 @@ class Fileslistitem extends Component{ {/*{moment(discussMessage.publish_time).fromNow()}*/} { discussMessage.publish_time===null?"": discussMessage.is_publish===true?"":"发布于"} - { discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD hh:mm')} + { discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD HH:mm')} {this.props.isAdmin ||this.props.current_user.login===discussMessage.author.login? diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index b1a1d5553..251e39fcb 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -190,7 +190,7 @@ function buildColumns(that, student_works) { render: (update_time, record) => ( - {update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'} + {update_time ? moment(update_time).format('YYYY-MM-DD HH:mm') : '--'} ), }]) From 26989c034d4e9f10c5bf022f1ea7f6f123965d0f Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 28 Jun 2019 15:45:46 +0800 Subject: [PATCH 04/39] unlockedAnswers.length --- .../modules/page/main/CodeEvaluateMultiLevelAnswerUnlock.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/page/main/CodeEvaluateMultiLevelAnswerUnlock.js b/public/react/src/modules/page/main/CodeEvaluateMultiLevelAnswerUnlock.js index 8a0430c8f..672fc26a6 100644 --- a/public/react/src/modules/page/main/CodeEvaluateMultiLevelAnswerUnlock.js +++ b/public/react/src/modules/page/main/CodeEvaluateMultiLevelAnswerUnlock.js @@ -28,7 +28,7 @@ class CodeEvaluateMultiLevelAnswerUnlock extends Component { } render() { - const { shixun, challenge, lockedAnswers } = this.props; + const { shixun, challenge, lockedAnswers, unlockedAnswers } = this.props; const { currentLevel } = this.state; return (
@@ -85,7 +85,7 @@ class CodeEvaluateMultiLevelAnswerUnlock extends Component { this.onLevelClick(item, index)} checked={currentLevel>=index}>
-
{index + 1}
+
{index + 1 + (unlockedAnswers && unlockedAnswers.length || 0) }
{item.name}
{item.score}%
{challenge.score * item.score / 100}
From cd62a4b289e8b299791d43031ae12d249f11a637 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 28 Jun 2019 15:54:30 +0800 Subject: [PATCH 05/39] width: 1024px; --- public/react/src/modules/courses/exercise/new/NullDisplay.js | 2 +- public/react/src/modules/courses/members/studentsList.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/exercise/new/NullDisplay.js b/public/react/src/modules/courses/exercise/new/NullDisplay.js index e5c604767..e61c1d2f7 100644 --- a/public/react/src/modules/courses/exercise/new/NullDisplay.js +++ b/public/react/src/modules/courses/exercise/new/NullDisplay.js @@ -86,7 +86,7 @@ class NullDisplay extends Component{ padding:12px 10px; margin-bottom:10px; border-radius:2px; - max-width: 1024px; + width: 1024px; word-break: break-all; } .answerRow { diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index ba41f1f9e..669d8a65d 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -492,7 +492,7 @@ class studentsList extends Component{ { isSuperAdmin && {/* */} - this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班 + {/* this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班 */} } { isAdmin && isParent && this.addDir()}>新建分班 } { isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 } From 819bfed857fec1c06b238973442301456f0935c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 28 Jun 2019 16:47:03 +0800 Subject: [PATCH 06/39] =?UTF-8?q?=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graduation/tasks/GraduationTasksnew.js | 26 ++++++-- .../modules/tpm/TPMsettings/TPMsettings.js | 7 ++- .../tpm/challengesnew/TPMevaluation.js | 25 +++++++- .../src/modules/tpm/newshixuns/Newshixuns.js | 36 +++++++++-- .../Collaborators/Collaborators.js | 59 +++++++++++++++++-- 5 files changed, 132 insertions(+), 21 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js index 560658e9e..74ba21b62 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js @@ -342,8 +342,17 @@ class GraduationTasksnew extends Component { {/*内容*/}
- - + + {getFieldDecorator('tasktype', { rules: [{required: true, message: "请选择任务类型"}], })(

列表中没有? @@ -1214,6 +1214,7 @@ export default class TPMsettings extends Component { @@ -1354,10 +1355,11 @@ export default class TPMsettings extends Component { -

执行命令不能为空

@@ -1369,6 +1371,7 @@ export default class TPMsettings extends Component { value={Compilecommandvalue} onInput={this.Compilecommand} id="compile_command" + style={{width:'100%'}} > diff --git a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js index 73262de74..00141188f 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js +++ b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js @@ -381,7 +381,7 @@ export default class TPMevaluation extends Component { // }) // } savegetfilepath=(value)=>{ - let {selectpath} = this.state + let {selectpath,saveshixunfilepath} = this.state // let newarr =selectpatharr; // let arrtype=false; // let arrsum=0; @@ -403,9 +403,28 @@ export default class TPMevaluation extends Component { // newselectpath=newselectpath+newarr[z]+ ";" // } - // let newselectpath=selectpath+value+ ";" - let newselectpath=value + + let newselectpath; + + if(saveshixunfilepath==="shixunfilepathplay"){ + newselectpath=value + }else{ + const type = selectpath.split(';'); + let types=false; + for(var i=0; i -

+

列表中没有? 申请新建

diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js index 07c9f960f..d629a1c5b 100644 --- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js +++ b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js @@ -33,6 +33,7 @@ class Collaborators extends Component { Collaboratorsvisible: false, Collaboratorsvisibleadmin: false, value: 1, + page: 1, Searchadmin: [], allChangechecked: false, Collaboratorslist: [], @@ -155,6 +156,9 @@ class Collaborators extends Component { } onSearchadmin = (value) => { let {collaboratorList,user_name,school_name} = this.state; + this.setState({ + Searchadmin: [], + }) // if (value === "") { // this.setState({ // Searchadmin: [], @@ -172,7 +176,7 @@ class Collaborators extends Component { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { }else{ - let newlist = response.data; + let newlist = response.data.users; for (var i = 0; i < newlist.length; i++) { newlist[i].checked = false } @@ -336,7 +340,48 @@ class Collaborators extends Component { collaboratorListsumtype:false }) } - render() { + + + contentViewScrolledit=(e)=>{ + //滑动到底判断 + + if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let {page,collaboratorList,user_name,school_name,Searchadmin} = this.state; + let newpage=page+1; + let newSearchadmin=Searchadmin + let id = this.props.match.params.shixunId; + let url = "/shixuns/" + id + "/add_collaborators.json"; + axios.get(url,{params:{ + user_name:user_name , + school_name:school_name, + page:newpage + }}).then((response) => { + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + + }else{ + let newlist = response.data.users; + for (var i = 0; i < newlist.length; i++) { + newlist[i].checked = false + newSearchadmin.push(newlist[i]) + } + + console.log(newSearchadmin) + this.setState({ + Searchadmin: newSearchadmin, + collaboratorList: collaboratorList, + page:newpage + }) + } + + }).catch((error) => { + console.log(error) + }); + + } + + } + + render() { let { collaboratorList, Collaboratorsvisible, @@ -445,13 +490,13 @@ class Collaborators extends Component { >搜索

姓名 - 呢称 + 职业 单位

-
}> - this.Viewstudenttraininginformations(record)}>调分 - - this.Viewstudenttraininginformation(record)}>{record.operating} - - ) - }, - ] - + if(JSON.stringify(this.state.course_group_info) === "[]"|| this.state.course_group_info === undefined||this.state.course_group_info === null){ + //这里没有分班 没有 关卡得分 没有效率分 + {/* columns = [*/} + {/* {*/} + {/* title: '序号',*/} + {/* dataIndex: 'number',*/} + // key: 'number', + // align: 'center', + // fixed: 'left', + // width:'100px', + // className:'font-14', + // render: (text, record) => ( + // + // {record.number} + // + // ) + // }, + // { + // title: '姓名', + // dataIndex: 'name', + // key: 'name', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.name} + // + // ) + // }, + // { + // title: '学号', + // dataIndex: 'stduynumber', + // key: 'stduynumber', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} + // + // ), + // }, + // { + // title: '提交状态', + // dataIndex: 'submitstate', + // key: 'submitstate', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.submitstate} + // + // ) + // + // }, + // { + // title: '更新时间', + // dataIndex: 'updatetime', + // key: 'updatetime', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.updatetime} + // + // ), + // }, + // { + // title: '完成情况', + // dataIndex: 'completion', + // key: 'completion', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // + // + //
已通过{record.completion}关,共{this.state.challenges_count}关
+ //
}> + // {record.completion+"/"+this.state.challenges_count} + // + // + // + // ) + // }, + // { + // title: '最终成绩', + // dataIndex: 'finalscore', + // key: 'finalscore', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // { + // record.ultimate_score=== true? + // + //
{record.user_name}{record.user_login}
+ //
{record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
+ //
}> + // { + // record.finalscore&&record.finalscore==="--"? + // {record.finalscore} + // : + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.finalscore} + // } + // + // : + // + //
{record.user_name}{record.user_login}
+ //
{record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
+ //
{record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
+ //
{record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
+ //
{record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
+ // }> + // { + // record.finalscore&&record.finalscore==="--"? + // {record.finalscore} + // : + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.finalscore} + // } + //
+ // + // } + // + // ) + // }, + // { + // title: '操作', + // dataIndex: 'operating', + // key: 'operating', + // display: 'block', + // align: 'center', + // fixed: 'right', + // width:'100px', + // className:'font-14', + // render: (text, record) => ( + // record.submitstate === "未提交" ? --: + // + // + //
直接调整最终成绩的分数
+ //
其它评分全部作废
+ // }> + // this.Viewstudenttraininginformations(record)}>调分 + //
+ // this.Viewstudenttraininginformation(record)}>{record.operating} + //
+ // ) + // }, + // ] + columns.map((item,key)=>{ + if(item.title==="分班"){ + columns.splice(key,1) + } + if(item.title==="关卡得分"){ + columns.splice(key,1) + } + if(item.title==="效率分"){ + columns.splice(key,1) + } + }) }else{ - columns = [ - { - title: '序号', - dataIndex: 'number', - key: 'number', - align: 'center', - width:'96px', - render: (text, record) => ( - - {record.number} - - ) - }, - { - title: '姓名', - dataIndex: 'name', - key: 'name', - align: 'center', - width:'147px', - render: (text, record) => ( - - {record.name} - - ) - }, - { - title: '学号', - dataIndex: 'stduynumber', - key: 'stduynumber', - align: 'center', - width:'200px', - render: (text, record) => ( - - {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} - - ), - }, - { - title: '分班', - key: 'classroom', - dataIndex: 'classroom', - align: 'center', - render: (text, record) => ( - - { - record.classroom&&record.classroom==="--"? - - : - - } - - ) - }, - { - title: '提交状态', - dataIndex: 'submitstate', - key: 'submitstate', - align: 'center', - render: (text, record) => ( - - {record.submitstate} - - ) - - }, - { - title: '更新时间', - dataIndex: 'updatetime', - key: 'updatetime', - align: 'center', - render: (text, record) => ( - - {record.updatetime} - - ), - }, - { - title: '完成情况', - dataIndex: 'completion', - key: 'completion', - align: 'center', - - render: (text, record) => ( - - - -
已通过{record.completion}关,共{this.state.challenges_count}关
- }> - {record.completion+"/"+this.state.challenges_count} -
- -
- ) - }, - { - title: '最终成绩', - dataIndex: 'finalscore', - key: 'finalscore', - align: 'center', - render: (text, record) => ( - - { - record.ultimate_score=== true? - -
{record.user_name}{record.user_login}
-
{record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
- }> - { - record.finalscore&&record.finalscore==="--"? - {record.finalscore} - : - = 90 ? {"color": '#DD1717', "text-align": "center"} : { - "color": '#747A7F', - "text-align": "center" - }}>{record.finalscore} - } -
- : - -
{record.user_name}{record.user_login}
-
{record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
-
{record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
-
{record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
-
{record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
- }> - { - record.finalscore&&record.finalscore==="--"? - {record.finalscore} - : - = 90 ? {"color": '#DD1717', "text-align": "center"} : { - "color": '#747A7F', - "text-align": "center" - }}>{record.finalscore} - } -
- - } -
- ) - }, - { - title: '操作', - dataIndex: 'operating', - key: 'operating', - display: 'block', - align: 'center', - width:'96px', - render: (text, record) => ( - record.submitstate === "未提交" ? --: - - -
直接调整最终成绩的分数
-
其它评分全部作废
- }> - this.Viewstudenttraininginformations(record)}>调分 -
- this.Viewstudenttraininginformation(record)}>{record.operating} -
- ) - }, - ] - + if(this.state.course_group_info.length < 2){ + // columns = [ + // { + // title: '序号', + // dataIndex: 'number', + // key: 'number', + // align: 'center', + // fixed: 'left', + // width:'100px', + // className:'font-14', + {/* render: (text, record) => (*/} + // + {/* {record.number}*/} + {/**/} + {/* )*/} + {/* },*/} + {/* {*/} + {/* title: '姓名',*/} + // dataIndex: 'name', + // key: 'name', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.name} + // + // ) + // }, + // { + // title: '学号', + // dataIndex: 'stduynumber', + // key: 'stduynumber', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} + // + // ), + // }, + // { + // title: '提交状态', + // dataIndex: 'submitstate', + // key: 'submitstate', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.submitstate} + // + // ) + // + // }, + // { + // title: '更新时间', + // dataIndex: 'updatetime', + // key: 'updatetime', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.updatetime} + // + // ), + // }, + // { + // title: '完成情况', + // dataIndex: 'completion', + // key: 'completion', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // + // + //
已通过{record.completion}关,共{this.state.challenges_count}关
+ // }> + // {record.completion+"/"+this.state.challenges_count} + //
+ // + //
+ // ) + // }, + // { + // title: '最终成绩', + // dataIndex: 'finalscore', + // key: 'finalscore', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // { + // record.ultimate_score=== true? + // + //
{record.user_name}{record.user_login}
+ //
{record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
+ // }> + // { + // record.finalscore&&record.finalscore==="--"? + // {record.finalscore} + // : + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.finalscore} + // } + //
+ // : + // + //
{record.user_name}{record.user_login}
+ //
{record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
+ //
{record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
+ //
{record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
+ //
{record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
+ // }> + // { + // record.finalscore&&record.finalscore==="--"? + // {record.finalscore} + // : + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.finalscore} + // } + //
+ // + // } + //
+ // ) + // }, + // { + // title: '操作', + // dataIndex: 'operating', + // key: 'operating', + // display: 'block', + // align: 'center', + // fixed: 'right', + // width:'100px', + // className:'font-14', + // render: (text, record) => ( + // record.submitstate === "未提交" ? --: + // + // + //
直接调整最终成绩的分数
+ //
其它评分全部作废
+ // }> + // this.Viewstudenttraininginformations(record)}>调分 + //
+ // this.Viewstudenttraininginformation(record)}>{record.operating} + //
+ // ) + // }, + // ] + columns.map((item,key)=>{ + if(item.title==="分班"){ + columns.splice(key,1) + } + if(item.title==="关卡得分"){ + columns.splice(key,1) + } + if(item.title==="效率分"){ + columns.splice(key,1) + } + }) + }else { + // columns = [ + // { + // title: '序号', + // dataIndex: 'number', + // key: 'number', + // align: 'center', + // fixed: 'left', + // width:'100px', + // className:'font-14', + // render: (text, record) => ( + // + // {record.number} + // + // ) + // }, + // { + // title: '姓名', + // dataIndex: 'name', + // key: 'name', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.name} + // + // ) + // }, + // { + // title: '学号', + // dataIndex: 'stduynumber', + // key: 'stduynumber', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber}*/} + {/**/} + {/* ),*/} + // }, + // { + // title: '分班', + // key: 'classroom', + {/* dataIndex: 'classroom',*/} + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // { + // record.classroom&&record.classroom==="--"? + // + // : + // + // } + // + // ) + // }, + // { + // title: '提交状态', + // dataIndex: 'submitstate', + {/* key: 'submitstate',*/} + {/* align: 'center',*/} + {/* className:'font-14',*/} + {/* render: (text, record) => (*/} + {/* */} + {/* {record.submitstate} + // + // ) + // + // }, + // { + // title: '更新时间', + // dataIndex: 'updatetime', + // key: 'updatetime', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.updatetime} + // + // ), + // }, + // { + // title: '完成情况', + // dataIndex: 'completion', + // key: 'completion', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // + // + //
已通过{record.completion}关,共{this.state.challenges_count}关
+ // }> + // {record.completion+"/"+this.state.challenges_count} + //
+ // + //
+ // ) + // }, + // { + // title: '最终成绩', + // dataIndex: 'finalscore', + // key: 'finalscore', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // { + // record.ultimate_score=== true? + // + //
{record.user_name}{record.user_login}
+ //
{record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
+ // }> + // { + // record.finalscore&&record.finalscore==="--"? + // {record.finalscore} + // : + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.finalscore} + // } + //
+ // : + // + //
{record.user_name}{record.user_login}
+ //
{record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
+ //
{record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
+ //
{record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
+ //
{record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
+ // }> + // { + // record.finalscore&&record.finalscore==="--"? + // {record.finalscore} + // : + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.finalscore} + // } + //
+ // + // } + //
+ // ) + // }, + // { + // title: '操作', + // dataIndex: 'operating', + // key: 'operating', + // display: 'block', + // align: 'center', + // fixed: 'right', + // width:'100px', + // className:'font-14', + // render: (text, record) => ( + // record.submitstate === "未提交" ? --: + // + // + //
直接调整最终成绩的分数
+ //
其它评分全部作废
+ // }> + // this.Viewstudenttraininginformations(record)}>调分 + //
+ // this.Viewstudenttraininginformation(record)}>{record.operating} + //
+ // ) + // }, + // ] + columns.map((item,key)=>{ + if(item.title==="关卡得分"){ + columns.splice(key,1) + } + if(item.title==="效率分"){ + columns.splice(key,1) + } + }) + } } }else { - if(JSON.stringify(this.state.course_group_info) === "[]" ? "" : this.state.course_group_info === undefined ? "" : this.state.course_group_info === null){ - columns=[ - { - title: '序号', - dataIndex: 'number', - key: 'number', - align: 'center', - width:'96px', - render: (text, record) => ( - - {record.number} - - ) - }, - { - title: '姓名', - dataIndex: 'name', - key: 'name', - align: 'center', - Width:'147px', - render: (text, record) => ( - - {record.name} - - ) - }, - { - title: '学号', - dataIndex: 'stduynumber', - key: 'stduynumber', - align: 'center', - width:'200px', - render: (text, record) => ( - - {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} - - ), - }, - { - title: '提交状态', - dataIndex: 'submitstate', - key: 'submitstate', - align: 'center', - render: (text, record) => ( - - {record.submitstate} - - ) - - }, - { - title: '更新时间', - dataIndex: 'updatetime', - key: 'updatetime', - align: 'center', - render: (text, record) => ( - - {record.updatetime} - - ), - }, - { - title: '完成情况', - dataIndex: 'completion', - key: 'completion', - align: 'center', - render: (text, record) => ( - - - -
已通过{record.completion}关,共{this.state.challenges_count}关
- }> - {record.completion+"/"+this.state.challenges_count} -
- -
- ) - }, - { - title: '关卡得分', - dataIndex: 'levelscore', - key: 'levelscore', - align: 'center', - render: (text, record) => ( - - = 90 ? {"color": '#DD1717', "text-align": "center"} : { - "color": '#747A7F', - "text-align": "center" - }}>{record.levelscore} - - ) - }, - { - title: '效率分', - dataIndex: 'efficiencyscore', - key: 'efficiencyscore', - align: 'center', - render: (text, record) => ( - - { - record.efficiencyscore&& record.efficiencyscore=== "--"?( - record.submitstate==="按时提交"? - -
作业截止时,系统根据学生在课堂成员中的效率表现自动评分
- }> - - -- - -
- : - record.submitstate==="延时提交"? - -
补交结束时,系统根据学生在课堂成员中的效率表现自动评分
- }> - - -- - -
- : - - -- - - ) - : - = 90 ? { - "color": '#DD1717', - "text-align": "center" - } : {"color": '#747A7F', "text-align": "center"}}>{record.efficiencyscore} - } - -
- - ) - }, - { - title: '最终成绩', - dataIndex: 'finalscore', - key: 'finalscore', - align: 'center', - render: (text, record) => ( - - { - record.ultimate_score=== true? - -
{record.user_name}{record.user_login}
-
{record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
- }> - { - record.finalscore&&record.finalscore==="--"? - {record.finalscore} - : - = 90 ? {"color": '#DD1717', "text-align": "center"} : { - "color": '#747A7F', - "text-align": "center" - }}>{record.finalscore} - } -
- : - -
{record.user_name}{record.user_login}
-
{record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
-
{record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
-
{record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
-
{record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
- }> - { - record.finalscore&&record.finalscore==="--"? - {record.finalscore} - : - = 90 ? {"color": '#DD1717', "text-align": "center"} : { - "color": '#747A7F', - "text-align": "center" - }}>{record.finalscore} - } -
- - } -
- ) - }, - { - title: '操作', - dataIndex: 'operating', - key: 'operating', - display: 'block', - align: 'center', - width:'93px', - render: (text, record) => ( - record.submitstate === "未提交" ? -- : - - -
直接调整最终成绩的分数
-
其它评分全部作废
- }> - this.Viewstudenttraininginformations(record)}>调分 -
- this.Viewstudenttraininginformation(record)}>{record.operating} -
- ) - }, - ] - } + if(JSON.stringify(this.state.course_group_info) === "[]"|| this.state.course_group_info === undefined || this.state.course_group_info === null){ + // columns=[ + // { + // title: '序号', + // dataIndex: 'number', + // key: 'number', + // align: 'center', + // fixed: 'left', + // width:'100px', + // className:'font-14', + // render: (text, record) => ( + // + // {record.number} + // + // ) + // }, + // { + // title: '姓名', + // dataIndex: 'name', + // key: 'name', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.name} + // + // ) + // }, + // { + // title: '学号', + // dataIndex: 'stduynumber', + // key: 'stduynumber', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} + // + // ), + // }, + // { + // title: '提交状态', + // dataIndex: 'submitstate', + // key: 'submitstate', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.submitstate} + // + // ) + // + // }, + // { + // title: '更新时间', + // dataIndex: 'updatetime', + // key: 'updatetime', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.updatetime} + // + // ), + // }, + // { + // title: '完成情况', + // dataIndex: 'completion', + // key: 'completion', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // + // + //
已通过{record.completion}关,共{this.state.challenges_count}关
+ // }> + // {record.completion+"/"+this.state.challenges_count} + //
+ // + //
+ // ) + // }, + // { + // title: '关卡得分', + // dataIndex: 'levelscore', + // key: 'levelscore', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.levelscore} + // + // ) + // }, + // { + // title: '效率分', + // dataIndex: 'efficiencyscore', + // key: 'efficiencyscore', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // { + // record.efficiencyscore&& record.efficiencyscore=== "--"?( + // record.submitstate==="按时提交"? + // + //
作业截止时,系统根据学生在课堂成员中的效率表现自动评分
+ // }> + // + // -- + // + //
+ // : + // record.submitstate==="延时提交"? + // + //
补交结束时,系统根据学生在课堂成员中的效率表现自动评分
+ // }> + // + // -- + // + //
+ // : + // + // -- + // + // ) + // : + // = 90 ? { + // "color": '#DD1717', + // "text-align": "center" + // } : {"color": '#747A7F', "text-align": "center"}}>{record.efficiencyscore} + // } + // + //
+ // + // ) + // }, + // { + // title: '最终成绩', + // dataIndex: 'finalscore', + // key: 'finalscore', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // { + // record.ultimate_score=== true? + // + //
{record.user_name}{record.user_login}
+ //
{record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
+ // }> + // { + // record.finalscore&&record.finalscore==="--"? + // {record.finalscore} + // : + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.finalscore} + // } + //
+ // : + // + //
{record.user_name}{record.user_login}
+ //
{record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
+ //
{record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
+ //
{record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
+ //
{record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
+ // }> + // { + // record.finalscore&&record.finalscore==="--"? + // {record.finalscore} + // : + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.finalscore} + // } + //
+ // + // } + //
+ // ) + // }, + // { + // title: '操作', + // dataIndex: 'operating', + // key: 'operating', + // display: 'block', + // align: 'center', + // fixed: 'right', + // width:'100px', + // className:'font-14', + // render: (text, record) => ( + // record.submitstate === "未提交" ? -- : + // + // + //
直接调整最终成绩的分数
+ //
其它评分全部作废
+ // }> + // this.Viewstudenttraininginformations(record)}>调分 + //
+ // this.Viewstudenttraininginformation(record)}>{record.operating} + //
+ // ) + // }, + // ] + columns.map((item,key)=>{ + if(item.title==="分班"){ + columns.splice(key,1) + } + }) + }else { + if(this.state.course_group_info.length < 2) { + // columns=[ + // { + // title: '序号', + // dataIndex: 'number', + // key: 'number', + // align: 'center', + // fixed: 'left', + // width:'100px', + // className:'font-14', + // render: (text, record) => ( + // + // {record.number} + // + // ) + // }, + // { + // title: '姓名', + // dataIndex: 'name', + // key: 'name', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.name} + // + // ) + // }, + // { + // title: '学号', + // dataIndex: 'stduynumber', + // key: 'stduynumber', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} + // + // ), + // }, + // { + // title: '提交状态', + // dataIndex: 'submitstate', + // key: 'submitstate', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.submitstate} + // + // ) + // + // }, + // { + // title: '更新时间', + // dataIndex: 'updatetime', + // key: 'updatetime', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // {record.updatetime} + // + // ), + // }, + // { + // title: '完成情况', + // dataIndex: 'completion', + // key: 'completion', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // + // + //
已通过{record.completion}关,共{this.state.challenges_count}关
+ // }> + // {record.completion+"/"+this.state.challenges_count} + //
+ // + //
+ // ) + // }, + // { + // title: '关卡得分', + // dataIndex: 'levelscore', + // key: 'levelscore', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.levelscore} + // + // ) + // }, + // { + // title: '效率分', + // dataIndex: 'efficiencyscore', + // key: 'efficiencyscore', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // { + // record.efficiencyscore&& record.efficiencyscore=== "--"?( + // record.submitstate==="按时提交"? + // + //
作业截止时,系统根据学生在课堂成员中的效率表现自动评分
+ // }> + // + // -- + // + //
+ // : + // record.submitstate==="延时提交"? + // + //
补交结束时,系统根据学生在课堂成员中的效率表现自动评分
+ // }> + // + // -- + // + //
+ // : + // + // -- + // + // ) + // : + // = 90 ? { + // "color": '#DD1717', + // "text-align": "center" + // } : {"color": '#747A7F', "text-align": "center"}}>{record.efficiencyscore} + // } + // + //
+ // + // ) + // }, + // { + // title: '最终成绩', + // dataIndex: 'finalscore', + // key: 'finalscore', + // align: 'center', + // className:'font-14', + // render: (text, record) => ( + // + // { + // record.ultimate_score=== true? + // + //
{record.user_name}{record.user_login}
+ //
{record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
+ // }> + // { + // record.finalscore&&record.finalscore==="--"? + // {record.finalscore} + // : + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.finalscore} + // } + //
+ // : + // + //
{record.user_name}{record.user_login}
+ //
{record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
+ //
{record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
+ //
{record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
+ //
{record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
+ // }> + // { + // record.finalscore&&record.finalscore==="--"? + // {record.finalscore} + // : + // = 90 ? {"color": '#DD1717', "text-align": "center"} : { + // "color": '#747A7F', + // "text-align": "center" + // }}>{record.finalscore} + // } + //
+ // + // } + //
+ // ) + // }, + // { + // title: '操作', + // dataIndex: 'operating', + // key: 'operating', + // display: 'block', + // align: 'center', + // fixed: 'right', + // width:'100px', + // className:'font-14', + // render: (text, record) => ( + // record.submitstate === "未提交" ? -- : + // + // + //
直接调整最终成绩的分数
+ //
其它评分全部作废
+ // }> + // this.Viewstudenttraininginformations(record)}>调分 + //
+ // this.Viewstudenttraininginformation(record)}>{record.operating} + //
+ // ) + // }, + // ] + columns.map((item,key)=>{ + if(item.title==="分班"){ + columns.splice(key,1) + } + }) + } + columns=this.state.columnss; + } } } else { @@ -1683,7 +2440,7 @@ class Listofworks extends Component { 作业详情

-
+

{teacherdata === undefined ? "" : teacherdata.homework_name}

@@ -1699,7 +2456,7 @@ class Listofworks extends Component {
-
+
this.notlimitedst()}>不限 - this.funtaskstatustwo(e, course_group_info && course_group_info)} - style={{paddingTop: '4px'}}> + style={{paddingTop: '4px',width:'1017px'}}> {course_group_info === undefined ? "" : course_group_info.map((item, key) => { return ( From 73c80c5d3b218022fe2c82d000fb0a68dddfe731 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, 29 Jun 2019 00:38:07 +0800 Subject: [PATCH 11/39] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/Listofworks.js | 16 +++++++-------- .../Shixunworkdetails/ShixunWorkModal.js | 20 ++++++++++++++----- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 8fc4404fa..46eb61859 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -337,11 +337,11 @@ class Listofworks extends Component {
直接调整最终成绩的分数
其它评分全部作废
}> - this.Viewstudenttraininginformations(record)}>调分 + this.Viewstudenttraininginformations(record)}>调分 - this.Viewstudenttraininginformation(record)}>{record.operating} + this.Viewstudenttraininginformation(record)}>{record.operating} ) }, @@ -589,11 +589,11 @@ class Listofworks extends Component {
直接调整最终成绩的分数
其它评分全部作废
}> - this.Viewstudenttraininginformations(record)}>调分 + this.Viewstudenttraininginformations(record)}>调分 - this.Viewstudenttraininginformation(record)}>{record.operating} + this.Viewstudenttraininginformation(record)}>{record.operating} ) }, diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index eaf1c433e..0885c155e 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -14,23 +14,32 @@ class ShixunWorkModal extends Component{ } } componentDidMount() { - + let {group_list}=this.state; let url="/homework_commons/"+this.props.match.params.homeworkid+"/group_list.json"; - axios.get(url,{params:{ limit:10, page:1, } }).then((response) => { + console.log(response); if(response.data.group_list===undefined){ this.setState({ course_groups:response.data, group_list:undefined }) }else{ + let newgroup_list=group_list; + response.data.group_list.map((item,key)=>{ + newgroup_list.push(item) + console.log(item); + }) + response.data.ungroup_list.map((items,keys)=>{ + newgroup_list.push(item) + console.log(item); + }) this.setState({ course_groups:response.data, - group_list:response.data.group_list + group_list:newgroup_list, }) } @@ -44,6 +53,7 @@ class ShixunWorkModal extends Component{ //勾选实训 shixunhomeworkedit=(checkedValues)=>{ let{group_list}=this.state; + if(checkedValues.length===group_list.length){ this.setState({ onChangetype:true, @@ -71,10 +81,10 @@ class ShixunWorkModal extends Component{ page:newpage, } }).then((response) => { - response.data. course_groups.group_list&&response.data.group_list.map((item,key)=>{ + response.data.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)=>{ + response.data.ungroup_list&&response.data.ungroup_list.map((items,keys)=>{ newgroup_list.push(items) }) this.setState({ From 71f052328b5d1365941efee8e7e38b6d38411a32 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, 29 Jun 2019 00:38:43 +0800 Subject: [PATCH 12/39] =?UTF-8?q?=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.dev.js | 30 +- public/react/src/App.js | 2 +- .../courses/busyWork/CommonWorkDetailIndex.js | 4 +- .../busyWork/common/TabRightComponents.js | 304 +++++++-------- .../exercise/Exercisestatisticalresult.js | 17 +- .../Exercisestatisticalresulttabel.js | 365 +++++++++--------- .../courses/exercise/Exercisetablesmubu.js | 20 +- .../exercise/Testpapersettinghomepage.js | 6 +- .../tasks/GraduationTasksSubmitnew.js | 2 +- .../graduation/tasks/GraduationTasksedit.js | 12 +- .../graduation/tasks/GraduationTasksnew.js | 14 +- .../tasks/GraduationTaskssetting.js | 7 +- .../tasks/GraduationTaskssettinglist.js | 32 +- .../tasks/GraduationTaskssettingquestions.js | 7 +- .../courses/shixunHomework/Listofworks.js | 36 +- 15 files changed, 451 insertions(+), 407 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index dfd54f38b..ceddbd81b 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -114,21 +114,21 @@ module.exports = { // First, run the linter. // It's important to do this before Babel processes the JS. // 上线然后要注释回来 - { - test: /\.(js|jsx|mjs)$/, - enforce: 'pre', - use: [ - { - options: { - formatter: eslintFormatter, - eslintPath: require.resolve('eslint'), - - }, - loader: require.resolve('eslint-loader'), - }, - ], - include: paths.appSrc, - }, + // { + // test: /\.(js|jsx|mjs)$/, + // enforce: 'pre', + // use: [ + // { + // options: { + // formatter: eslintFormatter, + // eslintPath: require.resolve('eslint'), + // + // }, + // loader: require.resolve('eslint-loader'), + // }, + // ], + // include: paths.appSrc, + // }, { // "oneOf" will traverse all following loaders until one will // match the requirements. When no loader matches it will fall diff --git a/public/react/src/App.js b/public/react/src/App.js index d4c70e6aa..1a1af02d9 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -263,7 +263,7 @@ class App extends Component { {/**/} {/*认证*/} - {/**/} + {/*403*/} diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index b16fd6d32..ac8f91b74 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -226,8 +226,8 @@ class CommonWorkDetailIndex extends Component{ {this.props.isAdmin()?
  • 导出
  • :""} diff --git a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js index 92ff54178..ff1e2dcdd 100644 --- a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js +++ b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js @@ -1,153 +1,153 @@ -import React,{Component} from "React"; -import { Form, Select, Input, Button,Checkbox,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd"; -import {Link} from 'react-router-dom'; -import { WordsBtn, MarkdownToHtml } from 'educoder'; -import axios from 'axios'; -import PublishRightnow from '../PublishRightnow' -import AccessoryModal from "../../coursesPublic/AccessoryModal"; - -const { Option} = Select; -const CheckboxGroup = Checkbox.Group; -const confirm = Modal.confirm; -let GraduationTasksnewtype=true; -const $ = window.$; -const Search = Input.Search; -const RadioGroup = Radio.Group; - -class TabRightComponents extends Component{ - - constructor(props){ - super(props) - - this.publishModal = React.createRef(); - this.endModal = React.createRef(); - - this.state={ - accessoryVisible: false - } - } - - componentDidMount() { - } - - onToPublishClick = () => { - - } - // 补交附件 - Cancelvisible=()=>{ - this.setState({ - accessoryVisible:false - }) - } - - addAccessory=()=>{ - this.setState({ - accessoryVisible:true - }) - } - setupdate = () => { - - } - render(){ - const dateFormat = 'YYYY-MM-DD HH:mm'; - const { accessoryVisible } = this.state - let { work_statuses, publish_immediately, work_id - , end_immediately - } =this.props; - - let courseId=this.props.match.params.coursesId; - let category_id=this.props.match.params.category_id; - let workId=this.props.match.params.workId; - - const isGroup = this.props.isGroup() - const moduleName = !isGroup? "普通作业":"分组作业"; - const moduleEngName = this.props.getModuleName() - - const childModuleName = this.props.moduleName - - const isAdmin = this.props.isAdmin() - const isSuperAdmin = this.props.isSuperAdmin() - - let exportUrl = `/api/homework_commons/${workId}/works_list.zip` - const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx` - - return( - - {isAdmin ? - -
    - - -
    - - - {this.props.isAdmin()?
  • - 导出 - -
  • :""} - - {/* 导出作品附件 - 导出成绩 */} - {/*导出*/} - {end_immediately && { this.endModal.current.open() } }>立即截止} - {publish_immediately && { this.publishModal.current.open() } } >立即发布} - - {/*项目在线质量检测*/} - {isAdmin && this.props.toEditPage(this.props.match.params, workId)}>编辑作业} -
    : - - {work_statuses && work_statuses.indexOf('提交作品') != -1 && { this.props.toWorkPostPage(this.props.match.params)}} - >提交作品} - {work_statuses && work_statuses.indexOf('修改作品') != -1 && { this.props.toWorkPostPage(this.props.match.params, null, true, work_id)}} - >修改作品} - {work_statuses && work_statuses.indexOf('补交附件') != -1 && - - - 补交附件 - - } - } -
    - - ) - } -} - +import React,{Component} from "React"; +import { Form, Select, Input, Button,Checkbox,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd"; +import {Link} from 'react-router-dom'; +import { WordsBtn, MarkdownToHtml } from 'educoder'; +import axios from 'axios'; +import PublishRightnow from '../PublishRightnow' +import AccessoryModal from "../../coursesPublic/AccessoryModal"; + +const { Option} = Select; +const CheckboxGroup = Checkbox.Group; +const confirm = Modal.confirm; +let GraduationTasksnewtype=true; +const $ = window.$; +const Search = Input.Search; +const RadioGroup = Radio.Group; + +class TabRightComponents extends Component{ + + constructor(props){ + super(props) + + this.publishModal = React.createRef(); + this.endModal = React.createRef(); + + this.state={ + accessoryVisible: false + } + } + + componentDidMount() { + } + + onToPublishClick = () => { + + } + // 补交附件 + Cancelvisible=()=>{ + this.setState({ + accessoryVisible:false + }) + } + + addAccessory=()=>{ + this.setState({ + accessoryVisible:true + }) + } + setupdate = () => { + + } + render(){ + const dateFormat = 'YYYY-MM-DD HH:mm'; + const { accessoryVisible } = this.state + let { work_statuses, publish_immediately, work_id + , end_immediately + } =this.props; + + let courseId=this.props.match.params.coursesId; + let category_id=this.props.match.params.category_id; + let workId=this.props.match.params.workId; + + const isGroup = this.props.isGroup() + const moduleName = !isGroup? "普通作业":"分组作业"; + const moduleEngName = this.props.getModuleName() + + const childModuleName = this.props.moduleName + + const isAdmin = this.props.isAdmin() + const isSuperAdmin = this.props.isSuperAdmin() + + let exportUrl = `/api/homework_commons/${workId}/works_list.zip` + const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx` + + return( + + {isAdmin ? + +
    + + +
    + + + {this.props.isAdmin()?
  • + 导出 + +
  • :""} + + {/* 导出作品附件 + 导出成绩 */} + {/*导出*/} + {end_immediately && { this.endModal.current.open() } }>立即截止} + {publish_immediately && { this.publishModal.current.open() } } >立即发布} + + {/*项目在线质量检测*/} + {isAdmin && this.props.toEditPage(this.props.match.params, workId)}>编辑作业} +
    : + + {work_statuses && work_statuses.indexOf('提交作品') != -1 && { this.props.toWorkPostPage(this.props.match.params)}} + >提交作品} + {work_statuses && work_statuses.indexOf('修改作品') != -1 && { this.props.toWorkPostPage(this.props.match.params, null, true, work_id)}} + >修改作品} + {work_statuses && work_statuses.indexOf('补交附件') != -1 && + + + 补交附件 + + } + } +
    + + ) + } +} + export default TabRightComponents; \ No newline at end of file diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index 1e34838d9..1a966a6e7 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js @@ -1,5 +1,5 @@ import React, {Component} from "react"; -import {WordsBtn} from 'educoder'; +import {WordsBtn,markdownToHTML} from 'educoder'; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Pagination} from "antd"; import {Link,Switch,Route,Redirect} from 'react-router-dom'; import axios from 'axios'; @@ -104,7 +104,7 @@ class Exercisestatisticalresult extends Component {
    - {data&&data.course_groups.length===0?"":
    + {data&&data.course_groups.length===0?"":
    • @@ -180,13 +180,16 @@ class Exercisestatisticalresult extends Component { {data&&data.commit_results.map((item,key)=>{ return( -
      +
      - {item.ques_type===0?"单选":item.ques_type===1?"多选":item.ques_type===2?"判断":item.ques_type===3?"填空":item.ques_type===4?"主观":item.ques_type===5?"实训":""}题 - Q{item.ques_position}: - - + {item.ques_position+"."}{item.ques_type===0?"单选":item.ques_type===1?"多选":item.ques_type===2?"判断":item.ques_type===3?"填空":item.ques_type===4?"主观":item.ques_type===5?"实训":""}题 +
      + {/*Q{item.ques_position}:*/} +
      + + {/**/} +
      正确率 {item.right_percent}%
      diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js index b9122abdc..2a04e1978 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js @@ -1,181 +1,186 @@ -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=[]; - // data&&data.exercise_counts.forEach((item,key)=>{ }) - - datas.push({ - commit_percent:data&&data.exercise_counts.commit_percent, - min_score:data&&data.exercise_counts.min_score, - max_score:data&&data.exercise_counts.max_score, - average_score:data&&data.exercise_counts.average_score, - fail_counts:data&&data.exercise_counts.fail_counts, - pass_counts:data&&data.exercise_counts.pass_counts, - good_counts:data&&data.exercise_counts.good_counts, - best_counts:data&&data.exercise_counts.best_counts, - }) - - - - let columns=[{ - title: '提交率', - dataIndex: 'commit_percent', - key: 'commit_percent', - render: (text, record) => ( - - {record.commit_percent===0?0:(record.commit_percent*100).toFixed(2)}% - - ), - }, { - title: '最低分', - dataIndex: 'min_score', - key: 'min_score', - render: (text, record) => ( - - {record.min_score} - - ), - }, { - title: '最高分', - dataIndex: 'max_score', - key: 'max_score', - render: (text, record) => ( - - {record.max_score} - - ), - }, { - title: '平均分', - key: 'average_score', - dataIndex: 'average_score', - - render: (text, record) => ( - - {record.average_score} - - ), - }, { - title: '不及格(0-60)', - key: 'fail_counts', - dataIndex: 'fail_counts', - render: (text, record) => ( - - {record.fail_counts} - - ), - }, { - title: '及格(60-70)', - key: 'pass_counts', - dataIndex: 'pass_counts', - - render: (text, record) => ( - - {record.pass_counts} - - ), - }, { - title: '良好(70-90)', - key: 'good_counts', - dataIndex: 'good_counts', - - render: (text, record) => ( - - {record.good_counts} - - ), - }, { - title: '优秀(90-100)', - key: 'best_counts', - dataIndex: 'best_counts', - - render: (text, record) => ( - - {record.best_counts} - - ), - }]; - // { - // 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() { + + } + + render() { + + let {data}=this.props; + let datas=[]; + // data&&data.exercise_counts.forEach((item,key)=>{ }) + + datas.push({ + commit_percent:data&&data.exercise_counts.commit_percent, + min_score:data&&data.exercise_counts.min_score, + max_score:data&&data.exercise_counts.max_score, + average_score:data&&data.exercise_counts.average_score, + fail_counts:data&&data.exercise_counts.fail_counts, + pass_counts:data&&data.exercise_counts.pass_counts, + good_counts:data&&data.exercise_counts.good_counts, + best_counts:data&&data.exercise_counts.best_counts, + }) + + + + let columns=[{ + title: '提交率', + dataIndex: 'commit_percent', + key: 'commit_percent', + render: (text, record) => ( + + {record.commit_percent===0?0:(record.commit_percent*100).toFixed(2)}% + + ), + }, { + title: '最低分', + dataIndex: 'min_score', + key: 'min_score', + render: (text, record) => ( + + {record.min_score} + + ), + }, { + title: '最高分', + dataIndex: 'max_score', + key: 'max_score', + render: (text, record) => ( + + {record.max_score} + + ), + }, { + title: '平均分', + key: 'average_score', + dataIndex: 'average_score', + + render: (text, record) => ( + + {record.average_score} + + ), + }, { + title: '不及格(0-60)', + key: 'fail_counts', + dataIndex: 'fail_counts', + render: (text, record) => ( + + {record.fail_counts} + + ), + }, { + title: '及格(60-70)', + key: 'pass_counts', + dataIndex: 'pass_counts', + + render: (text, record) => ( + + {record.pass_counts} + + ), + }, { + title: '良好(70-90)', + key: 'good_counts', + dataIndex: 'good_counts', + + render: (text, record) => ( + + {record.good_counts} + + ), + }, { + title: '优秀(90-100)', + key: 'best_counts', + dataIndex: 'best_counts', + + render: (text, record) => ( + + {record.best_counts} + + ), + }]; + // { + // 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 diff --git a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js index d3c73baba..b2cd1a1a3 100644 --- a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js +++ b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js @@ -66,12 +66,16 @@ class Exercisetablesmubus extends Component { width:'300px', render: (text, record) => ( - {record.max_score===undefined?"":} + {record.max_score===undefined?"": +
      {record.max_score*100}%
      }
      ), }]; @@ -125,10 +129,14 @@ class Exercisetablesmubus extends Component { } .ant-table-tbody > tr > td:nth-child(1){ text-align: left; + } + .Exermubu .ant-table-tbody > tr:nth-last-child(1) > td{ + border:1px solid transparent; } `} {datas===undefined?"":
    • this.experiment(`/api/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)} - calssName="color-dark">学生成绩
    • -
    • 空白试卷
    • -
    • 学生成绩
    • +
    • 空白试卷
    • +
    • this.experiment(`/api/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval}`)} >学生答题试卷
    • diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index 74bf9d868..a49d38212 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -215,7 +215,7 @@ class GraduationTasksSubmitnew extends Component{ let {search} = this.state; - this.searchList(search,1,10) + this.searchList(search,1,20) } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js index 64539adbc..3c9202921 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js @@ -240,12 +240,12 @@ class GraduationTasksedit extends Component{ handleSubmit=(e)=>{ let {fileList}=this.state; - if(fileList.length===0){ - this.setState({ - shixunsreplace:true, - }) - return - } + // if(fileList.length===0){ + // this.setState({ + // shixunsreplace:true, + // }) + // return + // } this.Commoninterface(fileList); } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js index 74ba21b62..e6185188a 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js @@ -214,13 +214,13 @@ class GraduationTasksnew extends Component { // 提交按钮 handleSubmit = (e) => { let {fileList} = this.state; - if(fileList.length===0){ - this.setState({ - shixunsreplace:true, - }) - - return - } + // if(fileList.length===0){ + // this.setState({ + // shixunsreplace:true, + // }) + // + // return + // } this.Commoninterface(fileList); diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index c2ec26282..b5c34e975 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -1056,13 +1056,16 @@ class GraduationTaskssettingapp extends Component{ padding-top: 10px; padding-bottom: 8px; } + .drop_down_menu li .color-dark{ + color: #666 !important; + } `} {this.props.isAdmin()?
    • 导出
    • :""} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 735279a38..1433319b3 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -701,7 +701,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - {record.turnovertime===""?"--":moment(record.turnovertime).format('YYYY-MM-DD HH:mm:ss')} + {record.turnovertime===""?"--":moment(record.turnovertime).format('YYYY-MM-DD HH:mm')} ), @@ -741,11 +741,11 @@ class GraduationTaskssettinglist extends Component{ className:'edu-txt-center', render: (text, record) => ( - + {record.finalscore.final_score.username}({record.finalscore.final_score.login})
      {record.finalscore.ultimate_score===true?"":"教师评分:"+record.finalscore.teacher_comment_score+"分"}
      - {record.finalscore.cross_comment_score===undefined?"":"交叉评分:"+record.finalscore.cross_comment_score+"分"+
      } - {record.finalscore.late_penalty===undefined?"":"迟交扣分:"+record.finalscore.late_penalty+"分"+
      } + {record.finalscore.cross_comment_score===undefined||record.finalscore.cross_comment_score==="未批阅"?"交叉评分:--":"交叉评分:"+record.finalscore.cross_comment_score+"分"}
      + {record.finalscore.late_penalty===undefined?"":"迟交扣分:"+record.finalscore.late_penalty+"分"}
      最终成绩:{record.finalscore.work_score}分
      }> 90?'#DD1717':parseInt(record.finalscore.work_score)>60&&parseInt(record.finalscore.work_score)<90?"#FF6800":'#747A7F'}}>{record.finalscore.work_score==="--"?"--":record.finalscore.work_score} @@ -1010,13 +1010,16 @@ class GraduationTaskssettinglist extends Component{ padding-top: 10px; padding-bottom: 8px; } + .drop_down_menu li .color-dark{ + color: #666 !important; + } `} {this.props.isAdmin()?
    • 导出
    • :""} @@ -1141,17 +1144,28 @@ class GraduationTaskssettinglist extends Component{
      - +
      {this.props.isAdmin()===true? {taskslistdata&&taskslistdata.work_count} 个检索结果({taskslistdata&&taskslistdata.work_count} 学生) :""} {this.props.isAdmin()===true?

      - + {order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序

      -
        +
        • this.funorder("updated_at")}>更新时间
        • this.funorder("work_score" )}>最终成绩 diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js index f1a06808c..68934e521 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js @@ -303,13 +303,16 @@ class GraduationTasksquestions extends Component{ padding-top: 10px; padding-bottom: 8px; } + .drop_down_menu li .color-dark{ + color: #666 !important; + } `} {this.props.isAdmin()?
        • 导出
        • :""} diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 04a878dc0..687351934 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -60,6 +60,7 @@ class Listofworks extends Component { this.state = { props: props, data: [], + b_order: "desc", page: 1, limit: 20, loadingstate: true, @@ -385,8 +386,8 @@ class Listofworks extends Component { // course_group:分班情况 [232, 231], []:不限(空数组) var data = { search: "", - order: "desc", - b_order: "asc", + order: "update_time", + b_order: "desc", work_status: "", course_group: "", page:1, @@ -427,19 +428,26 @@ class Listofworks extends Component { //order 排序时间 //debug=t 是老师的意思 // console.log(ordervlue)7009 + let{b_order,order}=this.state; var homeworkid = this.props.match.params.homeworkid; let urll = `/homework_commons/${homeworkid}/works_list.json?`; - var order = "asc"; - if (ordervlue === "updated_at") { - order = "desc"; + var b_orders + // = "asc"; + // if (ordervlue === "updated_at") { + // b_orders = "desc"; + // } + if(b_order==="asc"){ + b_orders = "desc"; + }else{ + b_orders = "asc"; } var checkedValuesines = checkedValuesine; var checkedValuesineinfos = checkedValuesineinfo; var searchtexts = searchtext var data = { search: searchtexts, - order: ordervlue, - b_order: order, + order: order, + b_order: b_orders, work_status: checkedValuesines, course_group: checkedValuesineinfos, page: page, @@ -1274,14 +1282,14 @@ class Listofworks extends Component { } //排序 funorder = (e) => { - if (e === "updated_at") { + if (e === "update_time") { // 时间 // 时间排序是从小到大 this.setState({ - order: "updated_at", + order: "update_time", loadingstate: true, }) - this.Startsorting("updated_at", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); + this.Startsorting("update_time", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); } if (e === "work_score") { @@ -1738,8 +1746,8 @@ class Listofworks extends Component { {this.props.isAdmin()?
        • 导出
        • :""} {this.props.isAdmin() ? @@ -1840,10 +1848,10 @@ class Listofworks extends Component {
      ) From c4fd0316d4e94ac8f1c6b71c0783c7cac7a0b688 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, 29 Jun 2019 09:13:11 +0800 Subject: [PATCH 15/39] Merge remote-tracking branch 'origin/master' # Conflicts: # public/react/src/modules/courses/shixunHomework/Listofworks.js --- .../coursesPublic/modal/CheckCodeModal.js | 471 +++++++++--------- 1 file changed, 236 insertions(+), 235 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js b/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js index cfc6d1245..e2aa2ab00 100644 --- a/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js +++ b/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js @@ -1,235 +1,236 @@ -import React, { Component } from "react"; -import { Modal, Checkbox, Input, Spin, Select, Divider } from "antd"; -import axios from 'axios' -import ModalWrapper from "../../common/ModalWrapper" -import InfiniteScroll from 'react-infinite-scroller'; -import { ConditionToolTip } from 'educoder' -const Option = Select.Option; -const pageCount = 15; - -// 代码查重弹框 -class CheckCodeModal extends Component{ - constructor(props){ - super(props); - this.state={ - checkBoxValues: [], - candidates: [], - hasMore: true, - loading: false, - page: 1 - } - } - fetchMemberList = (arg_page) => { - const courseId = this.props.match.params.coursesId - const page = arg_page || this.state.page; - const { name, school_name } = this.state - let url = `/courses/${courseId}/search_teacher_candidate.json` - this.setState({ loading: true }) - axios.post(url, { - page: page, - limit: pageCount, - school_name: school_name || '', - name: name || '' - }) - .then((response) => { - if (!response.data.candidates || response.data.candidates.length == 0) { - this.setState({ - page, - loading: false, - hasMore: false, - }) - } else { - this.setState({ - candidates: page == 1 ? response.data.candidates : this.state.candidates.concat(response.data.candidates), - page, - loading: false, - hasMore: response.data.candidates.length == pageCount - }) - } - - }) - .catch(function (error) { - console.log(error); - }); - } - componentDidMount() { - - - } - fetchOptions = () => { - // add_teacher_popup - const courseId = this.props.match.params.coursesId - - let url = `/courses/${courseId}/add_teacher_popup.json` - - axios.get(url, { - }) - .then((response) => { - if (response.data.graduation_groups) { - this.setState({ - graduation_groups: response.data.graduation_groups - }) - } - if (response.data.course_groups) { - this.setState({ - course_groups: response.data.course_groups - }) - } - - }) - .catch(function (error) { - console.log(error); - }); - } - setVisible = (visible) => { - if (visible) { - this.fetchMemberList() - this.fetchOptions() - } - this.refs.modalWrapper.setVisible(visible) - if (visible == false) { - this.setState({ - checkBoxValues: [] - }) - } - } - - onSendOk = () => { - const courseId = this.props.match.params.coursesId - const url = `/courses/${courseId}/add_teacher.json` - const params = { - "user_list": this.state.checkBoxValues.map (item => { return { 'user_id': item }}) , - "graduation_group_id": "2", - "course_group_id": "820", - // "role": ROLE_TEACHER_NUM - } - const { graduationGroup, courseGroup } = this.state - if (graduationGroup) { - params.graduation_group_id = graduationGroup - } - if (courseGroup) { - params.course_group_id = courseGroup - } - axios.post(url, params) - .then((response) => { - if (response.data.status == 0) { - this.setVisible(false) - this.props.showNotification('添加成功') - } - }) - .catch(function (error) { - console.log(error); - }); - } - - onOk = () => { - this.onSendOk() - } - - onCheckBoxChange = (checkBoxValues) => { - this.setState({ - checkBoxValues: checkBoxValues - }) - } - - handleInfiniteOnLoad = () => { - this.fetchMemberList(this.state.page + 1) - } - - onSearch = () => { - this.fetchMemberList(1) - } - handleGradationGroupChange = (value) => { - this.setState({ - graduationGroup: value - }) - } - handleCourseGroupChange = (value) => { - this.setState({ - courseGroup: value - }) - } - render(){ - const { candidates, checkBoxValues, loading, hasMore, name, school_name - , graduationGroup, graduation_groups, courseGroup, course_groups } = this.state - const { moduleName } = this.props - return( - - - -

      - - - - - -

      -
      - {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */} -
      - - - { candidates && candidates.map( candidate => { - return ( -

      - - - 12 }> - - - - - 12 }> - - - - - -

      - ) - }) } -
      - -
      -
      -
      - ) - } -} -export default CheckCodeModal; +import React, { Component } from "react"; +import { Modal, Checkbox, Input, Spin, Select, Divider } from "antd"; +import axios from 'axios' +import ModalWrapper from "../../common/ModalWrapper" +import InfiniteScroll from 'react-infinite-scroller'; +import { ConditionToolTip } from 'educoder' +const Option = Select.Option; +const pageCount = 15; + +// 代码查重弹框 +class CheckCodeModal extends Component{ + constructor(props){ + super(props); + this.state={ + checkBoxValues: [], + candidates: [], + hasMore: true, + loading: false, + page: 1 + } + } + fetchMemberList = (arg_page) => { + const courseId = this.props.match.params.coursesId + const page = arg_page || this.state.page; + const { name, school_name } = this.state + let url = `/courses/${courseId}/search_teacher_candidate.json` + this.setState({ loading: true }) + axios.post(url, { + page: page, + limit: pageCount, + school_name: school_name || '', + name: name || '' + }) + .then((response) => { + if (!response.data.candidates || response.data.candidates.length == 0) { + this.setState({ + page, + loading: false, + hasMore: false, + }) + } else { + this.setState({ + candidates: page == 1 ? response.data.candidates : this.state.candidates.concat(response.data.candidates), + page, + loading: false, + hasMore: response.data.candidates.length == pageCount + }) + } + + }) + .catch(function (error) { + console.log(error); + }); + } + componentDidMount() { + + + } + fetchOptions = () => { + // add_teacher_popup + const courseId = this.props.match.params.coursesId + + let url = `/courses/${courseId}/add_teacher_popup.json` + + axios.get(url, { + }) + .then((response) => { + if (response.data.graduation_groups) { + this.setState({ + graduation_groups: response.data.graduation_groups + }) + } + if (response.data.course_groups) { + this.setState({ + course_groups: response.data.course_groups + }) + } + + }) + .catch(function (error) { + console.log(error); + }); + } + setVisible = (visible) => { + if (visible) { + this.fetchMemberList() + this.fetchOptions() + } + this.refs.modalWrapper.setVisible(visible) + if (visible == false) { + this.setState({ + checkBoxValues: [] + }) + } + } + + onSendOk = () => { + const courseId = this.props.match.params.coursesId + const url = `/courses/${courseId}/add_teacher.json` + const params = { + "user_list": this.state.checkBoxValues.map (item => { return { 'user_id': item }}) , + "graduation_group_id": "2", + "course_group_id": "820", + // "role": ROLE_TEACHER_NUM + } + const { graduationGroup, courseGroup } = this.state + if (graduationGroup) { + params.graduation_group_id = graduationGroup + } + if (courseGroup) { + params.course_group_id = courseGroup + } + axios.post(url, params) + .then((response) => { + if (response.data.status == 0) { + this.setVisible(false) + this.props.showNotification('添加成功') + } + }) + .catch(function (error) { + console.log(error); + }); + } + + onOk = () => { + this.onSendOk() + } + + onCheckBoxChange = (checkBoxValues) => { + this.setState({ + checkBoxValues: checkBoxValues + }) + } + + handleInfiniteOnLoad = () => { + this.fetchMemberList(this.state.page + 1) + } + + onSearch = () => { + this.fetchMemberList(1) + } + handleGradationGroupChange = (value) => { + this.setState({ + graduationGroup: value + }) + } + handleCourseGroupChange = (value) => { + this.setState({ + courseGroup: value + }) + } + render(){ + const { candidates, checkBoxValues, loading, hasMore, name, school_name + , graduationGroup, graduation_groups, courseGroup, course_groups } = this.state + const { moduleName } = this.props + return( + + + +

      + + + + + +

      +
      + {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */} +
      + + + { candidates && candidates.map( candidate => { + console.log(candidates) + return ( +

      + + + 12 }> + + + + + 12 }> + + + + + +

      + ) + }) } +
      + +
      +
      +
      + ) + } +} +export default CheckCodeModal; From 3947693473479b4b7918be3fbcf148edb8cd2969 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, 29 Jun 2019 09:20:58 +0800 Subject: [PATCH 16/39] Merge remote-tracking branch 'origin/master' # Conflicts: # public/react/src/modules/courses/shixunHomework/Listofworks.js --- .../src/modules/courses/coursesPublic/modal/CheckCodeModal.js | 1 - 1 file changed, 1 deletion(-) diff --git a/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js b/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js index e2aa2ab00..d38c0a515 100644 --- a/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js +++ b/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js @@ -206,7 +206,6 @@ class CheckCodeModal extends Component{ { candidates && candidates.map( candidate => { - console.log(candidates) return (

      From b2c9c8f5f734b61605883e97abbe36aa1043cc3e 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, 29 Jun 2019 09:21:51 +0800 Subject: [PATCH 17/39] Merge remote-tracking branch 'origin/master' # Conflicts: # public/react/src/modules/courses/shixunHomework/Listofworks.js --- .../shixunHomework/Shixunworkdetails/ShixunWorkModal.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index a1dd68ad0..55f44d971 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -154,10 +154,10 @@ class ShixunWorkModal extends Component{ this.props.showNotification(`请先选择分班`); return } - if(group_ids&&group_ids.length < 2){ - this.props.showNotification(`有效作品数少于2个,无法查重`); - 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, { From 19a1a13dfd098264815efc5f9fdb676e754a6fc5 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, 29 Jun 2019 09:22:25 +0800 Subject: [PATCH 18/39] =?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/Listofworks.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 581906575..2fcc21cca 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -1933,14 +1933,14 @@ class Listofworks extends Component { loadingstate: true, }) - this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); + this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, null, this.state.limit); } else if (checkedValues.length === data.length) { this.setState({ unlimited: 0, course_groupyslstwo: [], loadingstate: true, }) - this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); + this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, null, this.state.limit); } else { // console.log(checkedValues); this.setState({ @@ -1948,7 +1948,7 @@ class Listofworks extends Component { unlimited: 1, loadingstate: true }) - this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); + this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, null, this.state.limit); } @@ -1965,9 +1965,9 @@ class Listofworks extends Component { course_groupysls: undefined, checkedValuesineinfo:[], loadingstate: true, - + page: 1, }) - this.Startsorting(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, this.state.page, this.state.limit); + this.Startsorting(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit); } else if (checkedValues.length === data.length) { this.setState({ unlimitedtwo: 1, @@ -1975,7 +1975,7 @@ class Listofworks extends Component { checkedValuesineinfo:[], loadingstate: true, }) - this.Startsorting(this.state.order, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, this.state.page, this.state.limit); + this.Startsorting(this.state.order, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit); } else { this.setState({ checkedValuesineinfo: checkedValues, @@ -1983,7 +1983,7 @@ class Listofworks extends Component { unlimitedtwo: 0, loadingstate: true, }) - this.Startsorting(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, this.state.page, this.state.limit); + this.Startsorting(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit); } From 67e49b2c2df81105fec077dcfe28c6f6e0e82b06 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 09:31:16 +0800 Subject: [PATCH 19/39] page 1 --- public/react/src/modules/courses/busyWork/CommonWorkList.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 251e39fcb..8484100f4 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -450,17 +450,17 @@ class CommonWorkList extends Component{ } teacherCommentOptionChange = (values, isAllChecked) => { - this.setState({arg_teacher_comment: isAllChecked ? [] : values}, () => { + this.setState({arg_teacher_comment: isAllChecked ? [] : values, page: 1}, () => { this.fetchList() }) } statusOptionChange = (values, isAllChecked) => { - this.setState({arg_work_status: isAllChecked ? [] : values}, () => { + this.setState({arg_work_status: isAllChecked ? [] : values, page: 1}, () => { this.fetchList() }) } courseGroupOptionChange = (values, isAllChecked) => { - this.setState({arg_course_group: isAllChecked ? [] : values}, () => { + this.setState({arg_course_group: isAllChecked ? [] : values, page: 1}, () => { this.fetchList() }) } From cc1bc813330bce8a65a0eb8099af272414c40709 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 09:35:55 +0800 Subject: [PATCH 20/39] 980px --- public/react/src/modules/courses/busyWork/CommonWorkList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 8484100f4..4d5676c5a 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -648,7 +648,7 @@ class CommonWorkList extends Component{ - {options_course_group.length > 1 && } + {options_course_group.length > 1 && } {/* value={search} */} From e5e2e2d4261b6720190a333de62d45a8d6b2a05b 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, 29 Jun 2019 09:37:24 +0800 Subject: [PATCH 21/39] Merge remote-tracking branch 'origin/master' # Conflicts: # public/react/src/modules/courses/shixunHomework/Listofworks.js --- .../Shixunworkdetails/ShixunWorkModal.js | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index 55f44d971..572bc5715 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -21,7 +21,6 @@ class ShixunWorkModal extends Component{ page:1, } }).then((response) => { - console.log(response); if(response.data.group_list===undefined){ this.setState({ course_groups:response.data, @@ -50,19 +49,35 @@ class ShixunWorkModal extends Component{ //勾选实训 shixunhomeworkedit=(checkedValues)=>{ + let types=false let{group_list}=this.state; + group_list.map((item,key)=>{ + checkedValues.map((list,li)=>{ + if(item.id===list){ + if(item.works_count<2){ + this.props.showNotification(`有效作品数少于2个,无法查重`) + types=true + return + } + } + }) + + }) + + if(types===false){ + if(checkedValues.length===group_list.length){ + this.setState({ + onChangetype:true, + group_ids:checkedValues + }) + }else{ + this.setState({ + group_ids:checkedValues, + onChangetype:false + }) + } + } - if(checkedValues.length===group_list.length){ - this.setState({ - onChangetype:true, - group_ids:checkedValues - }) - }else{ - this.setState({ - group_ids:checkedValues, - onChangetype:false - }) - } } contentViewScroll=(e)=>{ From df193a6c5e230a89859356f0c482d61c06fdc5e0 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 09:43:52 +0800 Subject: [PATCH 22/39] normal --- .../src/modules/courses/busyWork/CommonWorkList.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 4d5676c5a..46d06e300 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -31,7 +31,7 @@ function renderScore(score, content) { } else if (score >= 60) { color = '#FF6800' } - return + return {score == null || score == undefined || score == '--' ? '--': (content || score)} } @@ -105,7 +105,7 @@ function buildColumns(that, student_works) { {record.student_id} ), @@ -121,7 +121,7 @@ function buildColumns(that, student_works) { render: (text, record) => ( - {record.group_name} + {record.group_name} ), } ) @@ -177,7 +177,7 @@ function buildColumns(that, student_works) { } return ( - + {status === 0 ? "未提交" : status === 1 ? "按时提交" : status === 2 ? "延时提交" : ""} @@ -190,7 +190,7 @@ function buildColumns(that, student_works) { render: (update_time, record) => ( - {update_time ? moment(update_time).format('YYYY-MM-DD HH:mm') : '--'} + {update_time ? moment(update_time).format('YYYY-MM-DD HH:mm') : '--'} ), }]) From f8817e12538fff0868080d0a285c0b60451ed5c4 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, 29 Jun 2019 09:47:41 +0800 Subject: [PATCH 23/39] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Studentshavecompletedthelist.js | 2 +- .../courses/shixunHomework/Listofworks.js | 1144 +---------------- 2 files changed, 40 insertions(+), 1106 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 391edb90a..33362df65 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -829,7 +829,7 @@ class Studentshavecompletedthelist extends Component { width: '76px', render: (text, record) => ( - {rrecord.number === "--" ? + {record.number === "--" ? -- : {record.number} diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 2fcc21cca..f2eaa7696 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -661,7 +661,7 @@ class Listofworks extends Component { code_review: result.data.code_review, challenges_count:result.data.challenges_count, }) - this.seacthdata(); + this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1); } }).catch((error) => { console.log(error) @@ -718,7 +718,7 @@ class Listofworks extends Component { code_review: result.data.code_review, challenges_count:result.data.challenges_count, }) - this.seacthdata(); + this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,page); } // } @@ -748,227 +748,44 @@ class Listofworks extends Component { // 设置数据 - seacthdata = () => { + seacthdata = (teacherdata,student_works,work_efficiency,course_group_info) => { let {page, limit} = this.state; let datalist = []; let columns = this.state.columns; - if (this.state.teacherdata !== undefined) { - for (var i = 0; i < this.state.teacherdata.student_works.length; i++) { - var timedata = moment(this.state.teacherdata.student_works[i].update_time).format('YYYY-MM-DD HH:mm'); + if (teacherdata !== undefined) { + for (var i = 0; i < student_works.length; i++) { + var timedata = moment(student_works[i].update_time).format('YYYY-MM-DD HH:mm'); datalist.push({ - myid: this.state.teacherdata.student_works[i].id, + myid: student_works[i].id, number: (parseInt(page) - 1) * parseInt(limit) + (i + 1), - name: this.state.teacherdata.student_works[i].user_name, - stduynumber: this.state.teacherdata.student_works[i].student_id, - classroom: this.state.teacherdata.student_works[i].group_name, - submitstate: this.state.teacherdata.student_works[i].work_status === 0 ? "未提交" : this.state.teacherdata.student_works[i].work_status === 1 ? "按时提交" : this.state.teacherdata.student_works[i].work_status === 2 ? "延时提交" : "未提交", + name: student_works[i].user_name, + stduynumber: student_works[i].student_id, + classroom: student_works[i].group_name, + submitstate:student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时提交" :student_works[i].work_status === 2 ? "延时提交" : "未提交", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, - completion: this.state.teacherdata.student_works[i].complete_count === null ? "0" :this.state.teacherdata.student_works[i].complete_count === undefined ? "0": this.state.teacherdata.student_works[i].complete_count, - levelscore: this.state.teacherdata.student_works[i].final_score, - efficiencyscore: this.state.teacherdata.student_works[i].eff_score, - finalscore: this.state.teacherdata.student_works[i].work_score, + completion: student_works[i].complete_count === null ? "0" :student_works[i].complete_count === undefined ? "0": student_works[i].complete_count, + levelscore: student_works[i].final_score, + efficiencyscore: student_works[i].eff_score, + finalscore: student_works[i].work_score, operating: "查看", - late_penalty: this.state.teacherdata.student_works[i].late_penalty=== null?"0":this.state.teacherdata.student_works[i].late_penalty === undefined?"0":this.state.teacherdata.student_works[i].late_penalty, - ultimate_score:this.state.teacherdata.student_works[i].ultimate_score, - user_name: this.state.teacherdata.student_works[i].user_name, - user_login: this.state.teacherdata.student_works[i].user_login, + late_penalty: student_works[i].late_penalty=== null?"0":student_works[i].late_penalty === undefined?"0":student_works[i].late_penalty, + ultimate_score:student_works[i].ultimate_score, + user_name: student_works[i].user_name, + user_login: student_works[i].user_login, }) } var teacherlist = { //分页 - total: this.state.teacherdata.student_works.length, //数据总数量 + total: student_works.length, //数据总数量 pageSize: 20, //一页显示几条 - current: this.state.page, + current: page, } - if (this.state.work_efficiency === false) { - if(JSON.stringify(this.state.course_group_info) === "[]"|| this.state.course_group_info === undefined||this.state.course_group_info === null){ + if (work_efficiency === false) { + if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined||course_group_info === null){ //这里没有分班 没有 关卡得分 没有效率分 - {/* columns = [*/} - {/* {*/} - {/* title: '序号',*/} - {/* dataIndex: 'number',*/} - // key: 'number', - // align: 'center', - // fixed: 'left', - // width:'100px', - // className:'font-14', - // render: (text, record) => ( - // - // {record.number} - // - // ) - // }, - // { - // title: '姓名', - // dataIndex: 'name', - // key: 'name', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.name} - // - // ) - // }, - // { - // title: '学号', - // dataIndex: 'stduynumber', - // key: 'stduynumber', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} - // - // ), - // }, - // { - // title: '提交状态', - // dataIndex: 'submitstate', - // key: 'submitstate', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.submitstate} - // - // ) - // - // }, - // { - // title: '更新时间', - // dataIndex: 'updatetime', - // key: 'updatetime', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.updatetime} - // - // ), - // }, - // { - // title: '完成情况', - // dataIndex: 'completion', - // key: 'completion', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // - // - //

      已通过{record.completion}关,共{this.state.challenges_count}关
      - //
      }> - // {record.completion+"/"+this.state.challenges_count} - // - // - // - // ) - // }, - // { - // title: '最终成绩', - // dataIndex: 'finalscore', - // key: 'finalscore', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // { - // record.ultimate_score=== true? - // - //
      {record.user_name}{record.user_login}
      - //
      {record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
      - //
      }> - // { - // record.finalscore&&record.finalscore==="--"? - // {record.finalscore} - // : - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.finalscore} - // } - //
      - // : - // - //
      {record.user_name}{record.user_login}
      - //
      {record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
      - //
      {record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
      - //
      {record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
      - //
      {record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
      - // }> - // { - // record.finalscore&&record.finalscore==="--"? - // {record.finalscore} - // : - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.finalscore} - // } - //
      - // - // } - //
      - // ) - // }, - // { - // title: '操作', - // dataIndex: 'operating', - // key: 'operating', - // display: 'block', - // align: 'center', - // fixed: 'right', - // width:'100px', - // className:'font-14', - // render: (text, record) => ( - // record.submitstate === "未提交" ? --: - // - // - //
      直接调整最终成绩的分数
      - //
      其它评分全部作废
      - // }> - // this.Viewstudenttraininginformations(record)}>调分 - //
      - // this.Viewstudenttraininginformation(record)}>{record.operating} - //
      - // ) - // }, - // ] columns.map((item,key)=>{ if(item.title==="分班"){ columns.splice(key,1) @@ -981,190 +798,8 @@ class Listofworks extends Component { } }) }else{ - if(this.state.course_group_info.length < 2){ - // columns = [ - // { - // title: '序号', - // dataIndex: 'number', - // key: 'number', - // align: 'center', - // fixed: 'left', - // width:'100px', - // className:'font-14', - {/* render: (text, record) => (*/} - // - {/* {record.number}*/} - {/**/} - {/* )*/} - {/* },*/} - {/* {*/} - {/* title: '姓名',*/} - // dataIndex: 'name', - // key: 'name', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.name} - // - // ) - // }, - // { - // title: '学号', - // dataIndex: 'stduynumber', - // key: 'stduynumber', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} - // - // ), - // }, - // { - // title: '提交状态', - // dataIndex: 'submitstate', - // key: 'submitstate', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.submitstate} - // - // ) - // - // }, - // { - // title: '更新时间', - // dataIndex: 'updatetime', - // key: 'updatetime', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.updatetime} - // - // ), - // }, - // { - // title: '完成情况', - // dataIndex: 'completion', - // key: 'completion', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // - // - //
      已通过{record.completion}关,共{this.state.challenges_count}关
      - // }> - // {record.completion+"/"+this.state.challenges_count} - //
      - // - //
      - // ) - // }, - // { - // title: '最终成绩', - // dataIndex: 'finalscore', - // key: 'finalscore', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // { - // record.ultimate_score=== true? - // - //
      {record.user_name}{record.user_login}
      - //
      {record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
      - // }> - // { - // record.finalscore&&record.finalscore==="--"? - // {record.finalscore} - // : - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.finalscore} - // } - //
      - // : - // - //
      {record.user_name}{record.user_login}
      - //
      {record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
      - //
      {record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
      - //
      {record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
      - //
      {record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
      - // }> - // { - // record.finalscore&&record.finalscore==="--"? - // {record.finalscore} - // : - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.finalscore} - // } - //
      - // - // } - //
      - // ) - // }, - // { - // title: '操作', - // dataIndex: 'operating', - // key: 'operating', - // display: 'block', - // align: 'center', - // fixed: 'right', - // width:'100px', - // className:'font-14', - // render: (text, record) => ( - // record.submitstate === "未提交" ? --: - // - // - //
      直接调整最终成绩的分数
      - //
      其它评分全部作废
      - // }> - // this.Viewstudenttraininginformations(record)}>调分 - //
      - // this.Viewstudenttraininginformation(record)}>{record.operating} - //
      - // ) - // }, - // ] + if(course_group_info.length < 2){ + columns.map((item,key)=>{ if(item.title==="分班"){ columns.splice(key,1) @@ -1177,206 +812,7 @@ class Listofworks extends Component { } }) }else { - // columns = [ - // { - // title: '序号', - // dataIndex: 'number', - // key: 'number', - // align: 'center', - // fixed: 'left', - // width:'100px', - // className:'font-14', - // render: (text, record) => ( - // - // {record.number} - // - // ) - // }, - // { - // title: '姓名', - // dataIndex: 'name', - // key: 'name', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.name} - // - // ) - // }, - // { - // title: '学号', - // dataIndex: 'stduynumber', - // key: 'stduynumber', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber}*/} - {/**/} - {/* ),*/} - // }, - // { - // title: '分班', - // key: 'classroom', - {/* dataIndex: 'classroom',*/} - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // { - // record.classroom&&record.classroom==="--"? - // - // : - // - // } - // - // ) - // }, - // { - // title: '提交状态', - // dataIndex: 'submitstate', - {/* key: 'submitstate',*/} - {/* align: 'center',*/} - {/* className:'font-14',*/} - {/* render: (text, record) => (*/} - {/* */} - {/* {record.submitstate} - // - // ) - // - // }, - // { - // title: '更新时间', - // dataIndex: 'updatetime', - // key: 'updatetime', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.updatetime} - // - // ), - // }, - // { - // title: '完成情况', - // dataIndex: 'completion', - // key: 'completion', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // - // - //
      已通过{record.completion}关,共{this.state.challenges_count}关
      - // }> - // {record.completion+"/"+this.state.challenges_count} - //
      - // - //
      - // ) - // }, - // { - // title: '最终成绩', - // dataIndex: 'finalscore', - // key: 'finalscore', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // { - // record.ultimate_score=== true? - // - //
      {record.user_name}{record.user_login}
      - //
      {record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
      - // }> - // { - // record.finalscore&&record.finalscore==="--"? - // {record.finalscore} - // : - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.finalscore} - // } - //
      - // : - // - //
      {record.user_name}{record.user_login}
      - //
      {record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
      - //
      {record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
      - //
      {record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
      - //
      {record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
      - // }> - // { - // record.finalscore&&record.finalscore==="--"? - // {record.finalscore} - // : - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.finalscore} - // } - //
      - // - // } - //
      - // ) - // }, - // { - // title: '操作', - // dataIndex: 'operating', - // key: 'operating', - // display: 'block', - // align: 'center', - // fixed: 'right', - // width:'100px', - // className:'font-14', - // render: (text, record) => ( - // record.submitstate === "未提交" ? --: - // - // - //
      直接调整最终成绩的分数
      - //
      其它评分全部作废
      - // }> - // this.Viewstudenttraininginformations(record)}>调分 - //
      - // this.Viewstudenttraininginformation(record)}>{record.operating} - //
      - // ) - // }, - // ] + columns.map((item,key)=>{ if(item.title==="关卡得分"){ columns.splice(key,1) @@ -1388,520 +824,16 @@ class Listofworks extends Component { } } }else { - if(JSON.stringify(this.state.course_group_info) === "[]"|| this.state.course_group_info === undefined || this.state.course_group_info === null){ - // columns=[ - // { - // title: '序号', - // dataIndex: 'number', - // key: 'number', - // align: 'center', - // fixed: 'left', - // width:'100px', - // className:'font-14', - // render: (text, record) => ( - // - // {record.number} - // - // ) - // }, - // { - // title: '姓名', - // dataIndex: 'name', - // key: 'name', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.name} - // - // ) - // }, - // { - // title: '学号', - // dataIndex: 'stduynumber', - // key: 'stduynumber', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} - // - // ), - // }, - // { - // title: '提交状态', - // dataIndex: 'submitstate', - // key: 'submitstate', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.submitstate} - // - // ) - // - // }, - // { - // title: '更新时间', - // dataIndex: 'updatetime', - // key: 'updatetime', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.updatetime} - // - // ), - // }, - // { - // title: '完成情况', - // dataIndex: 'completion', - // key: 'completion', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // - // - //
      已通过{record.completion}关,共{this.state.challenges_count}关
      - // }> - // {record.completion+"/"+this.state.challenges_count} - //
      - // - //
      - // ) - // }, - // { - // title: '关卡得分', - // dataIndex: 'levelscore', - // key: 'levelscore', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.levelscore} - // - // ) - // }, - // { - // title: '效率分', - // dataIndex: 'efficiencyscore', - // key: 'efficiencyscore', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // { - // record.efficiencyscore&& record.efficiencyscore=== "--"?( - // record.submitstate==="按时提交"? - // - //
      作业截止时,系统根据学生在课堂成员中的效率表现自动评分
      - // }> - // - // -- - // - //
      - // : - // record.submitstate==="延时提交"? - // - //
      补交结束时,系统根据学生在课堂成员中的效率表现自动评分
      - // }> - // - // -- - // - //
      - // : - // - // -- - // - // ) - // : - // = 90 ? { - // "color": '#DD1717', - // "text-align": "center" - // } : {"color": '#747A7F', "text-align": "center"}}>{record.efficiencyscore} - // } - // - //
      - // - // ) - // }, - // { - // title: '最终成绩', - // dataIndex: 'finalscore', - // key: 'finalscore', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // { - // record.ultimate_score=== true? - // - //
      {record.user_name}{record.user_login}
      - //
      {record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
      - // }> - // { - // record.finalscore&&record.finalscore==="--"? - // {record.finalscore} - // : - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.finalscore} - // } - //
      - // : - // - //
      {record.user_name}{record.user_login}
      - //
      {record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
      - //
      {record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
      - //
      {record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
      - //
      {record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
      - // }> - // { - // record.finalscore&&record.finalscore==="--"? - // {record.finalscore} - // : - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.finalscore} - // } - //
      - // - // } - //
      - // ) - // }, - // { - // title: '操作', - // dataIndex: 'operating', - // key: 'operating', - // display: 'block', - // align: 'center', - // fixed: 'right', - // width:'100px', - // className:'font-14', - // render: (text, record) => ( - // record.submitstate === "未提交" ? -- : - // - // - //
      直接调整最终成绩的分数
      - //
      其它评分全部作废
      - // }> - // this.Viewstudenttraininginformations(record)}>调分 - //
      - // this.Viewstudenttraininginformation(record)}>{record.operating} - //
      - // ) - // }, - // ] + if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined || course_group_info === null){ + columns.map((item,key)=>{ if(item.title==="分班"){ columns.splice(key,1) } }) }else { - if(this.state.course_group_info.length < 2) { - // columns=[ - // { - // title: '序号', - // dataIndex: 'number', - // key: 'number', - // align: 'center', - // fixed: 'left', - // width:'100px', - // className:'font-14', - // render: (text, record) => ( - // - // {record.number} - // - // ) - // }, - // { - // title: '姓名', - // dataIndex: 'name', - // key: 'name', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.name} - // - // ) - // }, - // { - // title: '学号', - // dataIndex: 'stduynumber', - // key: 'stduynumber', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} - // - // ), - // }, - // { - // title: '提交状态', - // dataIndex: 'submitstate', - // key: 'submitstate', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.submitstate} - // - // ) - // - // }, - // { - // title: '更新时间', - // dataIndex: 'updatetime', - // key: 'updatetime', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // {record.updatetime} - // - // ), - // }, - // { - // title: '完成情况', - // dataIndex: 'completion', - // key: 'completion', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // - // - //
      已通过{record.completion}关,共{this.state.challenges_count}关
      - // }> - // {record.completion+"/"+this.state.challenges_count} - //
      - // - //
      - // ) - // }, - // { - // title: '关卡得分', - // dataIndex: 'levelscore', - // key: 'levelscore', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.levelscore} - // - // ) - // }, - // { - // title: '效率分', - // dataIndex: 'efficiencyscore', - // key: 'efficiencyscore', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // { - // record.efficiencyscore&& record.efficiencyscore=== "--"?( - // record.submitstate==="按时提交"? - // - //
      作业截止时,系统根据学生在课堂成员中的效率表现自动评分
      - // }> - // - // -- - // - //
      - // : - // record.submitstate==="延时提交"? - // - //
      补交结束时,系统根据学生在课堂成员中的效率表现自动评分
      - // }> - // - // -- - // - //
      - // : - // - // -- - // - // ) - // : - // = 90 ? { - // "color": '#DD1717', - // "text-align": "center" - // } : {"color": '#747A7F', "text-align": "center"}}>{record.efficiencyscore} - // } - // - //
      - // - // ) - // }, - // { - // title: '最终成绩', - // dataIndex: 'finalscore', - // key: 'finalscore', - // align: 'center', - // className:'font-14', - // render: (text, record) => ( - // - // { - // record.ultimate_score=== true? - // - //
      {record.user_name}{record.user_login}
      - //
      {record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分}
      - // }> - // { - // record.finalscore&&record.finalscore==="--"? - // {record.finalscore} - // : - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.finalscore} - // } - //
      - // : - // - //
      {record.user_name}{record.user_login}
      - //
      {record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
      - //
      {record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
      - //
      {record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
      - //
      {record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
      - // }> - // { - // record.finalscore&&record.finalscore==="--"? - // {record.finalscore} - // : - // = 90 ? {"color": '#DD1717', "text-align": "center"} : { - // "color": '#747A7F', - // "text-align": "center" - // }}>{record.finalscore} - // } - //
      - // - // } - //
      - // ) - // }, - // { - // title: '操作', - // dataIndex: 'operating', - // key: 'operating', - // display: 'block', - // align: 'center', - // fixed: 'right', - // width:'100px', - // className:'font-14', - // render: (text, record) => ( - // record.submitstate === "未提交" ? -- : - // - // - //
      直接调整最终成绩的分数
      - //
      其它评分全部作废
      - // }> - // this.Viewstudenttraininginformations(record)}>调分 - //
      - // this.Viewstudenttraininginformation(record)}>{record.operating} - //
      - // ) - // }, - // ] + if(course_group_info.length < 2) { + columns.map((item,key)=>{ if(item.title==="分班"){ columns.splice(key,1) @@ -1931,26 +863,26 @@ class Listofworks extends Component { unlimited: 0, course_groupyslstwo: [], loadingstate: true, - + page:1, }) - this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, null, this.state.limit); + this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); } else if (checkedValues.length === data.length) { this.setState({ unlimited: 0, course_groupyslstwo: [], loadingstate: true, + page:1, }) - this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, null, this.state.limit); + this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); } else { // console.log(checkedValues); this.setState({ course_groupyslstwo: checkedValues, unlimited: 1, - loadingstate: true + loadingstate: true, + page:1, }) - this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, null, this.state.limit); - - + this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); } } @@ -1974,6 +906,7 @@ class Listofworks extends Component { course_groupysls: undefined, checkedValuesineinfo:[], loadingstate: true, + page: 1, }) this.Startsorting(this.state.order, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit); } else { @@ -1982,6 +915,7 @@ class Listofworks extends Component { course_groupysls: checkedValues, unlimitedtwo: 0, loadingstate: true, + page: 1, }) this.Startsorting(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit); From 6d05c363fc1f3a98aa8d6c2a61533bf25ee3bf0d 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, 29 Jun 2019 09:54:40 +0800 Subject: [PATCH 24/39] =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMIndexHOC.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index fff1ce231..279a0a71d 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -216,7 +216,7 @@ export function TPMIndexHOC(WrappedComponent) { // 非课堂成员 isNotMember = () => { // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 && - return this.state.coursedata&&this.state.coursedata.course_identity === 6 + return this.state.coursedata&&this.state.coursedata.course_identity >6 } // setTrialapplication = ()=>{ From 17c4e3e33c9bae425374a02bf80061dc33063056 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 10:13:58 +0800 Subject: [PATCH 25/39] isNotMember --- public/react/src/modules/tpm/TPMIndexHOC.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index fff1ce231..5501ef499 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -216,7 +216,7 @@ export function TPMIndexHOC(WrappedComponent) { // 非课堂成员 isNotMember = () => { // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 && - return this.state.coursedata&&this.state.coursedata.course_identity === 6 + return this.state.coursedata&&this.state.coursedata.course_identity >= 6 } // setTrialapplication = ()=>{ From ce5dfa17ce30ad57dbd579ad9a89e7469289599f Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 10:29:38 +0800 Subject: [PATCH 26/39] no_mr --- public/react/src/modules/courses/boards/TopicDetail.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js index 0c25910f5..e333c17ee 100644 --- a/public/react/src/modules/courses/boards/TopicDetail.js +++ b/public/react/src/modules/courses/boards/TopicDetail.js @@ -526,8 +526,11 @@ class TopicDetail extends Component { const courseId=this.props.match.params.coursesId; const boardId = this.props.match.params.boardId return ( -
      {/* fl with100 */} +
      {/* fl with100 */}
      -
      - {memberslist===undefined?"":memberslist.members.length===0?
      + {memberslist===undefined?"":memberslist.length===0?

      未找到包含{search}的学生

      -
      :memberslist&&memberslist.members.map((item,key)=>{ +
      :memberslist&&memberslist.map((item,key)=>{ return(
      -
      {item.user_name}
      -
      {item.group_name}
      -
      {item.student_id}
      +
      {item.user_name}
      +
      {item.group_name}
      +
      {item.student_id}
      {item.commit_status===false?已提交 :""}
      ) @@ -719,22 +742,30 @@ class GraduationTasksSubmitedit extends Component{
      -
      +
      {selectmemberslist&&selectmemberslist.map((item,key)=>{ - return( -
      -
      {item.user_name}
      -
      {item.group_name}
      -
      {item.student_id}
      - {key>0?
      this.delecttask_status(item.user_id)}>
      :""} -
      - ) + if(item.group_name!=undefined) { + return ( +
      +
      {item.user_name}
      +
      {item.group_name}
      +
      {item.student_id}
      + {key > 0 ? +
      this.delecttask_status(item.user_id)}> +
      : ""} +
      + ) + } })} +
      diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index a49d38212..87044ee61 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -32,7 +32,8 @@ class GraduationTasksSubmitnew extends Component{ selectobjct:undefined, Loadtype:false, spinnings:false, - shixunsreplace:false + shixunsreplace:false, + limit:20 } } @@ -58,7 +59,7 @@ class GraduationTasksSubmitnew extends Component{ if(result.data.task_type===1){ }else{ - this.searchList("",1,10) + this.searchList("",1,20) } this.setState({ workslist:result.data, @@ -219,25 +220,42 @@ class GraduationTasksSubmitnew extends Component{ } - searchList=(search,page,limit)=>{ - this.setState({ - search:search, - page:page, - limit:10 - }) + searchList=(search,page,limit,types)=>{ let id=this.props.match.params.task_Id; + let {memberslist}=this.state; + let newmemberslist=memberslist let url="/graduation_tasks/"+id+"/graduation_works/search_member_list.json"; + axios.post(url,{ search:search, page:page, - limit:limit + limit:15 }).then((result)=>{ if(result.status===200){ if(result.data.status!=403){ - this.setState({ - memberslist:result.data - }) + if(types===1){ + if(result.data.members.length>0){ + result.data.members.map((item,key)=>{ + newmemberslist.push(item) + }) + } + this.setState({ + memberslist:newmemberslist, + search:search, + page:page, + limit:limit + }) + + }else{ + this.setState({ + memberslist:result.data.members, + search:search, + page:page, + limit:limit + }) + } + } } @@ -256,7 +274,7 @@ class GraduationTasksSubmitnew extends Component{ let newpage=page+2 - this.searchList(search,newpage,limit) + this.searchList(search,newpage,limit,1) } @@ -265,7 +283,7 @@ class GraduationTasksSubmitnew extends Component{ funtaskstatus=(checkedValues)=>{ let{memberslist,selectobjct}=this.state; - let newlist =memberslist.members; + let newlist =memberslist; let newcheckedValues=checkedValues; let selects=[]; selects.push(selectobjct) @@ -318,7 +336,7 @@ class GraduationTasksSubmitnew extends Component{ let {search} = this.state; - this.searchList(search,1,10) + this.searchList(search,1,20) } } onSearchKeywordKeyUps= (e)=>{ @@ -648,8 +666,8 @@ render(){ text-overflow:ellipsis; white-space:nowrap } - .width87{ - width: 87px; + .width100{ + width: 100px; height: 24px; } img.edu-nodata-img { @@ -657,21 +675,25 @@ render(){ margin: 50px 90px 20px; display: block; } + .autos{ + overflow: auto; + } `}
      -
      - {memberslist===undefined?"":memberslist.members.length===0? + {memberslist===undefined?"":memberslist.length===0?
      -

      未找到包含{search}的学生

      + {/*

      未找到包含{search}的学生

      */} +

      未找到该学生

      -
      :memberslist&&memberslist.members.map((item,key)=>{ +
      :memberslist&&memberslist.map((item,key)=>{ return(
      -
      {item.user_name}
      -
      {item.group_name}
      -
      {item.student_id}
      +
      {item.user_name}
      +
      {item.group_name}
      +
      {item.student_id}
      {item.commit_status===true?已提交 :""}
      ) @@ -704,22 +726,25 @@ render(){ white-space:nowrap } `} -
      +
      {selectmemberslist&&selectmemberslist.map((item,key)=>{ - return( -
      -
      {item.user_name}
      -
      {item.group_name}
      -
      {item.student_id}
      - {key>0?
      this.delecttask_status(item.user_id)}>
      :""} - -
      - ) + if(item.group_name!=undefined){ + return( +
      +
      {item.user_name}
      +
      {item.group_name}
      +
      {item.student_id}
      + {key>0?
      this.delecttask_status(item.user_id)}>
      :""} + +
      + ) + } + })}
      diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index 572bc5715..8b7bbb544 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -52,16 +52,17 @@ class ShixunWorkModal extends Component{ let types=false let{group_list}=this.state; group_list.map((item,key)=>{ - checkedValues.map((list,li)=>{ - if(item.id===list){ - if(item.works_count<2){ - this.props.showNotification(`有效作品数少于2个,无法查重`) - types=true - return + if(item!=undefined){ + checkedValues.map((list,li)=>{ + if(item.id===list){ + if(item.works_count<2){ + this.props.showNotification(`有效作品数少于2个,无法查重`) + types=true + return + } } - } - }) - + }) + } }) if(types===false){ From dc0051145ac18ba650069a39391c2667f3419ba3 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, 29 Jun 2019 11:01:59 +0800 Subject: [PATCH 28/39] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Resource/index.js | 2 +- .../src/modules/courses/exercise/ExerciseReviewAndAnswer.js | 2 +- public/react/src/modules/courses/poll/Poll.js | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index c4b5d10b0..e2d6d1618 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -668,7 +668,7 @@ class Fileslists extends Component{
      共 {total_count} 个资源 已发布:{public_count}个 - {this.props.isAdmin()||this.props.isStudent()?未发布:{private_count}个:""} + 未发布:{private_count}个
      } onPressEnter={this.onPressEnter} diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index b9da3f2eb..31c293659 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -561,7 +561,7 @@ class ExerciseReviewAndAnswer extends Component{

      { exercise && exercise.exercise_description && -

      {exercise.exercise_description}

      +

      {exercise.exercise_description}

      }

      { diff --git a/public/react/src/modules/courses/poll/Poll.js b/public/react/src/modules/courses/poll/Poll.js index a41f65ccd..0170cac00 100644 --- a/public/react/src/modules/courses/poll/Poll.js +++ b/public/react/src/modules/courses/poll/Poll.js @@ -523,9 +523,7 @@ class Poll extends Component{

      共{polls_counts && polls_counts.polls_total_counts}个问卷 已发布:{polls_counts && polls_counts.polls_published_counts}个 - { - isAdmin && 未发布:{polls_counts && polls_counts.polls_unpublish_counts}个 - } + 未发布:{polls_counts && polls_counts.polls_unpublish_counts}个

      Date: Sat, 29 Jun 2019 11:09:45 +0800 Subject: [PATCH 29/39] css --- public/react/src/modules/comment/Comment.css | 1 + .../src/modules/courses/boards/TopicDetail.js | 8 +++- .../modules/courses/common/CommentsHelper.js | 4 +- .../courses/common/comments/CommonReply.js | 2 +- .../tasks/GraduationTaskssettingReply.js | 2 +- .../graduation/topics/GraduateTopicReply.js | 2 +- .../src/modules/forums/MemoDetailMDEditor.js | 6 +-- public/react/src/scripts/concat.js | 48 +++++++++++++++++++ 8 files changed, 63 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/comment/Comment.css b/public/react/src/modules/comment/Comment.css index 2f85846b6..f21a9c8cf 100644 --- a/public/react/src/modules/comment/Comment.css +++ b/public/react/src/modules/comment/Comment.css @@ -238,6 +238,7 @@ width: 100%; word-wrap: break-word; margin-bottom: 4px; + margin-top: 4px; } .childComment .break_word_comments{ line-height: 22px; diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js index e333c17ee..325bbde0d 100644 --- a/public/react/src/modules/courses/boards/TopicDetail.js +++ b/public/react/src/modules/courses/boards/TopicDetail.js @@ -416,7 +416,7 @@ class TopicDetail extends Component { const user = this._getUser(); this.setState({ - comments: addNewComment(comments, _id, content, user) + comments: addNewComment(comments, _id, content, user, this) }) const newMemo2 = Object.assign({}, this.state.memo); newMemo2.total_replies_count = newMemo2.total_replies_count + 1; @@ -531,6 +531,10 @@ class TopicDetail extends Component { .topicDetail #forum_list .return_btn.no_mr { margin-right: 1px; } + /* 有内容时,编辑器下方的边框*/ + .topicDetail .borderBottom.commentInputs { + border-bottom: 1px solid rgb(238, 238, 238); + } .independent { background: rgb(250, 250, 250); padding-bottom: 20px; @@ -661,7 +665,7 @@ class TopicDetail extends Component {
      + height={160} showError={true} buttonText={'发表'} className={comments && comments.length && 'borderBottom'}> {/* onClick={ this.createNewComment } enableReplyTo={true} diff --git a/public/react/src/modules/courses/common/CommentsHelper.js b/public/react/src/modules/courses/common/CommentsHelper.js index b4254445d..e513263bc 100644 --- a/public/react/src/modules/courses/common/CommentsHelper.js +++ b/public/react/src/modules/courses/common/CommentsHelper.js @@ -64,13 +64,13 @@ export function handleContentBeforeCreateNew(argContent) { return content } -export function addNewComment(comments, _id, content, user, isSuperAdmin) { +export function addNewComment(comments, _id, content, user, isSuperAdmin, parentComponent) { if (!comments) { comments = []; } comments.unshift( { "can_delete": true, - "admin": user.admin, + "admin": parentComponent ? parentComponent.props.isAdmin() : user.admin , isSuperAdmin: isSuperAdmin, "content": content, diff --git a/public/react/src/modules/courses/common/comments/CommonReply.js b/public/react/src/modules/courses/common/comments/CommonReply.js index 739e62c97..dae21949c 100644 --- a/public/react/src/modules/courses/common/comments/CommonReply.js +++ b/public/react/src/modules/courses/common/comments/CommonReply.js @@ -76,7 +76,7 @@ class CommonReply extends Component{ const isSuperAdmin = this.props.isSuperAdmin() this.setState({ - comments: addNewComment(this.state.comments, _id, content, user, isSuperAdmin), + comments: addNewComment(this.state.comments, _id, content, user, isSuperAdmin, this), total_count: this.state.total_count + 1 }) this.refs.editor.showEditor(); diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js index 664c4a629..4281d0ec6 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js @@ -73,7 +73,7 @@ class GraduationTaskssettingReply extends Component{ const user = this._getUser(); this.setState({ - comments: addNewComment(this.state.comments, _id, content, user), + comments: addNewComment(this.state.comments, _id, content, user, this.props.isSuperAdmin(), this), total_count: this.state.total_count + 1 }) this.refs.editor.showEditor(); diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js index 114efa213..4e318a0c1 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js @@ -67,7 +67,7 @@ class GraduateTopicReply extends Component{ const user = this._getUser(); this.setState({ - comments: addNewComment(this.state.comments, _id, content, user), + comments: addNewComment(this.state.comments, _id, content, user, this.props.isSuperAdmin(), this), total_count: this.state.total_count + 1 }) this.refs.editor.showEditor(); diff --git a/public/react/src/modules/forums/MemoDetailMDEditor.js b/public/react/src/modules/forums/MemoDetailMDEditor.js index 6fd650cea..68445b0d7 100644 --- a/public/react/src/modules/forums/MemoDetailMDEditor.js +++ b/public/react/src/modules/forums/MemoDetailMDEditor.js @@ -117,7 +117,7 @@ class MemoDetailMDEditor extends Component { this.initMDEditor() } render() { - const { match, history, memo, placeholder } = this.props + const { match, history, memo, placeholder, className } = this.props const { isInited, errorMsg } = this.state if (!memo) { return
      @@ -154,7 +154,7 @@ class MemoDetailMDEditor extends Component { } `}
      + className={`mockInputWrapper commentInput ${className}`} > @@ -172,7 +172,7 @@ class MemoDetailMDEditor extends Component { ` } */} -
      diff --git a/public/react/src/scripts/concat.js b/public/react/src/scripts/concat.js index 3a40eef91..67e8d4836 100644 --- a/public/react/src/scripts/concat.js +++ b/public/react/src/scripts/concat.js @@ -97,3 +97,51 @@ return; // var uglified = uglify.minify(['file1.js', 'file2.js', 'file3.js']); + + +/** + 优化 + underscore被单独加载了,去掉'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\underscore.min.js', + marked + raphaeljs sequence diagrams 1.0.4 + + + 统计 js_min_all加载的js: + https://github.com/paulmillr/es6-shim + jQuery v1.8.3 jquery.com + Underscore.js 1.8.2 + marked v0.3.3 + ??? + Raphaël 2.1.3 - JavaScript Vector Library + flowchart, v1.3.4 + editormd.js + CodeMirror + cm active-line.js + cm mode javascript + cm merge.js + CodeMirror addon hint + cm showHint + cm anyword-hint + CodeMirror python + CodeMirror c-like(java) + CodeMirror matchbrackets + + + + ???——> + // Copyright (C) 2006 Google Inc. + // + // Licensed under the Apache License, Version 2.0 (the "License"); + // you may not use this file except in compliance with the License. + // You may obtain a copy of the License at + // + // http://www.apache.org/licenses/LICENSE-2.0 + // + // Unless required by applicable law or agreed to in writing, software + // distributed under the License is distributed on an "AS IS" BASIS, + // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + // See the License for the specific language governing permissions and + // limitations under the License. + + + */ \ No newline at end of file From 53379b34877b56348b65521f86e6fb1a30650f47 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 13:44:55 +0800 Subject: [PATCH 30/39] css --- .../src/modules/comment/CommentItemMDEditor.js | 17 ++++++++++------- public/react/src/modules/comment/Comments.js | 1 + .../courses/common/comments/CCommentItem.js | 2 +- .../modules/courses/common/courseMessage.css | 4 +++- .../graduation/tasks/Graduationtaskitem.js | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/comment/CommentItemMDEditor.js b/public/react/src/modules/comment/CommentItemMDEditor.js index 3c89d0800..98afa4228 100644 --- a/public/react/src/modules/comment/CommentItemMDEditor.js +++ b/public/react/src/modules/comment/CommentItemMDEditor.js @@ -96,7 +96,7 @@ class CommentItemMDEditor extends Component { } render() { - const { match, history, item, user } = this.props + const { match, history, item, user, buttonText } = this.props if (!item) { return
      } @@ -111,7 +111,7 @@ class CommentItemMDEditor extends Component {
      From 14a638c34ecd7648aa2b2b7a943ddc8d6be6fac9 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 15:23:39 +0800 Subject: [PATCH 33/39] =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/exercise/new/JudgeEditor.js | 10 +++++----- .../src/modules/courses/exercise/new/MainEditor.js | 6 +++--- .../src/modules/courses/exercise/new/NullEditor.js | 11 ++++++----- .../src/modules/courses/exercise/new/ShixunEditor.js | 2 +- .../src/modules/courses/exercise/new/SingleEditor.js | 4 ++-- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/public/react/src/modules/courses/exercise/new/JudgeEditor.js b/public/react/src/modules/courses/exercise/new/JudgeEditor.js index 280faa2e3..586d77ed0 100644 --- a/public/react/src/modules/courses/exercise/new/JudgeEditor.js +++ b/public/react/src/modules/courses/exercise/new/JudgeEditor.js @@ -56,23 +56,23 @@ class SingleEditor extends Component{ const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1); if(!question_title) { this.refs['titleEditor'].showError() - this.props.showNotification('题目不能为空'); return; + this.props.showNotification('题目:不能为空'); return; } const intScore = parseFloat(question_score) if(!question_score || intScore == NaN) { - this.props.showNotification('分值不能为空'); return; + this.props.showNotification('分值:不能为空'); return; } else { if (intScore == 0) { - this.props.showNotification('分值必须大于0'); return; + this.props.showNotification('分值:必须大于0'); return; } } if(!answerArray || answerArray.length == 0) { - this.props.showNotification('请先点击本题的正确选项'); return; + this.props.showNotification('必须设置标准答案'); return; } if(!question_title) { this.refs['titleEditor'].showError() - this.props.showNotification('题目不能为空'); return; + this.props.showNotification('题目:不能为空'); return; } diff --git a/public/react/src/modules/courses/exercise/new/MainEditor.js b/public/react/src/modules/courses/exercise/new/MainEditor.js index 9f6e643df..e9dd3b105 100644 --- a/public/react/src/modules/courses/exercise/new/MainEditor.js +++ b/public/react/src/modules/courses/exercise/new/MainEditor.js @@ -46,16 +46,16 @@ class MainEditor extends Component{ const answerArray = standard_answers if(!question_title) { this.refs['titleEditor'].showError() - this.props.showNotification('题目不能为空'); return; + this.props.showNotification('题目:不能为空'); return; } const intScore = parseFloat(question_score) if(!question_score || intScore == NaN) { - this.props.showNotification('分值不能为空'); return; + this.props.showNotification('分值:不能为空'); return; } else { if (intScore == 0) { - this.props.showNotification('分值必须大于0'); return; + this.props.showNotification('分值:必须大于0'); return; } } // if(!answerArray || answerArray.length == 0 || !answerArray[0]) { diff --git a/public/react/src/modules/courses/exercise/new/NullEditor.js b/public/react/src/modules/courses/exercise/new/NullEditor.js index dddadcf0a..299daf904 100644 --- a/public/react/src/modules/courses/exercise/new/NullEditor.js +++ b/public/react/src/modules/courses/exercise/new/NullEditor.js @@ -70,15 +70,15 @@ class NullEditor extends Component{ let answerArray = [] if(!question_title) { this.refs['titleEditor'].showError() - this.props.showNotification('题目不能为空'); return; + this.props.showNotification('题目:不能为空'); return; } const intScore = parseFloat(question_score) if(!question_score || intScore == NaN) { - this.props.showNotification('分值不能为空'); return; + this.props.showNotification('分值:不能为空'); return; } else { if (intScore == 0) { - this.props.showNotification('分值必须大于0'); return; + this.props.showNotification('分值:必须大于0'); return; } } let isEmpty = false; @@ -91,7 +91,8 @@ class NullEditor extends Component{ answerArray[index].answer_text.push(item) if(!item) { this.refs[`nullChildEditor${index}`].showError(itemIndex) - this.props.showNotification(`请先输入第${index+1}个填空的第${itemIndex+1}参考答案。`); + // this.props.showNotification(`请先输入第${index+1}个填空的第${itemIndex+1}参考答案。`); + this.props.showNotification(`答案:不能为空`); isEmpty = true; } }) @@ -101,7 +102,7 @@ class NullEditor extends Component{ } if(!question_title) { this.refs['titleEditor'].showError() - this.props.showNotification('题目不能为空'); return; + this.props.showNotification('题目:不能为空'); return; } diff --git a/public/react/src/modules/courses/exercise/new/ShixunEditor.js b/public/react/src/modules/courses/exercise/new/ShixunEditor.js index 581467257..e4835ee10 100644 --- a/public/react/src/modules/courses/exercise/new/ShixunEditor.js +++ b/public/react/src/modules/courses/exercise/new/ShixunEditor.js @@ -98,7 +98,7 @@ class ShixunEditor extends Component{ // } for(let _i = 0; _i < question_scores.length; _i++) { if (!question_scores[_i] || question_scores[_i] == '0') { - this.props.showNotification(`第${_i+1}题的分值必须大于0`); return; + this.props.showNotification(`第${_i+1}题的分值:必须大于0`); return; } } diff --git a/public/react/src/modules/courses/exercise/new/SingleEditor.js b/public/react/src/modules/courses/exercise/new/SingleEditor.js index a9e8aa3f5..8e68a593c 100644 --- a/public/react/src/modules/courses/exercise/new/SingleEditor.js +++ b/public/react/src/modules/courses/exercise/new/SingleEditor.js @@ -88,7 +88,7 @@ class SingleEditor extends Component{ const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1); if(!question_title) { this.refs['titleEditor'].showError() - this.props.showNotification('题目不能为空'); return; + this.props.showNotification('题目:不能为空'); return; } @@ -105,7 +105,7 @@ class SingleEditor extends Component{ } if(!question_title) { this.refs['titleEditor'].showError() - this.props.showNotification('题目不能为空'); return; + this.props.showNotification('题目:不能为空'); return; } From 9cda4635ddcce5685e2fc89128b70b2c11f09599 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, 29 Jun 2019 16:08:48 +0800 Subject: [PATCH 34/39] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/comment/CommentsHOC.js | 1236 +++++++++-------- .../courses/coursesPublic/Addcourses.js | 23 +- .../exercise/Testpapersettinghomepage.js | 2 + .../graduation/tasks/GraduationTasksedit.js | 7 +- .../tasks/GraduationTaskssetting.js | 6 +- .../tasks/GraduationTaskssettinglist.js | 83 +- .../shixunHomework/ShixunStudentWork.js | 90 +- public/react/src/modules/tpm/SiderBar.js | 2 +- 8 files changed, 754 insertions(+), 695 deletions(-) diff --git a/public/react/src/modules/comment/CommentsHOC.js b/public/react/src/modules/comment/CommentsHOC.js index 4cdd852b4..cc5be1654 100644 --- a/public/react/src/modules/comment/CommentsHOC.js +++ b/public/react/src/modules/comment/CommentsHOC.js @@ -1,613 +1,625 @@ -import React from 'react' -import ReactDOM from 'react-dom' -import axios from 'axios' -import update from 'immutability-helper' - -import ImageLayer from '../page/layers/ImageLayer' - -const $ = window.$ -/* 需要的props: - shixun - id - myshixun - id - challenge - id - user - "image_url": user.image_url, - "username": user.username, - showSnackbar - - */ -/* - 这里提供props给WrappedComponent,用于封装特定的state和功能(评论列表) - 不要直接使用this.xxx调用WrappedComponent内的方法,尽量避免互相依赖,封装好后供不同场景使用(tpi、tpm) -*/ -export function commentHOC(WrappedComponent) { - // 这里如果extends WrappedComponent 会出现 WrappedComponent mount twice的问题 - return class II extends React.Component { - constructor(props) { - super(props) - - // ------------------------------------ - this.createNewComment = this.createNewComment.bind(this) - this.fetchCommentIfNotFetched = this.fetchCommentIfNotFetched.bind(this) - this.replyComment = this.replyComment.bind(this) - this.deleteComment = this.deleteComment.bind(this) - this.commentPraise = this.commentPraise.bind(this) - this.hiddenComment = this.hiddenComment.bind(this) - this.rewardCode = this.rewardCode.bind(this) - this.showNewReply = this.showNewReply.bind(this) - this.newMessage = this.newMessage.bind(this) - // ------------------------------------ - - this.onPaginationChange = this.onPaginationChange.bind(this) - - this.state = { - // 评论 - comments: [], - comment_count_without_reply: 0, - // 默认pageSize为10 - currentPage: 1, - loadingComments: true, - - // 图片最大化 - showImage: false, - imageSrc: '', - } - } - - // ----------------------------------------------------------------------------------------------评论 Start - - // ----------------------------------------------------------------------------------------------评论 Start - onPaginationChange(page) { - this.fetchComment(page) - this.setState({ - currentPage: page, - }); - } - /* - email: "1843820944@qq.com" - grade: 2138 - image_url: "avatar/User/36497" - login: "p24891375" - name: "杨俊男" - user_url: "/users/p24891375" -*/ - handleComments(comments, responseData) { - comments.forEach(element => { - if (element.children) { - this.handleComments(element.children, responseData) - } - element.admin = responseData.all - element.manager = element.manage - - element.username = element.author.name - element.user_login = element.author.login - element.image_url = element.author.image_url - element.user_id = element.author.user_id - - }); - } - responseDataParse(response) { - const comments = response.data.comments - this.handleComments(comments, response.data) - } - fetchComment(page = 1) { - const { challenge, shixun, match } = this.props; - // const url = `/api/v1/shixuns/${shixun.id}/shixun_discusses?page=${page-1}&container_type=Shixun` - const url = - `/discusses.json?page=${page-1}&container_identifier=${shixun && shixun.identifier ? - shixun.identifier : match.params.shixunId}&container_type=Shixun` - - this.setState({ - loadingComments: true, - }); - - // test - // if (true) { - if (false) { - var data = {"children_list":[{"id":1165,"content":"\u7535\u8111\u6ca1\u6709pi\u554a","time":"4\u5929\u524d","position":2,"user_id":31542,"reward":null,"image_url":"avatars/User/b","username":"\u8d75\u94f6\u7fd4","user_login":"p81572036","shixun_id":61,"hidden":false,"manager":false,"praise_count":0,"user_praise":false,"admin":false,"children":null},{"id":1142,"content":"\u6700\u540e\u4e00\u9898\u4e09\u5929\u6253\u9c7c\uff0c\u4e24\u5929\u6652\u7f51\uff0c\u4e0d\u5e94\u8be5\u662f1.01*1.01*1.01*0.99*0.99\uff0c\u800c\u4e0d\u662f\u52a0\u5417\uff1f","time":"4\u5929\u524d","position":1,"user_id":33714,"reward":null,"image_url":"avatars/User/b","username":"\u843d\u5c18","user_login":"p52769048","shixun_id":61,"hidden":false,"manager":false,"praise_count":0,"user_praise":false,"admin":false,"children":[{"content":"\u672c\u5173\u5e76\u6ca1\u6709\u5199\u5230\u201c1.01*1.01*1.01*0.99*0.99\u201d\uff0c\u4e0d\u77e5\u9053\u4f55\u6765\u6b64\u95ee\uff1f","time":"4\u5929\u524d","position":1,"reward":null,"image_url":"avatars/User/1","username":"Coder","user_id":1,"user_login":"innov","can_delete":false,"id":1144}]},{"id":1112,"content":"\u8fd9\u4e2a\u5b9e\u8bad\u5f88\u8d5e\uff01","time":"10\u5929\u524d","position":2,"user_id":12,"reward":null,"image_url":"avatars/User/12","username":"\u9ec4\u4e95\u6cc9","user_login":"Hjqreturn","shixun_id":61,"hidden":false,"manager":false,"praise_count":1,"user_praise":false,"admin":false,"children":null},{"id":1057,"content":"\u4e0d\u9519","time":"20\u5929\u524d","position":2,"user_id":30403,"reward":null,"image_url":"avatars/User/b","username":"Jimmy","user_login":"p69243850","shixun_id":61,"hidden":false,"manager":false,"praise_count":1,"user_praise":false,"admin":false,"children":null},{"id":975,"content":"q","time":"1\u4e2a\u6708\u524d","position":2,"user_id":30403,"reward":null,"image_url":"avatars/User/b","username":"Jimmy","user_login":"p69243850","shixun_id":61,"hidden":false,"manager":false,"praise_count":1,"user_praise":false,"admin":false,"children":[{"content":"\u4e0b\u6b21\u518d\u53d1\u65e0\u610f\u4e49\u7684\u5185\u5bb9\uff0c\u5c06\u88ab\u6263\u91d1\u5e01\u54e6","time":"1\u4e2a\u6708\u524d","position":2,"reward":null,"image_url":"avatars/User/1","username":"Coder","user_id":1,"user_login":"innov","can_delete":false,"id":980}]},{"id":974,"content":"k","time":"1\u4e2a\u6708\u524d","position":2,"user_id":30403,"reward":null,"image_url":"avatars/User/b","username":"Jimmy","user_login":"p69243850","shixun_id":61,"hidden":false,"manager":false,"praise_count":0,"user_praise":false,"admin":false,"children":[{"content":"\u4e0b\u6b21\u518d\u53d1\u65e0\u610f\u4e49\u7684\u5185\u5bb9\uff0c\u5c06\u88ab\u6263\u91d1\u5e01\u54e6","time":"1\u4e2a\u6708\u524d","position":2,"reward":null,"image_url":"avatars/User/1","username":"Coder","user_id":1,"user_login":"innov","can_delete":false,"id":981}]},{"id":859,"content":"\u5f88\u68d2\uff01\uff01\uff01","time":"1\u4e2a\u6708\u524d","position":4,"user_id":1,"reward":null,"image_url":"avatars/User/1","username":"Coder","user_login":"innov","shixun_id":61,"hidden":false,"manager":false,"praise_count":0,"user_praise":false,"admin":false,"children":null},{"id":802,"content":"\u4e0d\u9519\uff01","time":"2\u4e2a\u6708\u524d","position":1,"user_id":30403,"reward":null,"image_url":"avatars/User/b","username":"Jimmy","user_login":"p69243850","shixun_id":61,"hidden":false,"manager":false,"praise_count":1,"user_praise":false,"admin":false,"children":null},{"id":619,"content":"\u770b\u6765\u8001\u5e08\u5bf9\u9f50\u7528\u7684\u90fd\u662f\u7a7a\u683c","time":"5\u4e2a\u6708\u524d","position":3,"user_id":29145,"reward":null,"image_url":"avatars/User/b","username":"yang","user_login":"m02945638","shixun_id":61,"hidden":false,"manager":false,"praise_count":1,"user_praise":false,"admin":false,"children":null},{"id":553,"content":"

      \r\n\t666\r\n

      \r\n

      \r\n\t
      \r\n

      ","time":"6\u4e2a\u6708\u524d","position":4,"user_id":26838,"reward":null,"image_url":"avatars/User/b","username":"\u5189\u529b","user_login":"m54013296","shixun_id":61,"hidden":false,"manager":false,"praise_count":0,"user_praise":false,"admin":false,"children":null}],"disscuss_count":183} - - this.setState({ - comments: data.children_list, - comment_count_without_reply: data.disscuss_count, - - currentPage: page, - loadingComments: false, - }) - return; - } - - axios.get(url, - { - // withCredentials: true - } - ).then((response) => { - // test - - if (response.data) { - this.responseDataParse(response) - this.setState({ - comments: response.data.comments, - comment_count_without_reply: response.data.disscuss_count, - - currentPage: page, - loadingComments: false, - }, ()=>{ - // keditor代码美化 - window.prettyPrint() - }) - } - // console.log(response) - }).catch((error) => { - console.log(error) - }) - } - // 切换关卡时,清空state - clearCommentsInState = () => { - this.setState({ comments: [] }) - } - fetchCommentIfNotFetched() { - if (this.state.comments && this.state.comments.length) { - return; - } - - // http://localhost:3000/api/v1/shixuns/cz7yw3en/shixun_discusses?page=0 - - this.fetchComment(); - } - // 新增父级评论 - createNewComment() { - console.log('createNewComment...') - - const { challenge, shixun, showSnackbar } = this.props; - let content = window._commentInput.html(); - if (!content || content.length === 0) { - showSnackbar('必须填写内容!') - return; - } - - // const url = `/api/v1/discusses` - const url = `/discusses.json` - - if(content != undefined){ - var beforeImage = content.split(""); - if(beforeImage[0] == "" && afterImage[1] == ""){ - window.notice_box('不支持纯图片评论
      请在评论中增加文字信息'); - return; - } - } - - $("#new_message_submit_btn_" + this.props.challenge.shixun_id).hide(); - - if (content) { // 去掉尾部的回车换行 - content = content.replace(/(\n

      \n\t
      \n<\/p>)*$/g,''); - } - - axios.post(url, { - container_type: "Shixun", - container_id: shixun.id, - challenge_id: challenge.id, - content, - position: challenge.position - }, - { - // withCredentials: true - } - ).then((response) => { - if (response.data.discuss) { - - window._commentInput.html(''); - window._commentInput.afterBlur() - // this.setState({ - // runTesting: false, - // }) - this.fetchComment() - } - console.log(response) - }).catch((error) => { - console.log(error) - }) - return true; - } - _findCommentById(id, arg_comments) { - let comments; - if (!arg_comments) { - comments = this.state.comments; - } else { - comments = arg_comments; - } - for(let i = 0; i < comments.length; i++) { - if (id === comments[i].id) { - return i; - } - } - } - replyComment(commentContent, id, editor) { - // http://localhost:3000/api/v1/discusses/812/reply - const { challenge, shixun, user, showSnackbar, match } = this.props; - - if (!commentContent || commentContent.length === 0) { - showSnackbar('必须填写内容!') - return; - } - // const url = `/api/v1/discusses/${id}/reply` - const url = `/discusses/${id}/reply.json` - if (commentContent) { - commentContent = commentContent.replace(/(\n

      \n\t
      \n<\/p>)*$/g,''); - } - if (!user.login && user.user_url) { - const loginAr = user.user_url.split('/') - user.login = loginAr[loginAr.length - 1] - } - axios.post(url, { - content: commentContent, - // TODO - "container_id": match.params.shixunId, - "container_type": "Shixun", - }, - { - // withCredentials: true - } - ).then((response) => { - if (response.data.discuss) { - let newDiscuss = response.data.discuss; - let { comments } = this.state; - var commentIndex = this._findCommentById(id); - let comment = comments[commentIndex] - comment = Object.assign({}, comment) - if (!comment.children ) { - comment.children = [] - } else { - comment.children = comment.children.slice(0); - } - // TODO userName iamge_url - comment.children.push( { - "can_delete": true, - "content": commentContent, - - "image_url": user.image_url, - "username": user.username, - "user_login": user.login, - "id": newDiscuss.id, - "position": newDiscuss.position, - "time": "1分钟前", - "praise_count": newDiscuss.praise_count, - - "user_id": newDiscuss.user_id, - - }) - - comments = comments.slice(0) - comments[commentIndex] = comment - - // ke - editor.html && editor.html('') - // md - if (editor.setValue) { - editor.setValue('') - const $ = window.$ - var view_selector = `.commentItemMDEditorView_${id}` - $(view_selector).hide(); - } - - - this.setState({ - // runTesting: false, - comments: comments - }, ()=>{ - // keditor代码美化 - editor.html && window.prettyPrint() - }) - } - console.log(response) - }).catch((error) => { - console.log(error) - }) - } - hiddenComment(item, childCommentId) { - const id = item.id - const { challenge, shixun, user, showSnackbar, match } = this.props; - // const url = `/api/v1/discusses/${id}/hidden` - const url = `/discusses/${id}/hidden.json` - - const commentIndex = this._findCommentById(id); - const { comments } = this.state; - const comment = Object.assign({}, comments[commentIndex]); - axios.post(url, { - hidden: !comment.hidden ? "1" : "0", - container_identifier: match.params.shixunId || shixun.identifier - }, - { - // withCredentials: true - } - ).then((response) => { - if (response.data.status === -1) { - showSnackbar(response.data.message) - return; - } - if (response.data.status === 1) { - - if (!childCommentId) { - comment.hidden = !comment.hidden; - const commentsCopy = this.state.comments.slice(0) - commentsCopy[commentIndex] = comment - this.setState({ - comments: commentsCopy - }) - } else { // TODO 目前子回复没hidden字段 - let childCommentIndex = this._findCommentById(childCommentId, comments[commentIndex].children); - const childComment = comments[commentIndex].children[childCommentIndex] - childComment.hidden = !childComment.hidden; - this.setState({ comments }) - } - - } - // {"message":"Couldn't find Discuss with id=911","status":-1} - console.log(response) - }).catch((error) => { - console.log(error) - }) - } - deleteComment(parrentComment, childCommentId) { - const { challenge, shixun } = this.props; - let deleteCommentId = parrentComment.id - if (childCommentId) { - deleteCommentId = childCommentId; - } - // const url = `/api/v1/discusses/${deleteCommentId}` - const url = `/discusses/${deleteCommentId}.json` - - axios.delete(url, - { - // withCredentials: true - } - ).then((response) => { - // TODO 删除成功或失败 - if (response.data && response.data.status === 1) { - const commentIndex = this._findCommentById(parrentComment.id); - - // https://stackoverflow.com/questions/29527385/removing-element-from-array-in-component-state - if (!childCommentId) { - this.setState((prevState) => ({ - comments: update(prevState.comments, {$splice: [[commentIndex, 1]]}) - })) - - if (this.state.comments.length <= 5) { - this.fetchComment() - } - } else { - let comments = this.state.comments; - let newComments = Object.assign({}, comments) - let childCommentIndex = this._findCommentById(childCommentId, newComments[commentIndex].children); - newComments[commentIndex].children = update(newComments[commentIndex].children, {$splice: [[childCommentIndex, 1]]}) - this.setState({ newComments }) - } - } - console.log(response) - }).catch((error) => { - console.log(error) - }) - } - - rewardCode(parrentComment, childComment, amount) { - const { challenge, shixun, showSnackbar } = this.props; - let handleComment = parrentComment - if (childComment) { - handleComment = childComment; - } - let handleCommentId = handleComment.id; - // const url = `/api/v1/discusses/${handleCommentId}/reward_code` - const url = `/discusses/${handleCommentId}/reward_code.json` - - axios.post(url, { - // id: handleCommentId, - - // container_id: shixun.id, - container_type: 'Discusses', - score: amount, - user_id: handleComment.user_id - }, - { - // withCredentials: true - } - ).then((response) => { - if (response.data && response.data.code) { - const commentIndex = this._findCommentById(parrentComment.id); - let { comments } = this.state; - const newComments = comments.slice(0) - - if (childComment) { - const childCommentIndex = this._findCommentById(handleComment.id, parrentComment.children); - const newChildComment = Object.assign({}, childComment); - newChildComment.reward = response.data.code - parrentComment = Object.assign({}, parrentComment) - parrentComment.children = parrentComment.children.slice(0) - parrentComment.children[childCommentIndex] = newChildComment - - newComments[commentIndex] = parrentComment; - - - } else { - const newComment = Object.assign({}, newComments[commentIndex]); - newComment.reward = response.data.code; - newComments[commentIndex] = newComment; - } - this.setState({ - comments: newComments - }) - } - }).catch((error) => { - console.log(error) - showSnackbar('奖励失败,请联系系统管理员!') - }) - } - - // 评论点赞 - commentPraise(discussId) { - const commentIndex = this._findCommentById(discussId); - const { comments } = this.state; - - const { challenge } = this.props; - // const url = `/api/v1/discusses/${discussId}/plus` - const url = `/discusses/${discussId}/plus.json` - axios.post(url, { - // id: discussId, - // container_id: challenge.id, - container_type: 'Discuss', //Discuss - type: comments[commentIndex].user_praise === true ? 0 : 1, // "踩0;赞1" - }, - { - // withCredentials: true - } - ).then((response) => { - if (response.data.praise_count === 0 || response.data.praise_count) { - const newComments = comments.slice(0) - const comment = Object.assign({}, newComments[commentIndex]) - comment.user_praise = !comment.user_praise; - comment.praise_count = response.data.praise_count; - newComments[commentIndex] = comment; - this.setState({ - comments: newComments - }) - } - console.log(response) - }).catch((error) => { - console.log(error) - }) - } - - newMessage() { - return; // newMessage 暂时不用了 - const { shixun, myshixun } = this.props; - const url = `/api/v1/shixuns/${shixun.id}/new_message?container_type=Shixun&myshixun_id=${myshixun.id}` - // this.setState({ - // gotNewReply: true - // }) - axios.get(url, - { - // withCredentials: true - } - ).then((response) => { - const new_message = response.data.new_message; - if (response.data.new_message) { - this.setState({ - gotNewReply: new_message - }) - } - // console.log(response) - }).catch((error) => { - console.log(error) - }) - } - - showNewReply() { - const { shixun, myshixun } = this.props; - const commentId = 929 // TODO - const url = `/api/v1/shixuns/${shixun.id}/anchor?container_type=Shixun&myshixun_id=${myshixun.id}&discuss_id=${commentId}` - - this.setState({ - loadingComments: true, - gotNewReply: false, - - }); - axios.get(url, - { - // withCredentials: true - } - ).then((response) => { - const data = response.data; - const new_message = data.new_message; - - this.setState({ - comments: data.children_list, - comment_count_without_reply: data.disscuss_count, - - currentPage: data.page, - loadingComments: false, - - }, () => { - if (response.data.find_status) { // 没找到评论的话,默认会返回第一页的评论 - const comment_J = window.$(`#reply_content_${commentId}`); - if (comment_J.length) { - comment_J[0].scrollIntoView() - comment_J.parents('.comment_item_cont').css('border', '1px solid #4CACFF') - } - } - }) - console.log(response) - }).catch((error) => { - console.log(error) - }) - } - - // ----------------------------------------------------------------------------------------------评论 End - - // ----------------------------------------------------------------------------------------------评论 End - - componentDidMount() { - // commentsDelegateParent #game_left_contents #tab_con_4 - $(".commentsDelegateParent") - .delegate(".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click", (event) => { - - const imageSrc = event.target.src - // 非回复里的头像图片; 非emoticons - if (imageSrc.indexOf('/images/avatars/User') === -1 && - imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { - this.setState({ - showImage: true, - imageSrc, - }) - } - }); - } - onImageLayerClose = () => { - this.setState({ - showImage: false, - imageSrc: '', - }) - } - render() { - return ( - - - - - - - ) - } - } -} -/* -

      -

      - HOC Debugger Component -

      -

      - Props -

      -
      {stringify(this.props)}
      -

      - State -

      -
      {stringify(this.state)}
      - {super.render()} -
      - +import React from 'react' +import ReactDOM from 'react-dom' +import axios from 'axios' +import { notification } from 'antd' +import update from 'immutability-helper' + +import ImageLayer from '../page/layers/ImageLayer' + +const $ = window.$ +/* 需要的props: + shixun + id + myshixun + id + challenge + id + user + "image_url": user.image_url, + "username": user.username, + showSnackbar + + */ +/* + 这里提供props给WrappedComponent,用于封装特定的state和功能(评论列表) + 不要直接使用this.xxx调用WrappedComponent内的方法,尽量避免互相依赖,封装好后供不同场景使用(tpi、tpm) +*/ +export function commentHOC(WrappedComponent) { + // 这里如果extends WrappedComponent 会出现 WrappedComponent mount twice的问题 + return class II extends React.Component { + constructor(props) { + super(props) + + // ------------------------------------ + this.createNewComment = this.createNewComment.bind(this) + this.fetchCommentIfNotFetched = this.fetchCommentIfNotFetched.bind(this) + this.replyComment = this.replyComment.bind(this) + this.deleteComment = this.deleteComment.bind(this) + this.commentPraise = this.commentPraise.bind(this) + this.hiddenComment = this.hiddenComment.bind(this) + this.rewardCode = this.rewardCode.bind(this) + this.showNewReply = this.showNewReply.bind(this) + this.newMessage = this.newMessage.bind(this) + // ------------------------------------ + + this.onPaginationChange = this.onPaginationChange.bind(this) + + this.state = { + // 评论 + comments: [], + comment_count_without_reply: 0, + // 默认pageSize为10 + currentPage: 1, + loadingComments: true, + + // 图片最大化 + showImage: false, + imageSrc: '', + } + } + + // ----------------------------------------------------------------------------------------------评论 Start + + // ----------------------------------------------------------------------------------------------评论 Start + onPaginationChange(page) { + this.fetchComment(page) + this.setState({ + currentPage: page, + }); + } + /* + email: "1843820944@qq.com" + grade: 2138 + image_url: "avatar/User/36497" + login: "p24891375" + name: "杨俊男" + user_url: "/users/p24891375" +*/ + handleComments(comments, responseData) { + comments.forEach(element => { + if (element.children) { + this.handleComments(element.children, responseData) + } + element.admin = responseData.all + element.manager = element.manage + + element.username = element.author.name + element.user_login = element.author.login + element.image_url = element.author.image_url + element.user_id = element.author.user_id + + }); + } + responseDataParse(response) { + const comments = response.data.comments + this.handleComments(comments, response.data) + } + fetchComment(page = 1) { + const { challenge, shixun, match } = this.props; + // const url = `/api/v1/shixuns/${shixun.id}/shixun_discusses?page=${page-1}&container_type=Shixun` + const url = + `/discusses.json?page=${page-1}&container_identifier=${shixun && shixun.identifier ? + shixun.identifier : match.params.shixunId}&container_type=Shixun` + + this.setState({ + loadingComments: true, + }); + + // test + // if (true) { + if (false) { + var data = {"children_list":[{"id":1165,"content":"\u7535\u8111\u6ca1\u6709pi\u554a","time":"4\u5929\u524d","position":2,"user_id":31542,"reward":null,"image_url":"avatars/User/b","username":"\u8d75\u94f6\u7fd4","user_login":"p81572036","shixun_id":61,"hidden":false,"manager":false,"praise_count":0,"user_praise":false,"admin":false,"children":null},{"id":1142,"content":"\u6700\u540e\u4e00\u9898\u4e09\u5929\u6253\u9c7c\uff0c\u4e24\u5929\u6652\u7f51\uff0c\u4e0d\u5e94\u8be5\u662f1.01*1.01*1.01*0.99*0.99\uff0c\u800c\u4e0d\u662f\u52a0\u5417\uff1f","time":"4\u5929\u524d","position":1,"user_id":33714,"reward":null,"image_url":"avatars/User/b","username":"\u843d\u5c18","user_login":"p52769048","shixun_id":61,"hidden":false,"manager":false,"praise_count":0,"user_praise":false,"admin":false,"children":[{"content":"\u672c\u5173\u5e76\u6ca1\u6709\u5199\u5230\u201c1.01*1.01*1.01*0.99*0.99\u201d\uff0c\u4e0d\u77e5\u9053\u4f55\u6765\u6b64\u95ee\uff1f","time":"4\u5929\u524d","position":1,"reward":null,"image_url":"avatars/User/1","username":"Coder","user_id":1,"user_login":"innov","can_delete":false,"id":1144}]},{"id":1112,"content":"\u8fd9\u4e2a\u5b9e\u8bad\u5f88\u8d5e\uff01","time":"10\u5929\u524d","position":2,"user_id":12,"reward":null,"image_url":"avatars/User/12","username":"\u9ec4\u4e95\u6cc9","user_login":"Hjqreturn","shixun_id":61,"hidden":false,"manager":false,"praise_count":1,"user_praise":false,"admin":false,"children":null},{"id":1057,"content":"\u4e0d\u9519","time":"20\u5929\u524d","position":2,"user_id":30403,"reward":null,"image_url":"avatars/User/b","username":"Jimmy","user_login":"p69243850","shixun_id":61,"hidden":false,"manager":false,"praise_count":1,"user_praise":false,"admin":false,"children":null},{"id":975,"content":"q","time":"1\u4e2a\u6708\u524d","position":2,"user_id":30403,"reward":null,"image_url":"avatars/User/b","username":"Jimmy","user_login":"p69243850","shixun_id":61,"hidden":false,"manager":false,"praise_count":1,"user_praise":false,"admin":false,"children":[{"content":"\u4e0b\u6b21\u518d\u53d1\u65e0\u610f\u4e49\u7684\u5185\u5bb9\uff0c\u5c06\u88ab\u6263\u91d1\u5e01\u54e6","time":"1\u4e2a\u6708\u524d","position":2,"reward":null,"image_url":"avatars/User/1","username":"Coder","user_id":1,"user_login":"innov","can_delete":false,"id":980}]},{"id":974,"content":"k","time":"1\u4e2a\u6708\u524d","position":2,"user_id":30403,"reward":null,"image_url":"avatars/User/b","username":"Jimmy","user_login":"p69243850","shixun_id":61,"hidden":false,"manager":false,"praise_count":0,"user_praise":false,"admin":false,"children":[{"content":"\u4e0b\u6b21\u518d\u53d1\u65e0\u610f\u4e49\u7684\u5185\u5bb9\uff0c\u5c06\u88ab\u6263\u91d1\u5e01\u54e6","time":"1\u4e2a\u6708\u524d","position":2,"reward":null,"image_url":"avatars/User/1","username":"Coder","user_id":1,"user_login":"innov","can_delete":false,"id":981}]},{"id":859,"content":"\u5f88\u68d2\uff01\uff01\uff01","time":"1\u4e2a\u6708\u524d","position":4,"user_id":1,"reward":null,"image_url":"avatars/User/1","username":"Coder","user_login":"innov","shixun_id":61,"hidden":false,"manager":false,"praise_count":0,"user_praise":false,"admin":false,"children":null},{"id":802,"content":"\u4e0d\u9519\uff01","time":"2\u4e2a\u6708\u524d","position":1,"user_id":30403,"reward":null,"image_url":"avatars/User/b","username":"Jimmy","user_login":"p69243850","shixun_id":61,"hidden":false,"manager":false,"praise_count":1,"user_praise":false,"admin":false,"children":null},{"id":619,"content":"\u770b\u6765\u8001\u5e08\u5bf9\u9f50\u7528\u7684\u90fd\u662f\u7a7a\u683c","time":"5\u4e2a\u6708\u524d","position":3,"user_id":29145,"reward":null,"image_url":"avatars/User/b","username":"yang","user_login":"m02945638","shixun_id":61,"hidden":false,"manager":false,"praise_count":1,"user_praise":false,"admin":false,"children":null},{"id":553,"content":"

      \r\n\t666\r\n

      \r\n

      \r\n\t
      \r\n

      ","time":"6\u4e2a\u6708\u524d","position":4,"user_id":26838,"reward":null,"image_url":"avatars/User/b","username":"\u5189\u529b","user_login":"m54013296","shixun_id":61,"hidden":false,"manager":false,"praise_count":0,"user_praise":false,"admin":false,"children":null}],"disscuss_count":183} + + this.setState({ + comments: data.children_list, + comment_count_without_reply: data.disscuss_count, + + currentPage: page, + loadingComments: false, + }) + return; + } + + axios.get(url, + { + // withCredentials: true + } + ).then((response) => { + // test + + if (response.data) { + this.responseDataParse(response) + this.setState({ + comments: response.data.comments, + comment_count_without_reply: response.data.disscuss_count, + + currentPage: page, + loadingComments: false, + }, ()=>{ + // keditor代码美化 + window.prettyPrint() + }) + } + // console.log(response) + }).catch((error) => { + console.log(error) + }) + } + // 切换关卡时,清空state + clearCommentsInState = () => { + this.setState({ comments: [] }) + } + fetchCommentIfNotFetched() { + if (this.state.comments && this.state.comments.length) { + return; + } + + // http://localhost:3000/api/v1/shixuns/cz7yw3en/shixun_discusses?page=0 + + this.fetchComment(); + } + // 新增父级评论 + createNewComment() { + console.log('createNewComment...') + + const { challenge, shixun, showSnackbar } = this.props; + let content = window._commentInput.html(); + if (!content || content.length === 0) { + showSnackbar('必须填写内容!') + return; + } + + // const url = `/api/v1/discusses` + const url = `/discusses.json` + + if(content != undefined){ + var beforeImage = content.split(""); + if(beforeImage[0] == "" && afterImage[1] == ""){ + window.notice_box('不支持纯图片评论
      请在评论中增加文字信息'); + return; + } + } + + $("#new_message_submit_btn_" + this.props.challenge.shixun_id).hide(); + + if (content) { // 去掉尾部的回车换行 + content = content.replace(/(\n

      \n\t
      \n<\/p>)*$/g,''); + } + + axios.post(url, { + container_type: "Shixun", + container_id: shixun.id, + challenge_id: challenge.id, + content, + position: challenge.position + }, + { + // withCredentials: true + } + ).then((response) => { + if (response.data.discuss) { + + window._commentInput.html(''); + window._commentInput.afterBlur() + // this.setState({ + // runTesting: false, + // }) + this.fetchComment() + } + console.log(response) + }).catch((error) => { + console.log(error) + }) + return true; + } + _findCommentById(id, arg_comments) { + let comments; + if (!arg_comments) { + comments = this.state.comments; + } else { + comments = arg_comments; + } + for(let i = 0; i < comments.length; i++) { + if (id === comments[i].id) { + return i; + } + } + } + replyComment(commentContent, id, editor) { + // http://localhost:3000/api/v1/discusses/812/reply + const { challenge, shixun, user, showSnackbar, match } = this.props; + + if (!commentContent || commentContent.length === 0) { + showSnackbar('必须填写内容!') + return; + } + // const url = `/api/v1/discusses/${id}/reply` + const url = `/discusses/${id}/reply.json` + if (commentContent) { + commentContent = commentContent.replace(/(\n

      \n\t
      \n<\/p>)*$/g,''); + } + if (!user.login && user.user_url) { + const loginAr = user.user_url.split('/') + user.login = loginAr[loginAr.length - 1] + } + axios.post(url, { + content: commentContent, + // TODO + "container_id": match.params.shixunId, + "container_type": "Shixun", + }, + { + // withCredentials: true + } + ).then((response) => { + if (response.data.discuss) { + let newDiscuss = response.data.discuss; + let { comments } = this.state; + var commentIndex = this._findCommentById(id); + let comment = comments[commentIndex] + comment = Object.assign({}, comment) + if (!comment.children ) { + comment.children = [] + } else { + comment.children = comment.children.slice(0); + } + // TODO userName iamge_url + comment.children.push( { + "can_delete": true, + "content": commentContent, + + "image_url": user.image_url, + "username": user.username, + "user_login": user.login, + "id": newDiscuss.id, + "position": newDiscuss.position, + "time": "1分钟前", + "praise_count": newDiscuss.praise_count, + + "user_id": newDiscuss.user_id, + + }) + + comments = comments.slice(0) + comments[commentIndex] = comment + + // ke + editor.html && editor.html('') + // md + if (editor.setValue) { + editor.setValue('') + const $ = window.$ + var view_selector = `.commentItemMDEditorView_${id}` + $(view_selector).hide(); + } + + + this.setState({ + // runTesting: false, + comments: comments + }, ()=>{ + // keditor代码美化 + editor.html && window.prettyPrint() + }) + } + console.log(response) + }).catch((error) => { + console.log(error) + }) + } + hiddenComment(item, childCommentId) { + const id = item.id + const { challenge, shixun, user, showSnackbar, match } = this.props; + // const url = `/api/v1/discusses/${id}/hidden` + const url = `/discusses/${id}/hidden.json` + + const commentIndex = this._findCommentById(id); + const { comments } = this.state; + const comment = Object.assign({}, comments[commentIndex]); + axios.post(url, { + hidden: !comment.hidden ? "1" : "0", + container_identifier: match.params.shixunId || shixun.identifier + }, + { + // withCredentials: true + } + ).then((response) => { + if (response.data.status === -1) { + showSnackbar(response.data.message) + return; + } + if (response.data.status === 1) { + + if (!childCommentId) { + comment.hidden = !comment.hidden; + const commentsCopy = this.state.comments.slice(0) + commentsCopy[commentIndex] = comment + this.setState({ + comments: commentsCopy + }) + } else { // TODO 目前子回复没hidden字段 + let childCommentIndex = this._findCommentById(childCommentId, comments[commentIndex].children); + const childComment = comments[commentIndex].children[childCommentIndex] + childComment.hidden = !childComment.hidden; + this.setState({ comments }) + } + + } + // {"message":"Couldn't find Discuss with id=911","status":-1} + console.log(response) + }).catch((error) => { + console.log(error) + }) + } + deleteComment(parrentComment, childCommentId) { + const { challenge, shixun } = this.props; + let deleteCommentId = parrentComment.id + if (childCommentId) { + deleteCommentId = childCommentId; + } + // const url = `/api/v1/discusses/${deleteCommentId}` + const url = `/discusses/${deleteCommentId}.json` + + axios.delete(url, + { + // withCredentials: true + } + ).then((response) => { + // TODO 删除成功或失败 + if (response.data && response.data.status === 1) { + const commentIndex = this._findCommentById(parrentComment.id); + + // https://stackoverflow.com/questions/29527385/removing-element-from-array-in-component-state + if (!childCommentId) { + this.setState((prevState) => ({ + comments: update(prevState.comments, {$splice: [[commentIndex, 1]]}) + })) + + if (this.state.comments.length <= 5) { + this.fetchComment() + } + } else { + let comments = this.state.comments; + let newComments = Object.assign({}, comments) + let childCommentIndex = this._findCommentById(childCommentId, newComments[commentIndex].children); + newComments[commentIndex].children = update(newComments[commentIndex].children, {$splice: [[childCommentIndex, 1]]}) + this.setState({ newComments }) + } + } + console.log(response) + }).catch((error) => { + console.log(error) + }) + } + + rewardCode(parrentComment, childComment, amount) { + const { challenge, shixun, showSnackbar } = this.props; + let handleComment = parrentComment + if (childComment) { + handleComment = childComment; + } + let handleCommentId = handleComment.id; + // const url = `/api/v1/discusses/${handleCommentId}/reward_code` + const url = `/discusses/${handleCommentId}/reward_code.json` + + axios.post(url, { + // id: handleCommentId, + + // container_id: shixun.id, + container_type: 'Discusses', + score: amount, + user_id: handleComment.user_id + }, + { + // withCredentials: true + } + ).then((response) => { + if (response.data && response.data.code) { + const commentIndex = this._findCommentById(parrentComment.id); + let { comments } = this.state; + const newComments = comments.slice(0) + + if (childComment) { + const childCommentIndex = this._findCommentById(handleComment.id, parrentComment.children); + const newChildComment = Object.assign({}, childComment); + newChildComment.reward = response.data.code + parrentComment = Object.assign({}, parrentComment) + parrentComment.children = parrentComment.children.slice(0) + parrentComment.children[childCommentIndex] = newChildComment + + newComments[commentIndex] = parrentComment; + + + } else { + const newComment = Object.assign({}, newComments[commentIndex]); + newComment.reward = response.data.code; + newComments[commentIndex] = newComment; + } + this.setState({ + comments: newComments + }) + } + }).catch((error) => { + console.log(error) + showSnackbar('奖励失败,请联系系统管理员!') + }) + } + + // 评论点赞 + commentPraise(discussId) { + const commentIndex = this._findCommentById(discussId); + const { comments } = this.state; + + const { challenge } = this.props; + // const url = `/api/v1/discusses/${discussId}/plus` + const url = `/discusses/${discussId}/plus.json` + axios.post(url, { + // id: discussId, + // container_id: challenge.id, + container_type: 'Discuss', //Discuss + type: comments[commentIndex].user_praise === true ? 0 : 1, // "踩0;赞1" + }, + { + // withCredentials: true + } + ).then((response) => { + if (response.data.praise_count === 0 || response.data.praise_count) { + const newComments = comments.slice(0) + const comment = Object.assign({}, newComments[commentIndex]) + comment.user_praise = !comment.user_praise; + comment.praise_count = response.data.praise_count; + newComments[commentIndex] = comment; + this.setState({ + comments: newComments + }) + } + console.log(response) + }).catch((error) => { + console.log(error) + }) + } + + newMessage() { + return; // newMessage 暂时不用了 + const { shixun, myshixun } = this.props; + const url = `/api/v1/shixuns/${shixun.id}/new_message?container_type=Shixun&myshixun_id=${myshixun.id}` + // this.setState({ + // gotNewReply: true + // }) + axios.get(url, + { + // withCredentials: true + } + ).then((response) => { + const new_message = response.data.new_message; + if (response.data.new_message) { + this.setState({ + gotNewReply: new_message + }) + } + // console.log(response) + }).catch((error) => { + console.log(error) + }) + } + + showNewReply() { + const { shixun, myshixun } = this.props; + const commentId = 929 // TODO + const url = `/api/v1/shixuns/${shixun.id}/anchor?container_type=Shixun&myshixun_id=${myshixun.id}&discuss_id=${commentId}` + + this.setState({ + loadingComments: true, + gotNewReply: false, + + }); + axios.get(url, + { + // withCredentials: true + } + ).then((response) => { + const data = response.data; + const new_message = data.new_message; + + this.setState({ + comments: data.children_list, + comment_count_without_reply: data.disscuss_count, + + currentPage: data.page, + loadingComments: false, + + }, () => { + if (response.data.find_status) { // 没找到评论的话,默认会返回第一页的评论 + const comment_J = window.$(`#reply_content_${commentId}`); + if (comment_J.length) { + comment_J[0].scrollIntoView() + comment_J.parents('.comment_item_cont').css('border', '1px solid #4CACFF') + } + } + }) + console.log(response) + }).catch((error) => { + console.log(error) + }) + } + + // ----------------------------------------------------------------------------------------------评论 End + + // ----------------------------------------------------------------------------------------------评论 End + + componentDidMount() { + // commentsDelegateParent #game_left_contents #tab_con_4 + $(".commentsDelegateParent") + .delegate(".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click", (event) => { + + const imageSrc = event.target.src + // 非回复里的头像图片; 非emoticons + if (imageSrc.indexOf('/images/avatars/User') === -1 && + imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { + this.setState({ + showImage: true, + imageSrc, + }) + } + }); + } + onImageLayerClose = () => { + this.setState({ + showImage: false, + imageSrc: '', + }) + } + + showNotification = (description, message = "提示", icon) => { + const data = { + message, + description + } + if (icon) { + data.icon = icon; + } + notification.open(data); + } + render() { + return ( + + + + + + + ) + } + } +} +/* +

      +

      + HOC Debugger Component +

      +

      + Props +

      +
      {stringify(this.props)}
      +

      + State +

      +
      {stringify(this.state)}
      + {super.render()} +
      + */ \ No newline at end of file diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index 097d55053..c3e579872 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -1,5 +1,5 @@ import React,{ Component } from "react"; -import { Modal,Checkbox,Input, Spin, Icon } from "antd"; +import { Modal,Checkbox,Input, Spin, Icon,notification } from "antd"; import axios from 'axios'; import Modals from '../../modals/Modals'; const CheckboxGroup = Checkbox.Group; @@ -187,15 +187,26 @@ class Addcourses extends Component{ if(response.data.course_id!=undefined){ this.submitasyn(response.data.course_id) } + notification.open({ + message:"提示", + description:response.data.message + }); this.props.hideAddcoursestype(); - this.props.showNotification(response.data.message); + // this.props.showNotification(response.data.message); + }else{ - this.setState({ - Addcoursestype:false - }) + + notification.open({ + message:"提示", + description:response.data.message + }); + this.setState({ + Addcoursestype:false + }) this.props.hideAddcoursestype(); - this.props.showNotification(response.data.message); + + // this.setState({ // loadtype:true, // modalsType:true, diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index 5ba33032c..0dfbed1ab 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -222,6 +222,8 @@ class Testpapersettinghomepage extends Component{ : 答题列表 + {Commonheadofthetestpaper&&Commonheadofthetestpaper.show_statistic===true? + 统计结果:""} 设置 } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js index 3c9202921..660ef1c71 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js @@ -33,7 +33,7 @@ class GraduationTasksedit extends Component{ componentDidMount(){ - + let {title_num}=this.state; let tasksid=this.props.match.params.category_id; let url ="/graduation_tasks/"+tasksid+"/edit.json" @@ -52,15 +52,18 @@ class GraduationTasksedit extends Component{ } } - + let namelength=result.data.task_name.length; + let sixlength=title_num-namelength this.setState({ fileList:newfilelist, description:result.data.description, tasktype:result.data.task_type, name:result.data.task_name, data:result.data, + title_num:sixlength }) + this.props.form.setFieldsValue({ tasktype:result.data.task_type, name:result.data.task_name, diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index b5c34e975..6b5930bc2 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -1168,7 +1168,8 @@ class GraduationTaskssettingapp extends Component{ value={end_time===null||end_time===""?"":moment(end_time, dateFormat)} onChange={this.onChangeTimeend} disabledTime={disabledDateTime} - disabled={this.props.isSuperAdmin()===true?flagPageEdit===true?false:true:this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true} + // disabled={this.props.isSuperAdmin()===true?flagPageEdit===true?false:true:this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true} + disabled={this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true} className={this.state.endTimetypes===true||end_timetype===true?"noticeTip":""} /> @@ -1251,7 +1252,8 @@ class GraduationTaskssettingapp extends Component{
      评分设置
      最终成绩组成 (取各教师最终评分的平均分)
      - 启用交叉评阅 (给老师分配其他指导老师的学生作品) + 启用交叉评阅 (给老师分配其他指导老师的学生作品) {crosscomment===true?
      diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 1433319b3..2d205001e 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -800,55 +800,62 @@ class GraduationTaskssettinglist extends Component{ let category_id=this.props.match.params.category_id; let task_Id = this.props.match.params.task_Id; + if(this.props.isStudent()===true){ + + columns.some((item,key)=> { + if (item.title === "学号") { + columns.splice(key, 1) + return true + } + } + ) + + } if(taskslistdata&&taskslistdata.course_group_count<=0){ - //分班有显示 - columns.map((item,key)=>{ - if(item.title==="分班"){ - columns.splice(key,1) + columns.some((item,key)=> { + if (item.title === "分班") { + columns.splice(key, 1) + return true + } } - }) + ) } if(taskslistdata&&taskslistdata.cross_comment===false){ - columns.map((item,key)=>{ - if(item.title==="交叉评分"){ - columns.splice(key,1) + columns.some((item,key)=> { + if (item.title === "交叉评分") { + columns.splice(key, 1) + return true + } + } + ) + + } + + if(taskslistdata&&taskslistdata.have_grouping===false){ + + columns.some((item,key)=> { + if (item.title === "关联项目") { + columns.splice(key, 1) + return true } - }) + } + ) - if(taskslistdata&&taskslistdata.have_grouping===false){ - columns.map((item,key)=>{ - if(item.title==="关联项目"){ - columns.splice(key,1) - } - }) - columns.map((item,key)=>{ - if(item.title==="分组"){ - columns.splice(key,1) - } - }) - } - - }else{ - if(taskslistdata&&taskslistdata.have_grouping===false){ - columns.map((item,key)=>{ - if(item.title==="关联项目"){ - columns.splice(key,1) - } - }) + columns.some((item,key)=> { + if (item.title === "分组") { + columns.splice(key, 1) + return true + } + } + ) - columns.map((item,key)=>{ - if(item.title==="分组"){ - columns.splice(key,1) - } - }) - } - } + } return( @@ -1018,8 +1025,8 @@ class GraduationTaskssettinglist extends Component{ {this.props.isAdmin()?
    • 导出
    • :""} diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index ea368d478..c7ae7292d 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -3,6 +3,7 @@ import CoursesListType from '../coursesPublic/CoursesListType'; import {WordsBtn,ActionBtn} from 'educoder'; import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal'; import HomeworkModal from "../coursesPublic/HomeworkModal"; +import NoneData from '../coursesPublic/NoneData' import { Form, Select, @@ -93,23 +94,27 @@ class ShixunStudentWork extends Component { let url = "/homework_commons/" + homeworkid + "/code_review_results.json"; axios.get(url).then((response) => { + debugger if (response.data.status === undefined || response.data.status === 0) { if(response.data!=undefined){ - let datas=[]; - let list=response.data.users_reviews; - for(var i=0; i { if (response.data.status === undefined || response.data.status === 0) { if(response.data!=undefined){ - let datas=[]; - let list=response.data.users_reviews; - for(var i=0; i { + if (item.title === "学号") { + columns.splice(key, 1) + return true + } + } + ) + + } + return (
      {this.state.showmodel===true? - {data&&data?

      @@ -554,10 +573,10 @@ class ShixunStudentWork extends Component {

      - {data.homework_name} + {data&&data.homework_name}

      返回 @@ -593,10 +612,10 @@ class ShixunStudentWork extends Component { href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`} >导出 : ""} {this.props.isAdmin()? - data.end_immediately===true? + data&&data.end_immediately===true? 立即截止 : "" : ""} {this.props.isAdmin()? - data.publish_immediately===true? + data&&data.publish_immediately===true? 立即发布 : "" : ""} {/*{this.props.isAdmin()?*/} @@ -623,10 +642,11 @@ class ShixunStudentWork extends Component { `} -
    • +
    • 正在执行查重,请稍后刷新页面查看结果 温馨提示:执行时间因查重作品数以及作品的代码量而异 +
    • + {data&&data? +
      • @@ -742,9 +764,9 @@ class ShixunStudentWork extends Component { />}
      -
      +
      :""} -
      :""} +
      diff --git a/public/react/src/modules/tpm/SiderBar.js b/public/react/src/modules/tpm/SiderBar.js index b0b029b45..f8af121e1 100644 --- a/public/react/src/modules/tpm/SiderBar.js +++ b/public/react/src/modules/tpm/SiderBar.js @@ -95,7 +95,7 @@ class SiderBar extends Component {
      From 9832ae4c4c747946a763c3f0c9a10a5737b29225 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 16:14:40 +0800 Subject: [PATCH 35/39] =?UTF-8?q?=E5=85=A8=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/members/teacherList.js | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index 10e646590..35ef28bca 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -89,10 +89,20 @@ function buildColumns(that) {

      ): '' } + {course_groups && course_groups.length > 1 &&
    • + {/* 防止被外面group包裹 */} + + that.onCheckAllChange(e, item, index)} onChange={() => {}} + >全选 + +
    • } that.joinCourseGroup(checkedValues, item, index)} value={arg_course_groups.map(item => item.id)} disabled={!isAdminOrCreator} > + { course_groups && course_groups.filter((item) => { return (!that.state.groupSearchValue || item.name.indexOf(that.state.groupSearchValue) != -1) @@ -165,7 +175,7 @@ function buildColumns(that) { dataIndex: 'course_member_id', key: 'course_member_id', render: (content, item, index) => { - return + return content ? : '' } }) } @@ -190,7 +200,20 @@ class studentsList extends Component{ teachers: [], checkBoxValues: [], isSpin:false, - application_list: [] + application_list: [], + checkAllArray: [] + } + } + onCheckAllChange = (e, item, index) => { + const that = this; + debugger; + const checkAllArray = that.state.checkAllArray.slice(0) + checkAllArray[index] = !checkAllArray[index] + that.setState({checkAllArray}) + if (checkAllArray[index]) { + that.joinCourseGroup(that.state.course_groups.map((item) => item.id), item, index) + } else { + that.joinCourseGroup([], item, index) } } inputSearch=(e)=>{ From 5f1d34b1ff06b39943a8e5889243791c70f2ab64 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 16:20:25 +0800 Subject: [PATCH 36/39] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E7=8F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/members/teacherList.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index 35ef28bca..c5422b96f 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -117,6 +117,11 @@ function buildColumns(that) { ) }) } +

      + trigger('groupAdd', that.props.coursesids)} + >添加分班... +

      } } From 2ab6e4d874a86bde1fc2c316a65618c0b0e24384 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 16:28:00 +0800 Subject: [PATCH 37/39] =?UTF-8?q?=E5=B7=B2=E5=8A=A0=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/members/modal/AddStudentModal.js | 6 ++++-- .../src/modules/courses/members/modal/AddTeacherModal.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/members/modal/AddStudentModal.js b/public/react/src/modules/courses/members/modal/AddStudentModal.js index 0b747171d..cb40c1983 100644 --- a/public/react/src/modules/courses/members/modal/AddStudentModal.js +++ b/public/react/src/modules/courses/members/modal/AddStudentModal.js @@ -221,7 +221,8 @@ class AddStudentModal extends Component{ - + +

      @@ -252,7 +253,8 @@ class AddStudentModal extends Component{ - + +

      ) diff --git a/public/react/src/modules/courses/members/modal/AddTeacherModal.js b/public/react/src/modules/courses/members/modal/AddTeacherModal.js index 21bfdbc8c..268238d98 100644 --- a/public/react/src/modules/courses/members/modal/AddTeacherModal.js +++ b/public/react/src/modules/courses/members/modal/AddTeacherModal.js @@ -292,7 +292,8 @@ class AddTeacherModal extends Component{ - + +

      { candidates && candidates.length ?
      @@ -322,7 +323,8 @@ class AddTeacherModal extends Component{ - + +

      ) From 193c9a2576223567622d953c90bd32f97bd52ef9 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 16:31:01 +0800 Subject: [PATCH 38/39] isAdminOrStudent --- public/react/src/modules/courses/busyWork/CommonWorkList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 46d06e300..30bc37d88 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -93,7 +93,7 @@ function buildColumns(that, student_works) {
      ), }] - if (!niPingAndIsStudent) { + if (!niPingAndIsStudent && isAdminOrStudent) { columns.push({ width: 88, title: '学号', From 7f57b5339788b6f4b8359dca2474ef21c5f29e89 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 29 Jun 2019 16:34:49 +0800 Subject: [PATCH 39/39] =?UTF-8?q?=E5=AD=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/members/studentsList.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 669d8a65d..63ae5683a 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -80,6 +80,15 @@ const buildColumns = (that) => { width:"50%", className:"color-grey-6" }]; + const isAdminOrStudent = that.props.isAdminOrStudent() + if (!isAdminOrStudent) { + columns.some((item,key)=> { + if (item.title === "学号") { + columns.splice(key, 1) + return true + } + }) + } const isAdmin = that.props.isAdmin() if (isAdmin) { columns.unshift({