From 7c239e16226606a03fc5dc70be26af6b7285ad73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 20 Sep 2019 09:10:15 +0800 Subject: [PATCH 01/24] =?UTF-8?q?=E8=B0=83=E6=95=B4ec=20=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../subroute/ecStudentList/EcStudentList.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js b/public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js index 312bfeecf..ead6e4c29 100644 --- a/public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js +++ b/public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js @@ -39,20 +39,20 @@ class EcStudentList extends Component { let major_id=this.props.match.params.major_id; let year_id=this.props.match.params.year_id; - const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data'; - axios.get(url, { - withCredentials: true, - }).then((response) => { - if(response.status===200){ - this.setState({ - majorschoollist:response.data, - ismanager:response.data.ismanager, - }) - } - }) - .catch(function (error) { - console.log(error); - }); + // const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data'; + // axios.get(url, { + // withCredentials: true, + // }).then((response) => { + // if(response.status===200){ + // this.setState({ + // majorschoollist:response.data, + // ismanager:response.data.ismanager, + // }) + // } + // }) + // .catch(function (error) { + // console.log(error); + // }); // let majorschoollist={ // ec_students: [{index: 1, student_name: "同意", student_id: "s20111458"}, // {index: 1, student_name: "同意", student_id: "s20111458"}, From 560f4c5e2c8231a3f6cf28f8035ebf1e3b799354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 20 Sep 2019 09:42:20 +0800 Subject: [PATCH 02/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index ac2133aab..ec939baeb 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1451,6 +1451,7 @@ class Listofworksstudentone extends Component { ], yslpros:false, datajs:[], + homework_status:[], } } @@ -1569,7 +1570,8 @@ class Listofworksstudentone extends Component { allow_late:result.data.allow_late, loadingstate: false, computeTimetype:true, - }) + homework_status:result.data.homework_status, + }); this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1); if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { @@ -1626,7 +1628,8 @@ class Listofworksstudentone extends Component { code_review: result.data.code_review, challenges_count:result.data.challenges_count, view_report:result.data.view_report, - }) + homework_status:result.data.homework_status, + }); if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { this.seacthdata(result.data); } else { @@ -2129,7 +2132,8 @@ class Listofworksstudentone extends Component { code_review: result.data.code_review, challenges_count:result.data.challenges_count, view_report:result.data.view_report, - }) + homework_status:result.data.homework_status, + }); this.seacthdata(result.data); this.props.Getdataback(result,result.data); } @@ -2242,7 +2246,8 @@ class Listofworksstudentone extends Component { end_immediately: result.data.end_immediately, code_review: result.data.code_review, challenges_count:result.data.challenges_count, - }) + homework_status:result.data.homework_status, + }); this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,page); this.props.Getdataback(result,result.data); // } @@ -3068,6 +3073,7 @@ class Listofworksstudentone extends Component { } return ( + this.props.isAdmin() === true ? (
From 218a2fe51f32218a1fbed2f971c5f9a20564f8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 20 Sep 2019 10:11:15 +0800 Subject: [PATCH 03/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 830 +++++++++--------- 1 file changed, 432 insertions(+), 398 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index ec939baeb..8ae8b9eaf 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -33,6 +33,8 @@ import Startshixuntask from "../coursesPublic/Startshixuntask"; import ModulationModal from "../coursesPublic/ModulationModal"; import HomeworkModal from "../coursesPublic/HomeworkModal"; import ShixunWorkModal from "./Shixunworkdetails/ShixunWorkModal"; +import NoneData from '../../../modules/courses/coursesPublic/NoneData' + const Search = Input.Search; const RadioGroup = Radio.Group; const CheckboxGroup = Checkbox.Group; @@ -3042,7 +3044,7 @@ class Listofworksstudentone extends Component { }) } render() { - let {columns,course_groupysls,datajs,isAdmin, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible,visibles, game_list,columnsstu,columnsstu2, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; + let {columns,course_groupysls,datajs,isAdmin,homework_status, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible,visibles, game_list,columnsstu,columnsstu2, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; const antIcon = ; // console.log(this.state.student_works); @@ -3075,88 +3077,94 @@ class Listofworksstudentone extends Component { return ( this.props.isAdmin() === true ? - ( -
- {visible === true ? this.saveModulationModal(value, num)} - /> : ""} - - {this.state.showmodel === true ? this.hideshowmodel()} - updatas={() => this.isupdatas()} - /> : ""} - - - {visibles === true ? -
- - this.cancelModulationModels()} - /> - -
- : "" - } - - {/*立即发布*/} - this.getcourse_groupslist(id)} - starttimes={this.state.starttimes} - typs={this.state.typs} - /> -
- - -
- - - + this.cancelModulationModels()} + /> + +
+ : "" + } + + {/*立即发布*/} + this.getcourse_groupslist(id)} + starttimes={this.state.starttimes} + typs={this.state.typs} + /> + { + homework_status.length===0? + + : + homework_status.length>0 && homework_status[0]==="未发布"? + + : +
+ + +
+ + + - {computeTimetype===false?
  • - - + + {computeTimetype===false?
  • + + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异 -
  • :""} + :""} - {/*作品状态GraduationTaskssettinglist*/} -
      -
    • - 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} + {/*作品状态GraduationTaskssettinglist*/} +
        +
      • + 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} -
        - {course_is_end===true?"": +
        + {course_is_end===true?"": {teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true? (this.props.isNotMember()===false?
        查看最新成绩 @@ -3229,7 +3237,7 @@ class Listofworksstudentone extends Component {
        :"") }
        } - + -
        -
      • - -
      • - - 作品状态: - this.notlimiteds()}>不限 - this.funtaskstatust(e, task_status && task_status)} - style={{paddingTop: '4px'}}> - - {task_status === undefined ? "" : task_status.map((item, key) => { - return ( - +
    + + +
  • + + 作品状态: + this.notlimiteds()}>不限 + this.funtaskstatust(e, task_status && task_status)} + style={{paddingTop: '4px'}}> + + {task_status === undefined ? "" : task_status.map((item, key) => { + return ( + {item.name} @@ -3263,96 +3271,96 @@ class Listofworksstudentone extends Component { - ) - })} - - {/*请输入姓名或学号搜索*/} - - -
  • - - - {/*分班情况*/} - -
  • - {JSON.stringify(course_group_info) === "[]" ? "" : course_group_info === undefined ? "" : course_group_info.length < 2 ? "" : -
    - 分班情况: - this.notlimitedst()}>不限 - this.funtaskstatustwot(e, course_group_info && course_group_info)} - style={{paddingTop: '4px',width:'1017px'}}> - {course_group_info === undefined ? "" : - course_group_info.map((item, key) => { - return ( - + ) + })} + + {/*请输入姓名或学号搜索*/} + + +
  • + + + {/*分班情况*/} + +
  • + {JSON.stringify(course_group_info) === "[]" ? "" : course_group_info === undefined ? "" : course_group_info.length < 2 ? "" : +
    + 分班情况: + this.notlimitedst()}>不限 + this.funtaskstatustwot(e, course_group_info && course_group_info)} + style={{paddingTop: '4px',width:'1017px'}}> + {course_group_info === undefined ? "" : + course_group_info.map((item, key) => { + return ( + {item.group_group_name} ({item.count}) - ) - }) - } - -
    } -
  • + ) + }) + } + +
    } + - + -
    + + { + JSON.stringify(datajs) === "[]" ? + +
    +
    +
    + +

    暂时还没有相关数据哦!

    +
    +
    + +
    + : + +
    + -
    - {datajs === undefined ? "" : } - - - } - - - - { - teacherdata && teacherdata.work_count && teacherdata.work_count > limit ? -
    - -
    - : "" - } - - - - ) +
    + {datajs === undefined ? "" :
    } + + + } + + + + { + teacherdata && teacherdata.work_count && teacherdata.work_count > limit ? +
    + +
    + : "" + } + + } + : - ( -
    - { - teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ? - // 学生不能查看别人的 -
    - - {visibles === true ? -
    - - + {visibles === true ? +
    + + - this.cancelModulationModels()} - /> -
    - : "" - } + } + + this.cancelModulationModels()} + /> +
    + : "" + } -
    -
    + { + homework_status.length===0? +
    + +
    + : + homework_status.length>0 && homework_status[0]==="未发布"? +
    + +
    + : - - {computeTimetype===false?
  • - - + + {computeTimetype===false?
  • + + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异 -
  • :""} + :""} - {JSON.stringify(data) !== "[]" ? -
    -
    + {JSON.stringify(data) !== "[]" ? +
    +
    -
    +
    -
    +
    - 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} - { course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"": + 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} + { course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"": {computeTimetype===true? (this.props.isNotMember()===false?
    @@ -3545,14 +3565,14 @@ class Listofworksstudentone extends Component { } } -
    +
    -
    +
    -
    -
    - -
    - {data === undefined ? "" :
    } - - - +
    + {data === undefined ? "" :
    } + + + - : -
    -
    -
    - -

    暂时还没有相关数据哦!

    -
    -
    + : +
    +
    +
    + +

    暂时还没有相关数据哦!

    +
    +
    -
    - } +
    + } - + - + + } + + : + // 学生能查看别人的 +
    + {/*双层*/} + + + {visibles === true ? + this.cancelModulationModels()} + /> : "" + } -
    - : - // 学生能查看别人的 -
    - {/*双层*/} - - - {visibles === true ? - this.cancelModulationModels()} - /> : "" - } -
    + { + homework_status.length===0? +
    + +
    + : + homework_status.length>0 && homework_status[0]==="未发布"? +
    + +
    + : +
    -
    - + - {computeTimetype===false?
  • - - + {computeTimetype===false?
  • + + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异 -
  • :""} + :""} - -
    - {data === undefined ? "" :
    } - - {JSON.stringify(datas) !== "[]" ? -
    -
    -
    + } + +
    + {data === undefined ? "" :
    } + + {JSON.stringify(datas) !== "[]" ? +
    +
    +
    {teacherdata === undefined ? "0" : teacherdata.commit_count === undefined ? "0" : teacherdata.commit_count} @@ -3698,8 +3730,8 @@ class Listofworksstudentone extends Component { style={{color: '#FF6800'}}>{teacherdata.left_time.time}} - -
    + +
    - 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} - { course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"": + 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} + { course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"": {computeTimetype===true? (this.props.isNotMember()===false?
    查看最新成绩 @@ -3756,12 +3788,12 @@ class Listofworksstudentone extends Component {
    :"") }
    } -
    -
    -
    -
    - -
    - {datas === undefined ? "" :
    } +
    + {datas === undefined ? "" :
    } + + + { + teacherdata && teacherdata.work_count && teacherdata.work_count > limit ? +
    + +
    + : "" + } + + : +
    +
    +
    + +

    暂时还没有相关数据哦!

    +
    +
    +
    + } - { - teacherdata && teacherdata.work_count && teacherdata.work_count > limit ? -
    - -
    - : "" } - : -
    -
    -
    - -

    暂时还没有相关数据哦!

    -
    -
    -
    - } - - - + } - ) + ) } From 3abe1610be090ac85a54147e580e5b1bf125c7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 20 Sep 2019 10:28:19 +0800 Subject: [PATCH 04/24] =?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 | 623 +++++++++--------- .../exercise/Testpapersettinghomepage.js | 2 +- 2 files changed, 329 insertions(+), 296 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 60065f43e..bcb8876df 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -22,7 +22,7 @@ import 'moment/locale/zh-cn'; import './yslexercisetable.css'; import {getImageUrl, toPath} from 'educoder'; import CheckBoxGroup from "../../page/component/CheckBoxGroup"; - +import NoneData from '../../../modules/courses/coursesPublic/NoneData' const Search = Input.Search; const RadioGroup = Radio.Group; const CheckboxGroup = Checkbox.Group; @@ -1217,6 +1217,7 @@ class Studentshavecompletedthelist extends Component { ) }, ], + exercise_status:0, } // console.log("Studentshavecompletedthelist"); // console.log(props.current_status); @@ -1277,6 +1278,20 @@ class Studentshavecompletedthelist extends Component { }catch (e) { } + try { + if(this.props.Commonheadofthetestpaper.exercise_status !== undefined){ + this.setState({ + exercise_status:this.props.Commonheadofthetestpaper.exercise_status, + }) + }else{ + this.setState({ + exercise_status:0, + }) + } + }catch (e) { + + } + } componentWillReceiveProps = (nextProps) => { @@ -2065,11 +2080,11 @@ class Studentshavecompletedthelist extends Component { this.setState({ loadingstate: false, }) - console.log(response); - console.log(1997); + // console.log(response); + // console.log(1997); this.Generatenewdatasy(response.data.exercise_users, response); }).catch((error) => { - console.log(error) + // console.log(error) this.setState({ loadingstate: false, }) @@ -2472,7 +2487,7 @@ class Studentshavecompletedthelist extends Component { render() { const isAdmin = this.props.isAdmin(); - let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users,mylistansum} = this.state; + let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable,exercise_status, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users,mylistansum} = this.state; // console.log("Studentshavecompletedthelist"); // console.log(this.props.current_status); return ( @@ -2483,202 +2498,209 @@ class Studentshavecompletedthelist extends Component { " min-width": " 1200px", }}> {/*老师*/} -
    -
      + { + exercise_status===0 || exercise_status===1 ? + + : +
      +
      +
        - {/*你的评阅:*/} - { - Teacherliststudentlist === undefined || Teacherliststudentlist.exercise_types.subjective === 0 ? -
      • - 作品状态: - this.notlimiteds()}>不限 - this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}> - { - course_groupyslstwodata.map((item, key) => { - return ( - {item.tu}({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unanswer_users : Teacherliststudentlist.exercise_types.answer_users}) - ) - }) - } - -
        - this.onSearchKeywordKeyUp(e)} - onInput={this.inputSearchValues} - onSearch={this.searchValues} - > -
        -
      • - : -
        -
      • - 你的评阅: - this.notlimited()}>不限 - - this.checkeboxs(e, course_groupyslstwodata && course_groupyslstwodata)}> - { - course_groupyslstwodatas.map((item, key) => { - return ( - {item.tu}({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unreview_counts : Teacherliststudentlist.exercise_types.review_counts}) - ) - }) - } - -
        - this.onSearchKeywordKeyUp(e)} - onInput={this.inputSearchValues} - onSearch={this.searchValues} - > -
        -
      • - {/*作品状态*/} -
      • - 作品状态: - this.notlimiteds()}>不限 - this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}> - { - course_groupyslstwodata.map((item, key) => { - return ( - {item.tu}({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unanswer_users : Teacherliststudentlist.exercise_types.answer_users}) - ) - }) - } - -
      • -
        + {/*你的评阅:*/} + { + Teacherliststudentlist === undefined || Teacherliststudentlist.exercise_types.subjective === 0 ? +
      • + 作品状态: + this.notlimiteds()}>不限 + this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}> + { + course_groupyslstwodata.map((item, key) => { + return ( + {item.tu}({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unanswer_users : Teacherliststudentlist.exercise_types.answer_users}) + ) + }) + } + +
        + this.onSearchKeywordKeyUp(e)} + onInput={this.inputSearchValues} + onSearch={this.searchValues} + > +
        +
      • + : +
        +
      • + 你的评阅: + this.notlimited()}>不限 + + this.checkeboxs(e, course_groupyslstwodata && course_groupyslstwodata)}> + { + course_groupyslstwodatas.map((item, key) => { + return ( + {item.tu}({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unreview_counts : Teacherliststudentlist.exercise_types.review_counts}) + ) + }) + } + +
        + this.onSearchKeywordKeyUp(e)} + onInput={this.inputSearchValues} + onSearch={this.searchValues} + > +
        +
      • + {/*作品状态*/} +
      • + 作品状态: + this.notlimiteds()}>不限 + this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}> + { + course_groupyslstwodata.map((item, key) => { + return ( + {item.tu}({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unanswer_users : Teacherliststudentlist.exercise_types.answer_users}) + ) + }) + } + +
      • +
        - } - {/*分班情况*/} - {course_groups === undefined ? "" : course_groups === null ? "" : course_groups.length < 2 ? "" : JSON.stringify(course_groups) === "[]" ? "" : -
      • -
    - - - + + + - + + - - } + + } - + - - {JSON.stringify(data) !== "[]" ? -
    - -
    - {data === undefined ? "" :
    分班情况: this.funtaskstatustwos()}>不限 - - this.funtaskstatustwo(e, course_groups && course_groups)} - style={{paddingTop: '4px', display: "inline"}}> - { - course_groups.map((item, key) => { - return ( - {item.exercise_group_name}({item.exercise_group_students}) - ) - }) - } - + } + {/*分班情况*/} + {course_groups === undefined ? "" : course_groups === null ? "" : course_groups.length < 2 ? "" : JSON.stringify(course_groups) === "[]" ? "" : +
  • +
  • 分班情况: this.funtaskstatustwos()}>不限 + + this.funtaskstatustwo(e, course_groups && course_groups)} + style={{paddingTop: '4px', display: "inline"}}> + { + course_groups.map((item, key) => { + return ( + {item.exercise_group_name}({item.exercise_group_students}) + ) + }) + } + -
    } - - +
    + {data === undefined ? "" :
    } + + - : -
    -
    -
    - -

    暂时还没有相关数据哦!

    -
    -
    + : +
    +
    +
    + +

    暂时还没有相关数据哦!

    +
    +
    -
    - } +
    + } - - { - Teacherliststudentlist && Teacherliststudentlist.exercise_types.total_users && Teacherliststudentlist.exercise_types.total_users > limit ? -
    - +
    + { + Teacherliststudentlist && Teacherliststudentlist.exercise_types.total_users && Teacherliststudentlist.exercise_types.total_users > limit ? +
    + +
    + : "" + } - : "" } @@ -2691,16 +2713,20 @@ class Studentshavecompletedthelist extends Component {
    -
    + { + exercise_status === 0 || exercise_status === 1 ? + + : +
    -
    +
    -
    +
    {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.answer_users}} -
    +
    -
    +
    - {JSON.stringify(datas) === "[]" ? -
    -
    -
    - -

    暂时还没有相关数据哦!

    -
    -
    + {JSON.stringify(datas) === "[]" ? +
    +
    +
    + +

    暂时还没有相关数据哦!

    +
    +
    -
    - : -
    - -
    - {datas === undefined ? "" :
    } - - - } - +
    + {datas === undefined ? "" :
    } + + + } - + + } @@ -2766,10 +2792,15 @@ class Studentshavecompletedthelist extends Component { "padding-bottom": "100px", " min-width": " 1200px" }}> -
    - -
    - {data === undefined ? "" :
    } - - {JSON.stringify(datas) === "[]" ? - -
    -
    -
    - -

    暂时还没有相关数据哦!

    + } + +
    + {data === undefined ? "" :
    } - + {JSON.stringify(datas) === "[]" ? - - : -
    - < div id="graduation_work_list" style={{ - padding: '0px 30px 10px 30px', - "margin-top": "20px", - "margin-bottom": "10px" - }}> - -
    +
    +
    +
    + +

    暂时还没有相关数据哦!

    +
    +
    + +
    + : +
    + < div id="graduation_work_list" style={{ + padding: '0px 30px 10px 30px', + "margin-top": "20px", + "margin-bottom": "10px" + }}> + + - -
    -
    - -
    - {datas === undefined ? "" :
    } - +
    + {datas === undefined ? "" :
    } + - + - } - + } + - { - mylistansum && mylistansum > limit ? -
    - + { + mylistansum && mylistansum > limit ? +
    + +
    + : "" + }
    - : "" } diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index 5775bd240..ba3cee3d3 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -436,7 +436,7 @@ class Testpapersettinghomepage extends Component{ /> { // 教师列表 - parseInt(tab[0])==0 && this.setcourse_groupysls(value)} current_status = {this.state.current_status}> + parseInt(tab[0])==0 && this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper}> } {/*统计结果*/} From 2f625f01bcc17a30a2ea01bfc12d7121f927f91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 20 Sep 2019 17:07:06 +0800 Subject: [PATCH 05/24] =?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/exercise/Studentshavecompletedthelist.js | 6 ++++++ .../courses/shixunHomework/Listofworksstudentone.js | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index bcb8876df..6fdde6aeb 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -2500,7 +2500,9 @@ class Studentshavecompletedthelist extends Component { {/*老师*/} { exercise_status===0 || exercise_status===1 ? +
    +
    :
    @@ -2715,7 +2717,9 @@ class Studentshavecompletedthelist extends Component { style={{"margin": "0 auto", "padding-bottom": "100px", " min-width": " 1200px"}}> { exercise_status === 0 || exercise_status === 1 ? +
    +
    :
    @@ -2794,7 +2798,9 @@ class Studentshavecompletedthelist extends Component { }}> { exercise_status === 0 || exercise_status === 1 ? +
    +
    :
    diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 8ae8b9eaf..a5423b6e9 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -3152,10 +3152,14 @@ class Listofworksstudentone extends Component { /> { homework_status.length===0? +
    +
    : homework_status.length>0 && homework_status[0]==="未发布"? +
    +
    :
    @@ -3488,12 +3492,12 @@ class Listofworksstudentone extends Component { { homework_status.length===0? -
    +
    : homework_status.length>0 && homework_status[0]==="未发布"? -
    +
    : @@ -3648,12 +3652,12 @@ class Listofworksstudentone extends Component { { homework_status.length===0? -
    +
    : homework_status.length>0 && homework_status[0]==="未发布"? -
    +
    : From 5a9ba51dec79368e97795234882d159fbbf95c49 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 18:00:38 +0800 Subject: [PATCH 06/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 508d005a4..b6bba1f34 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -253,7 +253,10 @@ class ApplicationController < ActionController::Base if Digest::MD5.hexdigest(content) == params[:chinaoocKey] user = open_class_user - start_user_session(user) if user + if user + start_user_session(user) + set_autologin_cookie(user) + end User.current = user end end From b53889524c831fea56888f44dac8972470cf07c5 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 18:10:11 +0800 Subject: [PATCH 07/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/searchs/index.json.jbuilder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/searchs/index.json.jbuilder b/app/views/searchs/index.json.jbuilder index 164e90b53..9983fa61e 100644 --- a/app/views/searchs/index.json.jbuilder +++ b/app/views/searchs/index.json.jbuilder @@ -11,8 +11,8 @@ json.results do reg = /^[,。?:;‘’!“”—……、]/ # 附件的替换 atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/ - highlights[:description]&.first&.sub!(reg, '').sub!(atta_reg, '') - highlights[:content]&.first&.sub!(reg, '').sub!(atta_reg, '') + highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '') + highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '') json.content highlights end From facea97f5efccca9731532cb0a9821341833e5a1 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, 21 Sep 2019 18:11:18 +0800 Subject: [PATCH 08/24] =?UTF-8?q?=E8=B0=83=E6=95=B4bd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/message/js/MessagSub.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/react/src/modules/message/js/MessagSub.js b/public/react/src/modules/message/js/MessagSub.js index fccfbb0b2..1b1accd2b 100644 --- a/public/react/src/modules/message/js/MessagSub.js +++ b/public/react/src/modules/message/js/MessagSub.js @@ -479,6 +479,8 @@ class MessagSub extends Component{ return ''; case "PublicCourseStart": return window.open(`/courses/${item.container_id}/informs`); + case "SubjectStartCourse": + return window.open(`/paths/${item.container_id}`); default : return window.open("/") } From a328375a97c657799b6469a58013440d5e750426 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, 21 Sep 2019 18:15:32 +0800 Subject: [PATCH 09/24] =?UTF-8?q?=E8=B0=83=E6=95=B4bd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/shixunHomework/shixunHomework.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 55dfac7fc..eb59ce6f1 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -1064,8 +1064,7 @@ class ShixunHomework extends Component{

    - {/*{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}*/} - 实训作业 + {datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}

  • {datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null? From a1aff1a8917e97ed9af91b632653c24280c8717c Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 18:25:57 +0800 Subject: [PATCH 10/24] =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/commons_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/commons_controller.rb b/app/controllers/commons_controller.rb index 43ea31c97..bcb0fa45a 100644 --- a/app/controllers/commons_controller.rb +++ b/app/controllers/commons_controller.rb @@ -51,7 +51,7 @@ class CommonsController < ApplicationController 200 end when 'journals_for_message' - course = @object.jour&.course || @object.jour&.student_work&.homework_common&.course + course = @object&.jour_type.to_s == "StudentWorksScore" ? @object.jour&.student_work&.homework_common&.course : @object.jour&.course if current_user.course_identity(course) >= Course::STUDENT && @object.user != current_user 403 else From a32aa9dde6798333ced8d1ab5ee6b12a3ddb4bb6 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, 21 Sep 2019 18:40:57 +0800 Subject: [PATCH 11/24] =?UTF-8?q?=E8=B0=83=E6=95=B4bd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/shixunHomework/Trainingjobsetting.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index bee373bd9..854de0138 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -86,7 +86,7 @@ class Trainingjobsetting extends Component { latepenaltytype: false, unifiedsetting: true, allowreplenishment: undefined, - completionefficiencyscore: true, + completionefficiencyscore: false, whethertopay: false, proportion: undefined, level: undefined, @@ -120,6 +120,7 @@ class Trainingjobsetting extends Component { showmodel:false, code_review:false, testscripttiptype:false, + end_timebool:false, late_timesbool:false, } @@ -1701,6 +1702,7 @@ class Trainingjobsetting extends Component { flagPageEditstwo:releasetime, flagPageEditsthrees:deadline, flagPageEditsfor:endtime, + completionefficiencyscore:true, unifiedsetting:this.state.unifiedsetting, }) if(this.state.proportion === "自定义分值"){ @@ -2139,7 +2141,7 @@ class Trainingjobsetting extends Component {
  • 分值 - From 59aac6cfa8cc8d2b29bc06f5d6f5e6c6795321d3 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 18:44:47 +0800 Subject: [PATCH 12/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/searchs/index.json.jbuilder | 2 +- app/views/shixun_lists/index.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/searchs/index.json.jbuilder b/app/views/searchs/index.json.jbuilder index 9983fa61e..51bf4f221 100644 --- a/app/views/searchs/index.json.jbuilder +++ b/app/views/searchs/index.json.jbuilder @@ -10,7 +10,7 @@ json.results do # 去除开头标点符号 reg = /^[,。?:;‘’!“”—……、]/ # 附件的替换 - atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/ + atta_reg = /!\[]\(\/api\/attachments\/\d+\)/ highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '') highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '') diff --git a/app/views/shixun_lists/index.json.jbuilder b/app/views/shixun_lists/index.json.jbuilder index c925d6876..a4e49093a 100644 --- a/app/views/shixun_lists/index.json.jbuilder +++ b/app/views/shixun_lists/index.json.jbuilder @@ -8,7 +8,7 @@ json.shixun_list do # 去除开头标点符号 reg = /^[,。?:;‘’!“”—……、]/ # 附件的替换 - atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/ + atta_reg = /!\[]\(\/api\/attachments\/\d+\)/ highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '') highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '') From de4b57d0777d4fe9b7970ff10829bbdf0d2bbce5 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 18:49:06 +0800 Subject: [PATCH 13/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixun_lists/index.json.jbuilder | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/shixun_lists/index.json.jbuilder b/app/views/shixun_lists/index.json.jbuilder index a4e49093a..67875e82b 100644 --- a/app/views/shixun_lists/index.json.jbuilder +++ b/app/views/shixun_lists/index.json.jbuilder @@ -10,6 +10,8 @@ json.shixun_list do # 附件的替换 atta_reg = /!\[]\(\/api\/attachments\/\d+\)/ highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '') + Rails.logger.info("#########serach_description#{highlights[:description]}------------#{highlights[:description]&.first}") + highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '') json.title highlights.delete(:name)&.join('...') || obj.searchable_title From ee595e9e9a01101f779233c59e8310ea2aab2136 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, 21 Sep 2019 18:53:13 +0800 Subject: [PATCH 14/24] =?UTF-8?q?=E8=B0=83=E6=95=B4bd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/Trainingjobsetting.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 854de0138..2edecd175 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1735,6 +1735,7 @@ class Trainingjobsetting extends Component { hand__e_tip: "", hand_flags: false, handclass: undefined, + completionefficiencyscore:false, unit_e_tip: "", }) this.refs.targetElementTrainingjobsetting.scrollIntoView(); From 7619da0341dbeb2b07da3c294560ff51ed2ce220 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 18:54:04 +0800 Subject: [PATCH 15/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/searchs/index.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/searchs/index.json.jbuilder b/app/views/searchs/index.json.jbuilder index 51bf4f221..27674e894 100644 --- a/app/views/searchs/index.json.jbuilder +++ b/app/views/searchs/index.json.jbuilder @@ -12,6 +12,7 @@ json.results do # 附件的替换 atta_reg = /!\[]\(\/api\/attachments\/\d+\)/ highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '') + Rails.logger.info("#########serach_description#{highlights[:description]}------------#{highlights[:description]&.first}") highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '') json.content highlights From b389560aed50c5322937da59fd43bd2cdcb6ea06 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 18:58:15 +0800 Subject: [PATCH 16/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/searchs/index.json.jbuilder | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/searchs/index.json.jbuilder b/app/views/searchs/index.json.jbuilder index 27674e894..be62bf865 100644 --- a/app/views/searchs/index.json.jbuilder +++ b/app/views/searchs/index.json.jbuilder @@ -10,10 +10,12 @@ json.results do # 去除开头标点符号 reg = /^[,。?:;‘’!“”—……、]/ # 附件的替换 - atta_reg = /!\[]\(\/api\/attachments\/\d+\)/ - highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '') + atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/ + highlights[:description]&.first&.sub!(reg, '') + highlights[:description]&.map{|des| des.gsub!(atta_reg, '')} Rails.logger.info("#########serach_description#{highlights[:description]}------------#{highlights[:description]&.first}") - highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '') + highlights[:content]&.first&.sub!(reg, '') + highlights[:content]&.map{|des| des.gsub!(atta_reg, '')} json.content highlights end From f1ff06df797b24ce588348dada1e175256f0798d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 19:00:20 +0800 Subject: [PATCH 17/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/searchs/index.json.jbuilder | 1 - app/views/shixun_lists/index.json.jbuilder | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/searchs/index.json.jbuilder b/app/views/searchs/index.json.jbuilder index be62bf865..65c4d248c 100644 --- a/app/views/searchs/index.json.jbuilder +++ b/app/views/searchs/index.json.jbuilder @@ -13,7 +13,6 @@ json.results do atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/ highlights[:description]&.first&.sub!(reg, '') highlights[:description]&.map{|des| des.gsub!(atta_reg, '')} - Rails.logger.info("#########serach_description#{highlights[:description]}------------#{highlights[:description]&.first}") highlights[:content]&.first&.sub!(reg, '') highlights[:content]&.map{|des| des.gsub!(atta_reg, '')} diff --git a/app/views/shixun_lists/index.json.jbuilder b/app/views/shixun_lists/index.json.jbuilder index 67875e82b..79ce4b09c 100644 --- a/app/views/shixun_lists/index.json.jbuilder +++ b/app/views/shixun_lists/index.json.jbuilder @@ -8,11 +8,12 @@ json.shixun_list do # 去除开头标点符号 reg = /^[,。?:;‘’!“”—……、]/ # 附件的替换 - atta_reg = /!\[]\(\/api\/attachments\/\d+\)/ - highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '') - Rails.logger.info("#########serach_description#{highlights[:description]}------------#{highlights[:description]&.first}") + atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/ - highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '') + highlights[:description]&.first&.sub!(reg, '') + highlights[:description]&.map{|des| des.gsub!(atta_reg, '')} + highlights[:content]&.first&.sub!(reg, '') + highlights[:content]&.map{|des| des.gsub!(atta_reg, '')} json.title highlights.delete(:name)&.join('...') || obj.searchable_title json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.sub!(atta_reg, '') From e25ec454f658f4318bb1622f1a6e67075f304528 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, 21 Sep 2019 19:05:27 +0800 Subject: [PATCH 18/24] =?UTF-8?q?=E8=B0=83=E6=95=B4bd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/Trainingjobsetting.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 2edecd175..e9c100648 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1703,6 +1703,7 @@ class Trainingjobsetting extends Component { flagPageEditsthrees:deadline, flagPageEditsfor:endtime, completionefficiencyscore:true, + latedeductiontwo:20, unifiedsetting:this.state.unifiedsetting, }) if(this.state.proportion === "自定义分值"){ @@ -1736,6 +1737,7 @@ class Trainingjobsetting extends Component { hand_flags: false, handclass: undefined, completionefficiencyscore:false, + latedeductiontwo:0, unit_e_tip: "", }) this.refs.targetElementTrainingjobsetting.scrollIntoView(); From e535c92410f6d57f3bf86234e884d4a2a1f2d48e Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 19:08:53 +0800 Subject: [PATCH 19/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 ++ app/jobs/create_subject_course_student_job.rb | 20 +++++++++++++++++++ .../create_subject_course_student_job_spec.rb | 5 +++++ 3 files changed, 27 insertions(+) create mode 100644 app/jobs/create_subject_course_student_job.rb create mode 100644 spec/jobs/create_subject_course_student_job_spec.rb diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 0dc8829da..8d6c96b1c 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -166,6 +166,8 @@ class CoursesController < ApplicationController CourseMember.create!(course_id: @course.id, user_id: s_member.user_id, role: 2) end + CreateSubjectCourseStudentJob.perform_later(@course.id) if course.subject.subject_appointments.count > 0 + Inform.create(container: @course, description: @subject.learning_notes, name: "学习须知") @course.create_stages @course.subject diff --git a/app/jobs/create_subject_course_student_job.rb b/app/jobs/create_subject_course_student_job.rb new file mode 100644 index 000000000..66eb41f70 --- /dev/null +++ b/app/jobs/create_subject_course_student_job.rb @@ -0,0 +1,20 @@ +class CreateSubjectCourseStudentJob < ApplicationJob + queue_as :default + + def perform(course_id) + course = Course.find_by(id: course_id) + return if course.blank? || course.subject.blank? + + attrs = %i[course_id user_id role created_at updated_at] + same_attrs = {course_id: course.id, role: 4} + + CourseMember.bulk_insert(*attrs) do |worker| + course.subject.subject_appointments.each do |app| + next if course.students.where(user_id: user_id).any? + worker.add same_attrs.merge(user_id: app.user_id) + end + end + + course.subject.subject_appointments.destroy_all + end +end diff --git a/spec/jobs/create_subject_course_student_job_spec.rb b/spec/jobs/create_subject_course_student_job_spec.rb new file mode 100644 index 000000000..1b506fe68 --- /dev/null +++ b/spec/jobs/create_subject_course_student_job_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe CreateSubjectCourseStudentJob, type: :job do + pending "add some examples to (or delete) #{__FILE__}" +end From 2050c040c6b7774b2ec5bac54918fa4aa089762e Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 19:15:15 +0800 Subject: [PATCH 20/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 8d6c96b1c..a90855706 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -166,7 +166,7 @@ class CoursesController < ApplicationController CourseMember.create!(course_id: @course.id, user_id: s_member.user_id, role: 2) end - CreateSubjectCourseStudentJob.perform_later(@course.id) if course.subject.subject_appointments.count > 0 + CreateSubjectCourseStudentJob.perform_later(@course.id) if @course.subject.subject_appointments.count > 0 Inform.create(container: @course, description: @subject.learning_notes, name: "学习须知") From 80a14f5d95d18cdf877f567710692871c76dc135 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 19:16:44 +0800 Subject: [PATCH 21/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/create_subject_course_student_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/create_subject_course_student_job.rb b/app/jobs/create_subject_course_student_job.rb index 66eb41f70..38ff83024 100644 --- a/app/jobs/create_subject_course_student_job.rb +++ b/app/jobs/create_subject_course_student_job.rb @@ -10,7 +10,7 @@ class CreateSubjectCourseStudentJob < ApplicationJob CourseMember.bulk_insert(*attrs) do |worker| course.subject.subject_appointments.each do |app| - next if course.students.where(user_id: user_id).any? + next if course.students.where(user_id: app.user_id).any? worker.add same_attrs.merge(user_id: app.user_id) end end From 57c64784f049c3cecaac0b244fc49898a262af2a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 21 Sep 2019 19:44:30 +0800 Subject: [PATCH 22/24] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/create_subject_course_student_job.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/jobs/create_subject_course_student_job.rb b/app/jobs/create_subject_course_student_job.rb index 38ff83024..a7b8cb8af 100644 --- a/app/jobs/create_subject_course_student_job.rb +++ b/app/jobs/create_subject_course_student_job.rb @@ -8,13 +8,15 @@ class CreateSubjectCourseStudentJob < ApplicationJob attrs = %i[course_id user_id role created_at updated_at] same_attrs = {course_id: course.id, role: 4} + Rails.logger.info("1:course.students.count:##{course.students.count}") CourseMember.bulk_insert(*attrs) do |worker| course.subject.subject_appointments.each do |app| + Rails.logger.info("##{course.students.where(user_id: app.user_id)}") next if course.students.where(user_id: app.user_id).any? worker.add same_attrs.merge(user_id: app.user_id) end end - + Rails.logger.info("2:course.students.count:##{course.students.count}") course.subject.subject_appointments.destroy_all end end From a1339c595bb800a8eab36edf2784f57b72a50e1f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 19:49:49 +0800 Subject: [PATCH 23/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/create_subject_course_student_job.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/jobs/create_subject_course_student_job.rb b/app/jobs/create_subject_course_student_job.rb index 38ff83024..4675b59aa 100644 --- a/app/jobs/create_subject_course_student_job.rb +++ b/app/jobs/create_subject_course_student_job.rb @@ -12,9 +12,8 @@ class CreateSubjectCourseStudentJob < ApplicationJob course.subject.subject_appointments.each do |app| next if course.students.where(user_id: app.user_id).any? worker.add same_attrs.merge(user_id: app.user_id) + app.destroy end end - - course.subject.subject_appointments.destroy_all end end From d2d5759553d48414127b0ead96a41b8c65c63ecb Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 19:53:41 +0800 Subject: [PATCH 24/24] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 15 +++++++-------- app/jobs/create_subject_course_student_job.rb | 5 ++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index a90855706..d2c9f88d2 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -128,8 +128,8 @@ class CoursesController < ApplicationController # POST /courses # POST /courses.json def create - ActiveRecord::Base.transaction do - begin + begin + ActiveRecord::Base.transaction do @course = Course.new(name: params[:name], class_period: params[:class_period], credit: params[:credit], end_date: params[:end_date], is_public: params[:is_public], school_id: @school.id, authentication: params[:authentication], professional_certification: params[:professional_certification]) @@ -166,8 +166,6 @@ class CoursesController < ApplicationController CourseMember.create!(course_id: @course.id, user_id: s_member.user_id, role: 2) end - CreateSubjectCourseStudentJob.perform_later(@course.id) if @course.subject.subject_appointments.count > 0 - Inform.create(container: @course, description: @subject.learning_notes, name: "学习须知") @course.create_stages @course.subject @@ -176,11 +174,12 @@ class CoursesController < ApplicationController course_module_types = params[:course_module_types] @course.create_course_modules(course_module_types) end - rescue => e - uid_logger_error(e.message) - tip_exception(e.message) - raise ActiveRecord::Rollback end + CreateSubjectCourseStudentJob.perform_later(@course.id) if @course.subject && @course.subject.subject_appointments.count > 0 + rescue => e + uid_logger_error(e.message) + tip_exception(e.message) + raise ActiveRecord::Rollback end end diff --git a/app/jobs/create_subject_course_student_job.rb b/app/jobs/create_subject_course_student_job.rb index 71d4cda5f..a7b8cb8af 100644 --- a/app/jobs/create_subject_course_student_job.rb +++ b/app/jobs/create_subject_course_student_job.rb @@ -14,10 +14,9 @@ class CreateSubjectCourseStudentJob < ApplicationJob Rails.logger.info("##{course.students.where(user_id: app.user_id)}") next if course.students.where(user_id: app.user_id).any? worker.add same_attrs.merge(user_id: app.user_id) - app.destroy end end - # Rails.logger.info("2:course.students.count:##{course.students.count}") - # course.subject.subject_appointments.destroy_all + Rails.logger.info("2:course.students.count:##{course.students.count}") + course.subject.subject_appointments.destroy_all end end