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/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/coursesPublic/modal/CheckCodeModal.js b/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js index cfc6d1245..d38c0a515 100644 --- a/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js +++ b/public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js @@ -1,235 +1,235 @@ -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 => { + return ( +

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

    + ) + }) } +
    + +
    +
    +
    + ) + } +} +export default CheckCodeModal; diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index 1e34838d9..8c9a9cec6 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'; @@ -102,9 +102,9 @@ class Exercisestatisticalresult extends Component { } `} -
    +
    - {data&&data.course_groups.length===0?"":
    + {data&&data.course_groups.length===0?"":