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 1/2] =?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"?"学生学号":""}排序

      -