From d96882662ac100f08834c86b32943cd47829c771 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 28 Jun 2019 14:53:55 +0800 Subject: [PATCH 1/7] null --- .../courses/graduation/tasks/Graduationtaskitem.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/Graduationtaskitem.js b/public/react/src/modules/courses/graduation/tasks/Graduationtaskitem.js index 53cf3d9e2..973f1b9ba 100644 --- a/public/react/src/modules/courses/graduation/tasks/Graduationtaskitem.js +++ b/public/react/src/modules/courses/graduation/tasks/Graduationtaskitem.js @@ -15,7 +15,7 @@ class Graduationtaskitem extends Component{ } render(){ let { item }=this.props; - const _content = this.parseCommentContent(item.content) + const _content = item.content && this.parseCommentContent(item.content) return(
@@ -48,12 +48,14 @@ class Graduationtaskitem extends Component{
-
+ {!!_content &&
-
+
} + {!_content && {"暂未写评语"}} +
{(item && item.children && item.children.length) ?
: ''} {this.renderChildenComments(item)} From fc0f346d77f19a01f98e1e09c4233e6cea930881 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 28 Jun 2019 14:55:08 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=AD=94=E9=A2=98issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/exercise/ExerciseReviewAndAnswer.js | 2 +- .../src/modules/courses/exercise/question/multiple.js | 4 ++-- .../modules/courses/exercise/question/simpleAnswer.js | 10 +++++----- .../src/modules/courses/exercise/question/single.js | 4 ++-- public/react/src/modules/courses/poll/pollStyle.css | 1 - 5 files changed, 10 insertions(+), 11 deletions(-) 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/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/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{ 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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 7/7] 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()}>删除分班 }