diff --git a/public/images/edu_user/EWM.jpg b/public/images/educoder/EWM.jpg similarity index 100% rename from public/images/edu_user/EWM.jpg rename to public/images/educoder/EWM.jpg 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 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/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') : '--'} ), }]) diff --git a/public/react/src/modules/courses/busyWork/reply/CommonWorkAppraiseReply.js b/public/react/src/modules/courses/busyWork/reply/CommonWorkAppraiseReply.js index c41f888ca..146511712 100644 --- a/public/react/src/modules/courses/busyWork/reply/CommonWorkAppraiseReply.js +++ b/public/react/src/modules/courses/busyWork/reply/CommonWorkAppraiseReply.js @@ -205,6 +205,7 @@ class CommonWorkAppraiseReply extends Component{ const isAdmin = this.props.isAdmin() const isNiPing = homework_status && homework_status.indexOf('匿评中') != -1 + const isGroup = this.props.isGroup() /** isAdmin || 评阅入口:超级管理员、老师和助教显示; -》 改成admin也不显示 匿评人:匿评期间显示 @@ -276,6 +277,7 @@ class CommonWorkAppraiseReply extends Component{ showModulationtype={this.showModulationtype} addSuccess={this.addSuccess} ref={this.editorRef} totalCount={comment_scores.length} onReply={this.onReply} placeholder={"请在此输入对本作品的评语,最大限制2000个字符"} + showSameScore={isGroup} > } {/* ${!!comment_scores.length ? 'bor-bottom-greyE' : ''} */} diff --git a/public/react/src/modules/courses/common/comments/CCommentItem.js b/public/react/src/modules/courses/common/comments/CCommentItem.js index e4286e456..183ef6ea5 100644 --- a/public/react/src/modules/courses/common/comments/CCommentItem.js +++ b/public/react/src/modules/courses/common/comments/CCommentItem.js @@ -329,7 +329,7 @@ class CCommentItem extends Component{
} - {!_content && {"暂未写评语"}} + {!_content && {"暂未写评语"}}
{attachments && attachments.map((attaItem, key)=>{ return( diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 3389951f5..cc3646b9d 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -458,7 +458,7 @@ class CoursesBanner extends Component { { ` .teachersbox{ - margin-right:28px !important; + margin-right:22px !important; } ` } diff --git a/public/react/src/modules/courses/coursesPublic/AccessoryModal.js b/public/react/src/modules/courses/coursesPublic/AccessoryModal.js index 5baf4e0c6..26d4499aa 100644 --- a/public/react/src/modules/courses/coursesPublic/AccessoryModal.js +++ b/public/react/src/modules/courses/coursesPublic/AccessoryModal.js @@ -1,5 +1,5 @@ import React,{ Component } from "react"; -import { Modal,Checkbox,Upload,Button,Icon,message} from "antd"; +import { Modal,Checkbox,Upload,Button,Icon,message,notification} from "antd"; import { WordsBtn,getUrl, getUploadActionUrl} from 'educoder'; import axios from 'axios'; import Modals from '../../modals/Modals'; @@ -110,6 +110,7 @@ class AccessoryModal extends Component{ this.props.Cancel() } Saves=()=>{ + let id=this.props.categoryid; let {fileList,description} =this.state; @@ -131,10 +132,12 @@ class AccessoryModal extends Component{ description:description, attachment_ids:newfileList }).then((result)=>{ - console.log(result) - if(result !== undefined){ - this.props.setupdate() - this.props.showNotification('提交成功') + + if(result.data.status===0){ + debugger + this.props.Cancel() + this.props.setupdate() + // this.setState({ // Modalstype:true, // Modalstopval:result.data.message, @@ -142,9 +145,16 @@ class AccessoryModal extends Component{ // loadtype:true // }) this.ModalCancelModalCancel() + + notification.open({ + message: '提示', + description: + '提交成功' + }); if(this.props.seeworks!=undefined){ this.props.history.push(this.props.seeworks); } + } }).catch((error)=>{ @@ -170,10 +180,12 @@ class AccessoryModal extends Component{ description:description, attachment_ids:newfileList }).then((result)=>{ - console.log(result) + if(result.data.status===0){ + debugger + this.props.Cancel() this.props.setupdate() - this.props.showNotification('提交成功') + // this.setState({ // Modalstype:true, // Modalstopval:result.data.message, @@ -182,9 +194,15 @@ class AccessoryModal extends Component{ // }) this.ModalCancelModalCancel() + notification.open({ + message: '提示', + description: + '提交成功' + }); if(this.props.seeworks!=undefined){ this.props.history.push(this.props.seeworks); } + } }).catch((error)=>{ diff --git a/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js b/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js index 0cd48c245..14b1f71e1 100644 --- a/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js +++ b/public/react/src/modules/courses/coursesPublic/AccessoryModal2.js @@ -1,262 +1,263 @@ -import React,{ Component } from "react"; -import { Modal,Checkbox,Upload,Button,Icon,message} from "antd"; -import { WordsBtn, getUploadActionUrl} from 'educoder'; -import axios from 'axios'; -import Modals from '../../modals/Modals'; -const CheckboxGroup = Checkbox.Group; - -class AccessoryModal2 extends Component{ - constructor(props){ - super(props); - this.state={ - group_ids:[], - fileList:[], - Modalstype:false, - Modalstopval:"", - ModalCancel:"", - ModalSave:"", - loadtype:false - } - } - - - componentDidMount() { - - } - - //勾选实训 - shixunhomeworkedit=(list)=>{ - - this.setState({ - group_ids:list - }) - - } - // 附件相关 START - handleChange = (info) => { - let fileList = info.fileList; - console.log(fileList) - // for(var list of fileList ){ - // console.log(fileList) - // } - this.setState({ fileList }); - } - - onAttachmentRemove = (file) => { - // confirm({ - // title: '确定要删除这个附件吗?', - // okText: '确定', - // cancelText: '取消', - // // content: 'Some descriptions', - // onOk: () => { - // this.deleteAttachment(file) - // }, - // onCancel() { - // console.log('Cancel'); - // }, - // }); - // return false; - - // this.setState({ - // Modalstype:true, - // Modalstopval:'确定要删除这个附件吗?', - // ModalSave: ()=>this.deleteAttachment(file), - // ModalCancel:this.cancelAttachment - // }) - // return false; - - this.deleteAttachment(file); - } - - - - - 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 (status == 0) { - console.log('--- success') - - 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); - }); - } - - ModalCancelModalCancel=()=>{ - this.setState({ - Modalstype:false, - Modalstopval:"", - ModalSave:this.ModalCancelModalCancel, - loadtype:false - }) - this.props.Cancel() - } - componentDidUpdate = (prevProps) => { - if (JSON.stringify(prevProps.fileList) != JSON.stringify(this.props.fileList)) { - this.setState({ - fileList: this.props.fileList - }) - } - if (prevProps.description != this.props.description) { - this.setState({ - description: this.props.description - }) - } - } - Saves=()=>{ - let {fileList,description} =this.state; - let newfileList=[]; - for(var list of fileList){ - newfileList.push(list.response.id) - } - this.props.Saves && this.props.Saves(newfileList, description) - return; - let id=this.props.categoryid; - - console.log(newfileList) - let url="/graduation_works/"+id+"/revise_attachment.json" - axios.post(url,{ - description:description, - attachment_ids:newfileList - }).then((result)=>{ - console.log(result) - if(result.data.status===0){ - this.props.setupdate() - this.setState({ - Modalstype:true, - Modalstopval:result.data.message, - ModalSave:this.ModalCancelModalCancel, - loadtype:true - }) - - } - }).catch((error)=>{ - - }) - } - - settextarea=(e)=>{ - this.setState({ - description:e.target.value - }) - } - - render(){ - let {description,fileList, - Modalstype, - Modalstopval, - ModalCancel, - ModalSave, - loadtype, - }=this.state; - let {course_groups}=this.props; - const uploadProps = { - width: 600, - // https://github.com/ant-design/ant-design/issues/15505 - // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - // showUploadList: false, - action: getUploadActionUrl(), - onChange: this.handleChange, - onRemove: this.onAttachmentRemove, - beforeUpload: (file) => { - console.log('beforeUpload', file.name); - const isLt150M = file.size / 1024 / 1024 < 150; - if (!isLt150M) { - message.error('文件大小必须小于150MB!'); - } - return isLt150M; - }, - }; - - - return( -
- {/*提示*/} - - -
-

- - -

- - - -

- - - (单个文件最大150M) - -

- - - - - -
-
-
- ) - } -} +import React,{ Component } from "react"; +import { Modal,Checkbox,Upload,Button,Icon,message} from "antd"; +import { WordsBtn, getUploadActionUrl} from 'educoder'; +import axios from 'axios'; +import Modals from '../../modals/Modals'; +const CheckboxGroup = Checkbox.Group; + +class AccessoryModal2 extends Component{ + constructor(props){ + super(props); + this.state={ + group_ids:[], + fileList:[], + Modalstype:false, + Modalstopval:"", + ModalCancel:"", + ModalSave:"", + loadtype:false + } + } + + + componentDidMount() { + + } + + //勾选实训 + shixunhomeworkedit=(list)=>{ + + this.setState({ + group_ids:list + }) + + } + // 附件相关 START + handleChange = (info) => { + let fileList = info.fileList; + console.log(fileList) + // for(var list of fileList ){ + // console.log(fileList) + // } + this.setState({ fileList }); + } + + onAttachmentRemove = (file) => { + // confirm({ + // title: '确定要删除这个附件吗?', + // okText: '确定', + // cancelText: '取消', + // // content: 'Some descriptions', + // onOk: () => { + // this.deleteAttachment(file) + // }, + // onCancel() { + // console.log('Cancel'); + // }, + // }); + // return false; + + // this.setState({ + // Modalstype:true, + // Modalstopval:'确定要删除这个附件吗?', + // ModalSave: ()=>this.deleteAttachment(file), + // ModalCancel:this.cancelAttachment + // }) + // return false; + + this.deleteAttachment(file); + } + + + + + 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 (status == 0) { + console.log('--- success') + + 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); + }); + } + + ModalCancelModalCancel=()=>{ + this.setState({ + Modalstype:false, + Modalstopval:"", + ModalSave:this.ModalCancelModalCancel, + loadtype:false + }) + this.props.Cancel() + } + componentDidUpdate = (prevProps) => { + if (JSON.stringify(prevProps.fileList) != JSON.stringify(this.props.fileList)) { + this.setState({ + fileList: this.props.fileList + }) + } + if (prevProps.description != this.props.description) { + this.setState({ + description: this.props.description + }) + } + } + Saves=()=>{ + debugger + let {fileList,description} =this.state; + let newfileList=[]; + for(var list of fileList){ + newfileList.push(list.response.id) + } + this.props.Saves && this.props.Saves(newfileList, description) + return; + let id=this.props.categoryid; + + console.log(newfileList) + let url="/graduation_works/"+id+"/revise_attachment.json" + axios.post(url,{ + description:description, + attachment_ids:newfileList + }).then((result)=>{ + console.log(result) + if(result.data.status===0){ + this.props.setupdate() + this.setState({ + Modalstype:true, + Modalstopval:result.data.message, + ModalSave:this.ModalCancelModalCancel, + loadtype:true + }) + + } + }).catch((error)=>{ + + }) + } + + settextarea=(e)=>{ + this.setState({ + description:e.target.value + }) + } + + render(){ + let {description,fileList, + Modalstype, + Modalstopval, + ModalCancel, + ModalSave, + loadtype, + }=this.state; + let {course_groups}=this.props; + const uploadProps = { + width: 600, + // https://github.com/ant-design/ant-design/issues/15505 + // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 + // showUploadList: false, + action: getUploadActionUrl(), + onChange: this.handleChange, + onRemove: this.onAttachmentRemove, + beforeUpload: (file) => { + console.log('beforeUpload', file.name); + const isLt150M = file.size / 1024 / 1024 < 150; + if (!isLt150M) { + message.error('文件大小必须小于150MB!'); + } + return isLt150M; + }, + }; + + + return( +
+ {/*提示*/} + + +
+

+ + +

+ + + +

+ + + (单个文件最大150M) + +

+ + + + + +
+
+
+ ) + } +} export default AccessoryModal2; \ No newline at end of file diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js index 70df3f577..afa0669d4 100644 --- a/public/react/src/modules/courses/exercise/ExerciseListItem.js +++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js @@ -193,9 +193,9 @@ class ExerciseListItem extends Component{ { IsStudent &&
- {item.current_status ===0&&item.exercise_status>1?
  • 继续答题
  • : - item.current_status ===1&&item.exercise_status>1?
  • 查看答题
  • : - item.current_status ===2&&item.exercise_status>1?
  • this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题
  • :""} + {item.current_status ===0&&item.exercise_status>1?
  • 继续答题
  • : + item.current_status ===1&&item.exercise_status>1?
  • 查看答题
  • : + item.current_status ===2&&item.exercise_status>1?
  • this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题
  • :""}
    }
    diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index ce9c00a21..b9da3f2eb 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -690,7 +690,7 @@ class ExerciseReviewAndAnswer extends Component{ } { //(老师身份且除实训题外) || (学生身份且试卷已经截止)就显示用户当前题目所得分数 - ( isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 ? + ( isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 && item.user_score ? {item.user_score} diff --git a/public/react/src/modules/courses/exercise/new/JudgeEditor.js b/public/react/src/modules/courses/exercise/new/JudgeEditor.js index 2d6b20398..a5571aab4 100644 --- a/public/react/src/modules/courses/exercise/new/JudgeEditor.js +++ b/public/react/src/modules/courses/exercise/new/JudgeEditor.js @@ -189,8 +189,9 @@ class SingleEditor extends Component{
    - - + {/* disabled={exerciseIsPublish} */} + + {/* not work */} {/* this.onOptionClick(0)} disabled={exerciseIsPublish}>对 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/exercise/new/SingleEditor.js b/public/react/src/modules/courses/exercise/new/SingleEditor.js index 6120e9aea..8cbcdec06 100644 --- a/public/react/src/modules/courses/exercise/new/SingleEditor.js +++ b/public/react/src/modules/courses/exercise/new/SingleEditor.js @@ -165,9 +165,9 @@ class SingleEditor extends Component{ } onOptionClick = (index) => { - if (this.props.exerciseIsPublish) { - return; - } + // if (this.props.exerciseIsPublish) { + // return; + // } let standard_answers = this.state.standard_answers.slice(0) standard_answers[index] = !standard_answers[index] this.setState({ standard_answers }) @@ -247,7 +247,7 @@ class SingleEditor extends Component{ {/* */} this.onOptionClick(index)} style={{flex: '0 0 38px'}}> - +
    {tagArray[index]}
    diff --git a/public/react/src/modules/courses/exercise/question/multiple.js b/public/react/src/modules/courses/exercise/question/multiple.js index 939122a48..bfb90ca9b 100644 --- a/public/react/src/modules/courses/exercise/question/multiple.js +++ b/public/react/src/modules/courses/exercise/question/multiple.js @@ -46,9 +46,9 @@ class Multiple extends Component{ { questionType.question_choices && questionType.question_choices.map((item,key)=>{ return( -

    +

    - {tagArray[key]}. + {tagArray[key]}.

    ) }) diff --git a/public/react/src/modules/courses/exercise/question/simpleAnswer.js b/public/react/src/modules/courses/exercise/question/simpleAnswer.js index 773c93708..240f775c2 100644 --- a/public/react/src/modules/courses/exercise/question/simpleAnswer.js +++ b/public/react/src/modules/courses/exercise/question/simpleAnswer.js @@ -54,7 +54,7 @@ class simpleAnswer extends Component{
  • { user_exercise_status == 1 ? -
    0 ? questionType.user_answer[0]:"")}}>
    +
    0 ? questionType.user_answer[0]:"")}}>
    :
    0 ? questionType.user_answer[0]:''} mdID={'simpleEditor'+questionType.question_id} placeholder="请输入你的答案" @@ -69,9 +69,9 @@ class simpleAnswer extends Component{ { exercise.answer_status == 1 || questionType.a_flag ?
    -

    参考答案:

    -
  • -

    this.showAndHide(false)}>隐藏参考答案

    +

    参考答案:

    +
  • +

    this.showAndHide(false)}>隐藏参考答案

    : this.showAndHide(true)}>显示参考答案 @@ -82,7 +82,7 @@ class simpleAnswer extends Component{ isStudent && exercise.answer_open==true && exercise.exercise_status == 3 ?

    参考答案:

    -
  • +
  • :"" } diff --git a/public/react/src/modules/courses/exercise/question/single.js b/public/react/src/modules/courses/exercise/question/single.js index d5e9bbb7a..85344729d 100644 --- a/public/react/src/modules/courses/exercise/question/single.js +++ b/public/react/src/modules/courses/exercise/question/single.js @@ -41,9 +41,9 @@ class single extends Component{ { questionType.question_choices && questionType.question_choices.map((item,key)=>{ return( -

    +

    - {tagArray[key]}. + {tagArray[key]}.

    ) }) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js index 1fe0e5c9b..2cbf0fe33 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js @@ -178,6 +178,7 @@ class GraduateTaskItem extends Component{ funlist={this.props.funlist} />:""} {this.state.visibles===true? { const { score, same_score } = this.state let category_id= this.props.match.params.category_id; - const url = this.props.replyUrl || `/graduation_works/${category_id}/add_score.json` + const url = `/graduation_works/${category_id}/add_score.json` const attachment_ids = this.state.fileList.map(item => { return item.response ? item.response.id : item.id }) @@ -153,7 +153,7 @@ class GraduationTasksappraiseMainEditor extends Component{ } render(){ let { total_count, comments, pageCount, fileList, score, same_score, errorMessage, numberErrorMessage } = this.state - const { current_user, memo, task_type, placeholder } = this.props + const { current_user, memo, showSameScore, placeholder } = this.props const isAdmin = this.props.isAdmin() const commentUploadProp = { width: 600, @@ -205,7 +205,7 @@ class GraduationTasksappraiseMainEditor extends Component{ {this.props.title && {this.props.title}} - { task_type == 2 &&
    + { showSameScore == true &&
    整组同评 (选中,则本次评阅对象指小组全部成员,否则仅评阅此成员1人 )
    } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js index 345a9874d..83d42f9fc 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js @@ -76,7 +76,8 @@ class GraduationTasksappraiseReplyChild extends Component{
    } {this.props.ultimate===true ? "": isAdmin && this.props.addSuccess()} + addSuccess={() => this.props.addSuccess()} + showSameScore={true} > } 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: "请选择任务类型"}], })(
    @@ -48,12 +48,14 @@ class Graduationtaskitem extends Component{
    -
    + {!!_content &&
    -
    +
    } + {!_content && {"暂未写评语"}} +
    {(item && item.children && item.children.length) ?
    : ''} {this.renderChildenComments(item)} 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..669d8a65d 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()} >添加分班...

    + } } diff --git a/public/react/src/modules/courses/poll/pollStyle.css b/public/react/src/modules/courses/poll/pollStyle.css index c66e45520..ffe13eb10 100644 --- a/public/react/src/modules/courses/poll/pollStyle.css +++ b/public/react/src/modules/courses/poll/pollStyle.css @@ -323,7 +323,6 @@ textarea:read-only{ } .standardAnswer p{ line-height: 20px!important; - font-size: 16px; } /* 倒计时 */ .remainingTime li{ diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 46eb61859..b39baa91c 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -2464,7 +2464,7 @@ class Listofworks extends Component { 作业问答 {this.props.isAdmin() ? - this.state.code_review === false ? "" : 代码查重 : ""} diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 5d9d2d200..11017259a 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1676,7 +1676,7 @@ class Trainingjobsetting extends Component { } 作业问答 - {this.props.isAdmin()?this.state.code_review===false?"": 代码查重 : ""}