diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 466ac0bd9..070aee271 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -1,6 +1,4 @@ import React, {Component} from "react"; -import CoursesListType from '../coursesPublic/CoursesListType'; -import {WordsBtn, ActionBtn} from 'educoder'; import TraineetraininginformationModal from './TraineetraininginformationModal'; import ModulationModal from "../coursesPublic/ModulationModal"; import HomeworkModal from "../coursesPublic/HomeworkModal"; @@ -64,7 +62,7 @@ class Listofworks extends Component { computeTimetype:true, limit: 20, loadingstate: true, - order: "update_time", + orders: "update_time", b_order:"desc", search: null, allow_late:false, @@ -354,7 +352,7 @@ class Listofworks extends Component { record.submitstate === "未提交" ? -- : this.Viewstudenttraininginformation(record)}>{record.operating} + onClick={() => this.Viewstudenttraininginformationt(record)}>{record.operating} ) }, @@ -616,7 +614,7 @@ class Listofworks extends Component { record.submitstate === "未提交" ? -- : this.Viewstudenttraininginformation(record)}>{record.operating} + onClick={() => this.Viewstudenttraininginformationt(record)}>{record.operating} ) }, @@ -630,751 +628,15 @@ class Listofworks extends Component { componentDidMount() { console.log("Listofworks"); console.log("componentDidMount"); - this.props.triggerRef(this) - var homeworkid = this.props.match.params.homeworkid; - // console.log(homeworkid) - // this.Gettitleinformation(homeworkid); - this.Getalistofworks(homeworkid); - let query = this.props.location.pathname; - const type = query.split('/'); - this.setState({ - shixuntypes: type[3] - }) + this.tearchar(); } - isupdatas = () => { - var homeworkid = this.props.match.params.homeworkid; - // this.Gettitleinformation(homeworkid); - this.Getalistofworks(homeworkid); - } - - // 获取作品列表 - Getalistofworks = (homeworkid) => { - // console.log("获取作品列表");7009 - - let urll = `/homework_commons/${homeworkid}/works_list.json`; - // console.log(homeworkid); - - // search:搜索关键字 - // order:排序方式:更新时间:update_time,最终成绩:work_score,学号:student_id - // b_order:desc:倒序 , asc:顺序 - // work_status:0:未提交, 1:按时提交, 2:延时提交,“”不限 - // course_group:分班情况 [232, 231], []:不限(空数组) - var data = { - search: "", - order: this.state.order, - b_order: "desc", - work_status: "", - course_group: "", - page:1, - limit:20, - } - axios.post(urll, data).then((result) => { - - if(this.props.isNotMember()===false){ - if (result !== undefined) { - // console.log(url) - // console.log("作品列表6789077") - // console.log(JSON.stringify(result)) - this.setState({ - teacherdata: result.data, - task_status: result.data.task_status, - allow_late:result.data.allow_late, - course_group_info: result.data.course_group_info, - loadingstate: false, - jobsettingsdata: result, - publish_immediately: result.data.publish_immediately, - work_efficiency: result.data.work_efficiency, - end_immediately: result.data.end_immediately, - code_review: result.data.code_review, - challenges_count:result.data.challenges_count, - }) - this.props.Getdataback(result,result.data); - this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1); - } } - }).catch((error) => { - console.log(error) - this.setState({ - loadingstate: false, - }) - }) - } - - //开始排序操作 - Startsorting = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => { - //要提交的作品状态checkedValuesine - //要提交的分班状态checkedValuesineinfo - //searchtext 输入的姓名和学号 - //order 排序时间 - //debug=t 是老师的意思 - // console.log(ordervlue)7009 - - var homeworkid = this.props.match.params.homeworkid; - let urll = `/homework_commons/${homeworkid}/works_list.json?`; - var order = "asc"; - if (ordervlue === "update_time") { - order = "desc"; - } - var checkedValuesines = checkedValuesine; - var checkedValuesineinfos = checkedValuesineinfo; - var searchtexts = searchtext - var data = { - search: searchtexts, - order: ordervlue, - b_order: order, - work_status: checkedValuesines, - course_group: checkedValuesineinfos, - page: page, - limit: limit, - } - // console.log("Startsorting"); - // console.log(data); - axios.post(urll, data).then((result) => { - // if (result.status === 200) {/] - // console.log(url) - // console.log("作品列表______________________") - // console.log(JSON.stringify(result)) - if(this.props.isNotMember()===false){ - if (result !== undefined) { - this.setState({ - teacherdata: result.data, - task_status: result.data.task_status, - course_group_info: result.data.course_group_info, - loadingstate: false, - jobsettingsdata: result, - allow_late:result.data.allow_late, - publish_immediately: result.data.publish_immediately, - work_efficiency: result.data.work_efficiency, - end_immediately: result.data.end_immediately, - code_review: result.data.code_review, - challenges_count:result.data.challenges_count, - }) - this.props.Getdataback(result,result.data); - this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,page); - } - } - // } - }).catch((error) => { - console.log(error) - this.setState({ - loadingstate: false - }) - }) - - - - } - - TablePagination = (e) => { - // console.log(e.current); - var teacherlist = { //分页 - total: this.state.teacherdata.student_works.length, //数据总数量 - pageSize: 20, //一页显示几条 - current: e.current, - } - this.setState({ - page: e.current, - teacherlist: teacherlist - }) - - } - - - // 设置数据 - seacthdata = (teacherdata,student_works,work_efficiency,course_group_info) => { - let {page, limit} = this.state; - let datalist = []; - let columns = this.state.columns; - var columns2=[]; - if (teacherdata !== undefined) { - for (var i = 0; i < student_works.length; i++) { - var timedata = moment(student_works[i].update_time).format('YYYY-MM-DD HH:mm'); - datalist.push({ - myid: student_works[i].id, - number: (parseInt(page) - 1) * parseInt(limit) + (i + 1), - name: student_works[i].user_name, - stduynumber: student_works[i].student_id, - classroom: student_works[i].group_name, - cost_time: student_works[i].cost_time, - submitstate:student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时提交" :student_works[i].work_status === 2 ? "延时提交" : "未提交", - // updatetime:this.state.teacherdata.student_works[i].update_time, - // updatetime:"", - updatetime: timedata === "Invalid date" ? "--" : timedata, - completion: student_works[i].complete_count === null ? "0" :student_works[i].complete_count === undefined ? "0": student_works[i].complete_count, - levelscore: student_works[i].final_score, - efficiencyscore: student_works[i].eff_score==="0.0"?"--":student_works[i].eff_score==="0"?"--":student_works[i].eff_score, - finalscore: student_works[i].work_score, - operating: "查看", - late_penalty: student_works[i].late_penalty=== null?"0":student_works[i].late_penalty === undefined?"0":student_works[i].late_penalty, - ultimate_score:student_works[i].ultimate_score, - user_name: student_works[i].user_name, - user_login: student_works[i].user_login, - }) - - } - - var teacherlist = { //分页 - total: student_works.length, //数据总数量 - pageSize: 20, //一页显示几条 - current: page, - } - if (work_efficiency === false) { - if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined||course_group_info === null){ - //这里没有分班 没有 关卡得分 没有效率分 - for(var i=0;i< this.state.columns.length;i++){ - var item = this.state.columns[i]; - if(item.title==="分班"){ - } - else if(item.title==="关卡得分"){ - } - else if(item.title==="效率分"){ - } - else if(this.props.isNotMember()===true&&item.title==="学号") { - - }else{ - columns2.push(item); - } - } - - - }else{ - if(course_group_info.length < 2){ - for(var i=0;i< this.state.columns.length;i++){ - var item = this.state.columns[i]; - if(item.title==="分班"){ - } - else if(item.title==="关卡得分"){ - } - else if(item.title==="效率分"){ - } - else if(this.props.isNotMember()===true&&item.title==="学号") { - - }else{ - columns2.push(item); - } - } - - }else { - for(var i=0;i< this.state.columns.length;i++){ - var item = this.state.columns[i]; - if(item.title==="关卡得分"){ - } - else if(item.title==="效率分"){ - } - else if(this.props.isNotMember()===true&&item.title==="学号") { - - }else{ - columns2.push(item); - } - } - } - } - }else { - if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined || course_group_info === null){ - - - for(var i=0;i< this.state.columns.length;i++){ - var item = this.state.columns[i]; - if(item.title==="分班"){ - } - else if(this.props.isNotMember()===true&&item.title==="学号") { - - }else{ - columns2.push(item); - } - } - - - - - }else { - if(course_group_info.length < 2) { - for(var i=0;i< this.state.columns.length;i++){ - var item = this.state.columns[i]; - if(item.title==="分班"){ - } - else if(this.props.isNotMember()===true&&item.title==="学号") { - - }else{ - columns2.push(item); - } - } - } - columns2=this.state.columnss; - } - } - - } else { - var teacherlist = undefined; - } - this.setState({ - data: datalist, - teacherlist: teacherlist, - columns: columns2, - loadingstate: false, - }) - } - //作品状态 - funtaskstatus = (checkedValues, data) => { - - if (JSON.stringify(checkedValues) === "[]") { - // console.log(checkedValues); - this.setState({ - unlimited: 0, - course_groupyslstwo: [], - loadingstate: true, - page:1, - }) - this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); - } else if (checkedValues.length === data.length) { - this.setState({ - unlimited: 0, - course_groupyslstwo: [], - loadingstate: true, - page:1, - }) - this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); - } else { - // console.log(checkedValues); - this.setState({ - course_groupyslstwo: checkedValues, - unlimited: 1, - loadingstate: true, - page:1, - }) - this.Startsorting(this.state.order, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); - } - - } - //作品状态2 - funtaskstatustwo = (checkedValues, data) => { - // console.log("funtaskstatustwo"); - // console.log(checkedValues); - if (JSON.stringify(checkedValues) === "[]") { - // console.log(checkedValues); - this.setState({ - unlimitedtwo: 1, - course_groupysls: undefined, - checkedValuesineinfo:[], - loadingstate: true, - page: 1, - }) - this.Startsorting(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit); - } else if (checkedValues.length === data.length) { - this.setState({ - unlimitedtwo: 1, - course_groupysls: undefined, - checkedValuesineinfo:[], - loadingstate: true, - page: 1, - }) - this.Startsorting(this.state.order, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit); - } else { - this.setState({ - checkedValuesineinfo: checkedValues, - course_groupysls: checkedValues, - unlimitedtwo: 0, - loadingstate: true, - page: 1, - }) - this.Startsorting(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit); - - - } - - } - //搜索学生 文字输入 - inputSearchValues = (e) => { - // console.log(e.target.value) - if (e.target.value === "") { - this.setState({ - searchtext: undefined - }) - } else { - this.setState({ - searchtext: e.target.value - }) - } - - } - - //搜索学生按钮输入 - searchValues = (value) => { - //点击直接搜索 - // if(value === ""){ - // message.error("请输入姓名或学号搜索"); - // return - // } - this.setState({ - loadingstate: true - }) - this.Startsorting(this.state.order, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, this.state.page, this.state.limit); - // console.log(value) - - - } - - // 输入关键字后按回车,自动提交 - onSearchKeywordKeyUp = (e) => { - if (e.keyCode === 13) { - // this.onSearch(); - // console.log("使用了回车键"); - this.setState({ - loadingstate: true - }) - this.Startsorting(this.state.order, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); - } - } - //排序 - funorder = (e) => { - if (e === "update_time") { - // 时间 - // 时间排序是从小到大 - this.setState({ - order: "update_time", - loadingstate: true, - }) - this.Startsorting("update_time", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); - } - - if (e === "work_score") { - // 成绩 - //成绩排序是从大到小 - this.setState({ - order: "work_score", - loadingstate: true, - }) - this.Startsorting("work_score", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); - } - - if (e === "student_id") { - //学号 - //学号排序是从大到小 - this.setState({ - order: "student_id", - loadingstate: true, - }) - this.Startsorting("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); - } - } - - - // 调分 - - // 查看学员实训信息 - Viewstudenttraininginformation = (e) => { - // console.log("Viewstudenttraininginformation"); - // console.log(e); - this.setState({ - userids: e.myid, - }) - this.viewtraining(e.myid); - } - // 关闭调分 - cancelModulationModels = () => { - this.setState({visibles: false}) - } - // 关闭查看 - cancelModulationModel = () => { - this.setState({visible: false}) - } - // 调分 - Viewstudenttraininginformations = (e) => { - // console.log("Viewstudenttraininginformations2"); - // console.log(e.myid); - this.setState({ - visible: true, - userid: e.myid, - // Tune: - }) - } - //确定 - saveModulationModal = (value, num) => { - var userid = this.state.userid; - const url = `/student_works/${userid}/adjust_score.json`; - // console.log(url); - axios.post(url, { - score: num, - comment: value - }) - .then((response) => { - if (response.data.status == '0') { - this.setState({visible: false}); - this.props.showNotification(`调分成功`); - - this.Startsorting(this.state.order, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); - } - }) - .catch(function (error) { - console.log(error); - }); - } - - viewtraining = (userids) => { - // console.log(JSON.stringify(this.props.user)) - var url = `/student_works/${userids}/shixun_work.json`; - axios.get(url).then((result) => { - if (result.status === 200) { - // console.log("TraineetraininginformationModal.js") - // console.log(JSON.stringify(result)) - let datalist = []; - var game_list = result.data.game_list - var boolgalist=true; - var experience=0; - for (var i = 0; i < game_list.length; i++) { - - datalist.push({ - number: "第" + game_list[i].position + "关", - name: moment(game_list[i].end_time).format('YYYY-MM-DD HH:mm'), - stduynumber: game_list[i].cost_time, - classroom: game_list[i].score, - complete_status: game_list[i].complete_status, - }) - experience=game_list[i].score+experience; - - if(game_list[i].complete_status === 2 || game_list[i].complete_status===3){ - boolgalist=false; - } - - } - // console.log("viewtraining"); - // console.log(datalist); - // console.log(JSON.stringify(datalist)); - this.setState({ - viewtrainingdata: result.data, - visibles: true, - game_list: datalist, - experience:experience, - boolgalist:boolgalist, - }) - } - }).catch((error) => { - - }) - } - - - //立即发布 - homeworkstart = () => { - let homeworkid = this.props.match.params.homeworkid; - let url = "/homework_commons/" + homeworkid + "/publish_groups.json"; - - - axios.get(url).then((response) => { - - if (response.status === 200) { - let starttime = this.props.getNowFormatDates(1); - let endtime = this.props.getNowFormatDates(2); - this.setState({ - modalname: "立即发布", - modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, - svisible: true, - Topval:"学生将立即收到作业", - // Botvalleft:"暂不发布", - Botval:`本操作只对"未发布"的分班有效`, - starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), - endtime: "截止时间:" + endtime, - starttimes:starttime, - typs:"start", - Cancelname: "暂不发布", - Savesname: "立即发布", - Cancel: this.homeworkhide, - Saves: this.homeworkstartend, - course_groups: response.data.course_groups, - }) - } - }).catch((error) => { - console.log(error) - }); - - } - //立即截止 - homeworkends = () => { - console.log("1160"); - let homeworkid = this.props.match.params.homeworkid; - let url = "/homework_commons/" + homeworkid + "/end_groups.json"; - - axios.get(url).then((response) => { - - if (response.status === 200) { - this.setState({}) - this.setState({ - modalname: "立即截止", - modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, - svisible: true, - Topval:"学生将不能再提交作业", - // Botvalleft:"暂不截止", - Botval:`本操作只对"提交中"的分班有效`, - Cancelname: "暂不截止", - Savesname: "立即截止", - Cancel: this.homeworkhide, - Saves: this.coursetaskend, - starttime: undefined, - endtime: undefined, - course_groups: response.data.course_groups, - typs:"end", - }) - } - }).catch((error) => { - console.log(error) - }); - } -// 立即发布 - homeworkstartend = (ds,endtime) => { - var homeworkid = this.props.match.params.homeworkid; - let {course_groupslist} = this.state; - - let coursesId = this.props.match.params.coursesId; - let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json"; - axios.post(url, { - homework_ids: [homeworkid], - group_ids: course_groupslist, - end_time:endtime, - }).then((result) => { - if (result.status === 200) { - if (result.data.status === 0) { - notification.open({ - message: "提示", - description: result.data.message - }); - this.homeworkhide() - } - - } - }).catch((error) => { - console.log(error); - }) - } - notlimiteds = () => { - this.setState({ - checkedValuesine: undefined, - course_groupyslstwo: [], - unlimited: 0, - loadingstate: true, - page:1, - }) - this.Startsorting(this.state.order, [], this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); - - } - notlimitedst = () => { - // console.log(this.state.course_group_info); - this.setState({ - unlimitedtwo: 1, - checkedValuesineinfo: [], - course_groupysls: undefined, - loadingstate: true, - }) - this.Startsorting(this.state.order, this.state.course_groupyslstwo, [], this.state.searchtext, 1, this.state.limit); - } - //立即截止确定按钮 - coursetaskend = () => { - var homeworkid = this.props.match.params.homeworkid; - let {course_groupslist} = this.state; - - - const cid = this.props.match.params.coursesId; - let url = "/courses/" + cid + "/homework_commons/end_homework.json"; - axios.post(url, { - group_ids: course_groupslist, - homework_ids: [homeworkid], - }) - .then((response) => { - if (response.data.status == 0) { - notification.open({ - message: "提示", - description: response.data.message - }); - this.homeworkhide() - } - }) - .catch(function (error) { - console.log(error); - }); - } - - getcourse_groupslist = (id) => { - this.setState({ - course_groupslist: id - }) - - } - - homeworkhide = () => { - this.isupdatas() - this.setState({ - modalname: undefined, - modaltype: undefined, - svisible: false, - Topval: undefined, - Topvalright: undefined, - Botvalleft: undefined, - Botval: undefined, - starttime: undefined, - endtime: undefined, - Cancelname: undefined, - Savesname: undefined, - Cancel: undefined, - Saves: undefined, - StudentList_value: undefined, - addname: undefined, - addnametype: false, - addnametab: undefined, - course_groupyslstwo: undefined, - typs:undefined, - starttimes:undefined, - }) - } - - - workshowmodel = () => { - this.setState({ - showmodel: true - }) - } - - hideshowmodel = () => { - this.setState({ - showmodel: false - }) - } - - paginationonChanges = (pageNumber) => { - this.setState({ - page: pageNumber, - loadingstate: true, - }) - this.Startsorting(this.state.order, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, this.state.limit); - - } - - setComputeTime=()=>{ - this.setState({ - computeTimetype:false - }) - let homeworkid = this.props.match.params.homeworkid; - let url = "/homework_commons/"+homeworkid+"/update_score.json"; - - axios.get(url).then((response) => { - if(response){ - this.props.showNotification(response.data.message); - this.setState({ - loadingstate: true - }) - this.Startsorting(this.state.order, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); - } - }).catch((error) => { - console.log(error) - }); - - } - - render() { // console.log("Listofworks.js000") - let {columns,computeTimetype, page, boolgalist,limit,experience,course_groupysls, course_groupyslstwo, unlimited, unlimitedtwo, loadingstate, viewtrainingdata, game_list, data, course_group_info, order, teacherdata, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, jobsettingsdata} = this.state; + let {columns,computeTimetype, page, boolgalist,limit,experience,course_groupysls, course_groupyslstwo, unlimited, unlimitedtwo, loadingstate, viewtrainingdata, game_list, data, course_group_info, orders, teacherdata, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, jobsettingsdata} = this.state; // // console.log(teacherdata&&teacherdata.shixun_identifier) // console.log(this.props.teacherdata&&this.props.teacherdata.publish_immediately) @@ -1527,9 +789,9 @@ class Listofworks extends Component { id="subject_search_input" autoComplete="off" value={searchtext} - onKeyUp={(e) => this.onSearchKeywordKeyUp(e)} - onInput={this.inputSearchValues} - onSearch={this.searchValues} + onKeyUp={(e) => this.onSearchKeywordKeyUpt(e)} + onInput={this.inputSearchValuest} + onSearch={this.searchValuest} > @@ -1541,7 +803,7 @@ class Listofworks extends Component { className={unlimited === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "} onClick={() => this.notlimiteds()}>不限 this.funtaskstatus(e, task_status && task_status)} + onChange={(e) => this.funtaskstatust(e, task_status && task_status)} style={{paddingTop: '4px'}}> {task_status === undefined ? "" : task_status.map((item, key) => { @@ -1572,7 +834,7 @@ class Listofworks extends Component { className={unlimitedtwo === 0 ? "pl10 pr10 mr20 " : "pl10 pr10 mr20 check_on"} onClick={() => this.notlimitedst()}>不限 this.funtaskstatustwo(e, course_group_info && course_group_info)} + onChange={(e) => this.funtaskstatustwot(e, course_group_info && course_group_info)} style={{paddingTop: '4px',width:'1017px'}}> {course_group_info === undefined ? "" : course_group_info.map((item, key) => { @@ -1611,12 +873,12 @@ class Listofworks extends Component { - {order === "update_time" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序 + {orders === "update_time" ? "时间" : orders === "work_score" ? "成绩" : orders === "student_id" ? "学号" : ""}排序 - this.funorder("update_time")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>更新时间 - this.funorder("work_score")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>最终成绩 - this.funorder("student_id")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>学生学号 + this.funordert("update_time")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>更新时间 + this.funordert("work_score")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>最终成绩 + this.funordert("student_id")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>学生学号 diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index a2343abf8..49c640419 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2,10 +2,27 @@ import React, {Component} from "react"; import CoursesListType from '../coursesPublic/CoursesListType'; import {WordsBtn, ActionBtn} from 'educoder'; import { + Form, + Select, + Input, + Button, + Checkbox, + Upload, + Icon, + message, + Modal, Table, Pagination, + Radio, + Tooltip, + notification } from "antd"; -import {Link} from 'react-router-dom'; +import './style.css'; +import 'moment/locale/zh-cn'; +const Search = Input.Search; +const RadioGroup = Radio.Group; +const CheckboxGroup = Checkbox.Group; +const {Option} = Select; import axios from 'axios'; import moment from 'moment'; import '../css/members.css' @@ -15,7 +32,10 @@ import {getImageUrl} from 'educoder'; import TraineetraininginformationModal from "./TraineetraininginformationModal"; import DownloadMessageysl from '../../modals/DownloadMessageysl'; import Startshixuntask from "../coursesPublic/Startshixuntask"; - +import ModulationModal from "../coursesPublic/ModulationModal"; +import HomeworkModal from "../coursesPublic/HomeworkModal"; +import ShixunWorkModal from "./Shixunworkdetails/ShixunWorkModal"; +import {getImageUrl} from 'educoder'; //GraduationTaskssetting.js @@ -66,7 +86,7 @@ class Listofworksstudentone extends Component { startbtn: false, DownloadType:false, DownloadMessageval:undefined, - columns: [ + columnsstu: [ { title: '序号', dataIndex: 'number', @@ -329,130 +349,1050 @@ class Listofworksstudentone extends Component { ), }, ], - work_efficiency:true, - } - // - } - - componentDidMount() { - console.log("Listofworksstudentone"); - console.log("componentDidMount"); - this.props.triggerRef(this); - // var homeworkid = this.props.match.params.homeworkid; - // this.Getalistofworks(homeworkid); - this.Getalistofworkstwo("", "", "", "", 1, 20); - let query = this.props.location.pathname; - const type = query.split('/'); - this.setState({ - shixuntypes: type[3] - }) - } + orders: "update_time", + b_order:"desc", + allow_late:false, + checkedValuesine: undefined, + checkedValuesineinfo: [], + work_efficiency: false, + resultint: 0, + teacherlist: undefined, + searchtext: "", + course_groupysls: undefined, + course_groupyslstwo: [], + visible: false, + userid: 0, + course_group: null, + publish_immediately: undefined, + end_immediately: undefined, + mystyle: {"display": "block", "color": '#07111B', "text-align": "center"}, + mystyles: {"display": "none", "color": '#07111B', "text-align": "center"}, + mystyle1: {"display": "block"}, + mystyles1: {"display": "none"}, + unlimited: 0, + unlimitedtwo: 1, + code_review: false, + boolgalist:true, + challenges_count:0, + experience:0, + columns: [ + { + title: '序号', + dataIndex: 'number', + key: 'number', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.number} + + ) + }, + { + title: '姓名', + dataIndex: 'name', + key: 'name', + align: 'center', + className:'font-14', + width:'120px', + render: (text, record) => ( + {record.name} + ) + }, + { + title: '学号', + dataIndex: 'stduynumber', + key: 'stduynumber', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} + + ), + }, + { + title: '分班', + key: 'classroom', + dataIndex: 'classroom', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.classroom} + ) + }, + { + title: '提交状态', + dataIndex: 'submitstate', + key: 'submitstate', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.submitstate} + + ) - //卸载组件取消倒计时 - componentWillUnmount() { - // clearInterval(this.timer); - } - - // 获取作品列表 - Getalistofworks = (homeworkid) => { - // console.log("获取作品列表"); + }, + { + title: '实战耗时', + dataIndex: 'cost_time', + key: 'cost_time', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time } + + ) - let urll = `/homework_commons/${homeworkid}/works_list.json`; - var data = { - search: "", - order: "", - b_order: "desc", - page: 1, - limit: 20, - work_status: "", - course_group: "", - } - axios.post(urll, data).then((result) => { - if(result === undefined){ - return - } + }, + { + title: '更新时间', + dataIndex: 'updatetime', + key: 'updatetime', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.updatetime} + ), + }, + { + title: '完成情况', + dataIndex: 'completion', + key: 'completion', + align: 'center', + className:'font-14', + render: (text, record) => ( + - if (result.status === 200) { - if(this.props.isNotMember()===false) { - this.setState({ - teacherdata: result.data, - task_status: result.data.task_status, - course_group_info: result.data.course_group_info, - student_works: result.data.student_works, - jobsettingsdata: result, - publish_immediately: result.data.publish_immediately, - end_immediately: result.data.end_immediately, - id: result.data.id, - work_efficiency: result.data.work_efficiency, - code_review: result.data.code_review, - challenges_count: result.data.challenges_count, - view_report: result.data.view_report, - }) - this.props.Getdataback(result,result.data); - if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { - this.seacthdata(result.data); - } else { - this.seacthdatas(result.data, result.data.student_works); - } + + 已通过{record.completion}关,共{this.state.challenges_count}关 + }> + {record.completion+"/"+this.state.challenges_count} + - } - } - }).catch((error) => { - console.log(error); - }) - } + + ) + }, + { + title: '关卡得分', + dataIndex: 'levelscore', + key: 'levelscore', + align: 'center', + className:'font-14', + render: (text, record) => ( + + = 90 ? {"color": '#DD1717', "text-align": "center"} : { + "color": '#747A7F', + "text-align": "center" + }}>{record.levelscore} + + ) + }, + { + title: '效率分', + dataIndex: 'efficiencyscore', + key: 'efficiencyscore', + align: 'center', + className:'font-14', + render: (text, record) => ( + + { + record.efficiencyscore&& record.efficiencyscore=== "--"?( + this.state.allow_late&&this.state.allow_late===false? + + 作业截止时,系统根据学生在课堂成员中的效率表现自动评分 + }> + + -- + + + : + this.state.allow_late&&this.state.allow_late===true? + + 补交结束时,系统根据学生在课堂成员中的效率表现自动评分 + }> + + -- + + + : + + -- + + ) + : + = 90 ? { + "color": '#DD1717', + "text-align": "center" + } : {"color": '#747A7F', "text-align": "center"}}>{record.efficiencyscore} + } -// 获取作品列表 - Getalistofworkstwo = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => { - // console.log("获取作品列表"); - var homeworkid = this.props.match.params.homeworkid; - let urll = `/homework_commons/${homeworkid}/works_list.json`; - // console.log(homeworkid); + + ) + }, + { + title: '最终成绩', + dataIndex: 'finalscore', + key: 'finalscore', + align: 'center', + className:'font-14', + render: (text, record) => ( + + { + record.ultimate_score=== true? + + {record.user_name}{record.user_login} + {record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分} + }> + { + record.finalscore&&record.finalscore==="--"? + {record.finalscore} + : + = 90 ? {"color": '#DD1717', "text-align": "center"} : { + "color": '#747A7F', + "text-align": "center" + }}>{record.finalscore} + } + + : + + {record.user_name}{record.user_login} + {record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分} + {record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分} + {record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分} + {record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分} + }> + { + record.finalscore&&record.finalscore==="--"? + {record.finalscore} + : + = 90 ? {"color": '#DD1717', "text-align": "center"} : { + "color": '#747A7F', + "text-align": "center" + }}>{record.finalscore} + } + - // search:搜索关键字 - // order:排序方式:更新时间:update_time,最终成绩:work_score,学号:student_id - // b_order:desc:倒序 , asc:顺序 - // work_status:0:未提交, 1:按时提交, 2:延时提交,“”不限 - // course_group:分班情况 [232, 231], []:不限(空数组) - var order = "asc"; - if (ordervlue === "updated_at") { - order = "desc"; - } - var data = { - search: "", - order: ordervlue, - b_order: order, - work_status: "", - course_group: "", - page: page, - limit: limit, - } - axios.post(urll, data).then((result) => { - if (result.status === 200) { - // console.log("学生未截至未公开的作品列表") - // console.log(JSON.stringify(result)) - this.setState({ - teacherdata: result.data, - task_status: result.data.task_status, - course_group_info: result.data.course_group_info, - student_works: result.data.student_works, - loadingstate: false, - jobsettingsdata: result, - publish_immediately: result.data.publish_immediately, - work_efficiency: result.data.work_efficiency, - end_immediately: result.data.end_immediately, - code_review: result.data.code_review, + } + + ) + }, + { + title: '操作', + dataIndex: 'operating', + key: 'operating', + display: 'block', + align: 'center', + className:'font-14', + render: (text, record) => ( + record.submitstate === "未提交" ? -- : + + this.Viewstudenttraininginformationt(record)}>{record.operating} + + ) + }, + ], + columnss: [ + { + title: '序号', + dataIndex: 'number', + key: 'number', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.number} + + ) + }, + { + title: '姓名', + dataIndex: 'name', + key: 'name', + align: 'center', + className:'font-14', + width:'120px', + render: (text, record) => ( + {record.name} + ) + }, + { + title: '学号', + dataIndex: 'stduynumber', + key: 'stduynumber', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber} + + ), + }, + { + title: '分班', + key: 'classroom', + dataIndex: 'classroom', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.classroom} + ) + }, + { + title: '提交状态', + dataIndex: 'submitstate', + key: 'submitstate', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.submitstate} + + ) + + }, + { + title: '更新时间', + dataIndex: 'updatetime', + key: 'updatetime', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.updatetime} + ), + }, + { + title: '实战耗时', + dataIndex: 'cost_time', + key: 'cost_time', + align: 'center', + className:'font-14', + render: (text, record) => ( + {record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time } + + ) + + }, + { + title: '完成情况', + dataIndex: 'completion', + key: 'completion', + align: 'center', + className:'font-14', + render: (text, record) => ( + + + + 已通过{record.completion}关,共{this.state.challenges_count}关 + }> + {record.completion+"/"+this.state.challenges_count} + + + + ) + }, + { + title: '关卡得分', + dataIndex: 'levelscore', + key: 'levelscore', + align: 'center', + className:'font-14', + render: (text, record) => ( + + = 90 ? {"color": '#DD1717', "text-align": "center"} : { + "color": '#747A7F', + "text-align": "center" + }}>{record.levelscore} + + ) + }, + { + title: '效率分', + dataIndex: 'efficiencyscore', + key: 'efficiencyscore', + align: 'center', + className:'font-14', + render: (text, record) => ( + + { + record.efficiencyscore&& record.efficiencyscore=== "--"?( + this.state.allow_late&&this.state.allow_late===false? + + 作业截止时,系统根据学生在课堂成员中的效率表现自动评分 + }> + + -- + + + : + this.state.allow_late&&this.state.allow_late===true? + + 补交结束时,系统根据学生在课堂成员中的效率表现自动评分 + }> + + -- + + + : + + -- + + ) + : + = 90 ? { + "color": '#DD1717', + "text-align": "center" + } : {"color": '#747A7F', "text-align": "center"}}>{record.efficiencyscore} + } + + + ) + }, + { + title: '最终成绩', + dataIndex: 'finalscore', + key: 'finalscore', + align: 'center', + className:'font-14', + render: (text, record) => ( + + { + record.ultimate_score=== true? + + {record.user_name}{record.user_login} + {record.finalscore === "--"?最终调整成绩:0分 :最终调整成绩:{record.finalscore}分} + }> + { + record.finalscore&&record.finalscore==="--"? + {record.finalscore} + : + = 90 ? {"color": '#DD1717', "text-align": "center"} : { + "color": '#747A7F', + "text-align": "center" + }}>{record.finalscore} + } + + : + + {record.user_name}{record.user_login} + {record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分} + {record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分} + {record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分} + {record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分} + }> + { + record.finalscore&&record.finalscore==="--"? + {record.finalscore} + : + = 90 ? {"color": '#DD1717', "text-align": "center"} : { + "color": '#747A7F', + "text-align": "center" + }}>{record.finalscore} + } + + + } + + ) + }, + { + title: '操作', + dataIndex: 'operating', + key: 'operating', + display: 'block', + align: 'center', + className:'font-14', + render: (text, record) => ( + record.submitstate === "未提交" ? -- : + + this.Viewstudenttraininginformationt(record)}>{record.operating} + + ) + }, + ], + } + // + } + + componentDidMount() { + console.log("componentDidMount"); + if(this.props.isAdmin() === true){ + this.tearchar(); + }else{ + this.student(); + } + } + student=()=>{ + this.props.triggerRef(this); + // var homeworkid = this.props.match.params.homeworkid; + // this.Getalistofworks(homeworkid); + let query = this.props.location.pathname; + const type = query.split('/'); + this.setState({ + shixuntypes: type[3] + }) + } + + + //卸载组件取消倒计时 + componentWillUnmount() { + // clearInterval(this.timer); + } + + // 获取作品列表 + Getalistofworks = (homeworkid) => { + // console.log("获取作品列表"); + + let urll = `/homework_commons/${homeworkid}/works_list.json`; + var data = { + search: "", + order: "", + b_order: "desc", + page: 1, + limit: 20, + work_status: "", + course_group: "", + } + axios.post(urll, data).then((result) => { + if(result === undefined){ + return + } + + if (result.status === 200) { + if(this.props.isNotMember()===false) { + this.setState({ + teacherdata: result.data, + task_status: result.data.task_status, + course_group_info: result.data.course_group_info, + student_works: result.data.student_works, + jobsettingsdata: result, + publish_immediately: result.data.publish_immediately, + end_immediately: result.data.end_immediately, + id: result.data.id, + work_efficiency: result.data.work_efficiency, + code_review: result.data.code_review, + challenges_count: result.data.challenges_count, + view_report: result.data.view_report, + }) + this.props.Getdataback(result,result.data); + if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { + this.seacthdata(result.data); + } else { + this.seacthdatas(result.data, result.data.student_works); + } + + } + } + }).catch((error) => { + console.log(error); + }) + } + +// 获取作品列表 + Getalistofworkstwo = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => { + // console.log("获取作品列表"); + var homeworkid = this.props.match.params.homeworkid; + let urll = `/homework_commons/${homeworkid}/works_list.json`; + // console.log(homeworkid); + + // search:搜索关键字 + // order:排序方式:更新时间:update_time,最终成绩:work_score,学号:student_id + // b_order:desc:倒序 , asc:顺序 + // work_status:0:未提交, 1:按时提交, 2:延时提交,“”不限 + // course_group:分班情况 [232, 231], []:不限(空数组) + var order = "asc"; + if (ordervlue === "updated_at") { + order = "desc"; + } + var data = { + search: "", + order: ordervlue, + b_order: order, + work_status: "", + course_group: "", + page: page, + limit: limit, + } + axios.post(urll, data).then((result) => { + if (result.status === 200) { + // console.log("学生未截至未公开的作品列表") + // console.log(JSON.stringify(result)) + this.setState({ + teacherdata: result.data, + task_status: result.data.task_status, + course_group_info: result.data.course_group_info, + student_works: result.data.student_works, + loadingstate: false, + jobsettingsdata: result, + publish_immediately: result.data.publish_immediately, + work_efficiency: result.data.work_efficiency, + end_immediately: result.data.end_immediately, + code_review: result.data.code_review, + challenges_count:result.data.challenges_count, + view_report:result.data.view_report, + }) + this.props.Getdataback(result,result.data); + if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { + this.seacthdata(result.data); + } else { + this.seacthdatas(result.data,result.data.student_works); + } + + } + }).catch((error) => { + console.log(error) + this.setState({ + loadingstate: false + }) + }) + } + TablePagination = (e) => { + // console.log(e.current); + this.setState({ + page: e.current + }) + + } + + seacthdatas = (teacherdata,student_works) => { + let {page, limit,work_efficiency} = this.state; + let datalist = []; + let datalists = []; + var styletable = {"display": "none"} + var arr =[]; + for(var i=0;i { + let datalist = []; + + + var arr =[]; + for(var i=0;i { + // console.log("Listofworksstudentone.js"); + // console.log(e); + this.setState({ + userids: e.myid, + }) + this.viewtraining(e.myid); + } + viewtraining = (userids) => { + // console.log("viewtraining") + // console.log(userids) + // console.log(JSON.stringify(this.props.user)) + var url = `/student_works/${userids}/shixun_work.json`; + axios.get(url).then((result) => { + if (result.status === 200) { + // console.log("Listofworksstudentone.js") + // console.log(JSON.stringify(result)) + let datalist = []; + var game_list = result.data.game_list + var boolgalist=true; + var experience=0; + for (var i = 0; i < game_list.length; i++) { + + datalist.push({ + number: "第" + game_list[i].position + "关", + name: moment(game_list[i].end_time).format('YYYY-MM-DD HH:mm'), + stduynumber: game_list[i].cost_time, + classroom: game_list[i].score, + complete_status: game_list[i].complete_status, + }) + experience=game_list[i].score+experience; + + if(game_list[i].complete_status === 2 || game_list[i].complete_status===3){ + boolgalist=false; + } + } + // console.log("viewtraining"); + // console.log(datalist); + // console.log(JSON.stringify(datalist)); + this.setState({ + viewtrainingdata: result.data, + visibles: true, + game_list: datalist, + experience:experience, + boolgalist:boolgalist, + }) + } + }).catch((error) => { + + }) + } + + // 关闭调分 + cancelModulationModels = () => { + this.setState({visibles: false}) + } + //排序 + funorder = (e) => { + if (e === "updated_at") { + // 时间 + // 时间排序是从小到大 + this.setState({ + order: "updated_at", + loadingstate: true, + }) + this.Getalistofworkstwo(e, "", "", "", this.state.page, this.state.limit); + } + + if (e === "work_score") { + // 成绩 + //成绩排序是从大到小 + this.setState({ + order: "work_score", + loadingstate: true, + }) + this.Getalistofworkstwo(e, "", "", "", this.state.page, this.state.limit); + } + + if (e === "student_id") { + //学号 + //学号排序是从大到小 + this.setState({ + order: "student_id", + loadingstate: true, + }) + this.Getalistofworkstwo(e, "", "", "", this.state.page, this.state.limit); + } + } + + Startsorting = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => { + // console.log("获取作品列表Listofworksstudenttwo"); + var homeworkid = this.props.match.params.homeworkid; + let urll = `/homework_commons/${homeworkid}/works_list.json`; + // console.log(homeworkid); + + // search:搜索关键字 + // order:排序方式:更新时间:update_time,最终成绩:work_score,学号:student_id + // b_order:desc:倒序 , asc:顺序 + // work_status:0:未提交, 1:按时提交, 2:延时提交,“”不限 + // course_group:分班情况 [232, 231], []:不限(空数组) + var order = "asc"; + if (ordervlue === "updated_at") { + order = "desc"; + } + var data = { + search: "", + order: ordervlue, + b_order: order, + work_status: "", + course_group: "", + page: page, + limit: limit, + + } + axios.post(urll, data).then((result) => { + if (result !== undefined) { + // console.log("学生公开的作品列表") + // console.log(JSON.stringify(result)) + if(this.props.isNotMember()===false) { + this.setState({ + teacherdata: result.data, + task_status: result.data.task_status, + course_group_info: result.data.course_group_info, + student_works: result.data.student_works, + loadingstate: false, + jobsettingsdata: result, + publish_immediately: result.data.publish_immediately, + work_efficiency: result.data.work_efficiency, + end_immediately: result.data.end_immediately, + code_review: result.data.code_review, challenges_count:result.data.challenges_count, view_report:result.data.view_report, }) - this.props.Getdataback(result,result.data); - if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { + this.props.Getdataback(result,result.data); this.seacthdata(result.data); - } else { - this.seacthdatas(result.data,result.data.student_works); - } - + } } }).catch((error) => { console.log(error) @@ -460,115 +1400,214 @@ class Listofworksstudentone extends Component { loadingstate: false }) }) + } + TablePagination = (e) => { // console.log(e.current); + var teacherlists = { //分页 + total: this.state.student_works.length, //数据总数量 + pageSize: 10, //一页显示几条 + current: e.current, + } this.setState({ - page: e.current + page: e.current, + teacherlists: teacherlists }) } - seacthdatas = (teacherdata,student_works) => { - let {page, limit,work_efficiency} = this.state; - let datalist = []; - let datalists = []; - var styletable = {"display": "none"} - var arr =[]; - for(var i=0;i { + this.setState({ + page: pageNumber, + loadingstate: true, + }) + this.Getalistofworkstwo(this.state.order, "", "", "", pageNumber, this.state.limit); + } + //计算成绩 + setComputeTime=()=>{ + let {teacherdata}=this.state; + this.setState({ + computeTimetype:false + }) + let homeworkid = this.props.match.params.homeworkid; + let url = "/homework_commons/"+homeworkid+"/update_student_score.json?shixun_id="+teacherdata.shixun_id; - }else{ - arr.push(item); - } + axios.get(url).then((response) => { + this.props.showNotification(`${response.data.message}`); + // var homeworkid = this.props.match.params.homeworkid; + this.Getalistofworks(homeworkid); + // this.Getalistofworkstwo("", "", "", "", 1, 20); + }).catch((error) => { + console.log(error) + }); + + } + + + /////////老师操作 + tearchar=()=>{ + this.props.triggerRef(this) + var homeworkid = this.props.match.params.homeworkid; + // console.log(homeworkid) + // this.Gettitleinformation(homeworkid); + this.Getalistofworkst(homeworkid); + let query = this.props.location.pathname; + const type = query.split('/'); + this.setState({ + shixuntypes: type[3] + }) + } + + isupdatas = () => { + var homeworkid = this.props.match.params.homeworkid; + // this.Gettitleinformation(homeworkid); + this.Getalistofworkst(homeworkid); + } + + // 获取作品列表 + Getalistofworkst = (homeworkid) => { + // console.log("获取作品列表");7009 + + let urll = `/homework_commons/${homeworkid}/works_list.json`; + // console.log(homeworkid); + + // search:搜索关键字 + // order:排序方式:更新时间:update_time,最终成绩:work_score,学号:student_id + // b_order:desc:倒序 , asc:顺序 + // work_status:0:未提交, 1:按时提交, 2:延时提交,“”不限 + // course_group:分班情况 [232, 231], []:不限(空数组) + var data = { + search: "", + order: this.state.orders, + b_order: "desc", + work_status: "", + course_group: "", + page:1, + limit:20, } - let columns2= arr; - var teacherlist = undefined; - var teacherlists = undefined; - if (teacherdata !== undefined) { - // console.log("seacthdata设置数据") - // console.log(this.state.teacherdata.id ) - if (teacherdata.id === undefined) { - this.setState({ - data: [], - teacherlist: undefined, - loadingstate: false, - styletable: styletable, - }) + axios.post(urll, data).then((result) => { - } else { - console.log(teacherdata) - if (teacherdata.id !== undefined || teacherdata.id !== null || teacherdata.id !== "") { - // console.log("seacthdata设置数据1") - // console.log(this.state.teacherdata ) - var timedata = moment(teacherdata.update_time).format('YYYY-MM-DD HH:mm'); - datalist.push({ - myid: teacherdata.id, - number: 1, - name: teacherdata.user_name, - stduynumber: teacherdata.student_id, - classroom: teacherdata.group_name, - cost_time: teacherdata.cost_time, - submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时提交" : teacherdata.work_status === 2 ? "延时提交" : "未提交", - // updatetime:this.state.teacherdata.student_works[i].update_time, - // updatetime:"", - updatetime: timedata === "Invalid date" ? "--" : timedata, - completion: teacherdata.complete_count === null ? "0" :teacherdata.complete_count === undefined ? "0": teacherdata.complete_count, - levelscore: teacherdata.final_score, - efficiencyscore: teacherdata.eff_score, - finalscore: teacherdata.work_score, - operating: "查看", - late_penalty: teacherdata.late_penalty=== null?"0":teacherdata.late_penalty === undefined?"0":teacherdata.late_penalty, - ultimate_score:teacherdata.ultimate_score, - user_name: teacherdata.user_name, - user_login: teacherdata.user_login, + if(this.props.isNotMember()===false){ + if (result !== undefined) { + // console.log(url) + // console.log("作品列表6789077") + // console.log(JSON.stringify(result)) + this.setState({ + teacherdata: result.data, + task_status: result.data.task_status, + allow_late:result.data.allow_late, + course_group_info: result.data.course_group_info, + loadingstate: false, + jobsettingsdata: result, + publish_immediately: result.data.publish_immediately, + work_efficiency: result.data.work_efficiency, + end_immediately: result.data.end_immediately, + code_review: result.data.code_review, + challenges_count:result.data.challenges_count, }) + this.props.Getdataback(result,result.data); + this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1); + } } + }).catch((error) => { + console.log(error) + this.setState({ + loadingstate: false, + }) + }) + } - // } - var teacherlist = { //分页 - total: teacherdata.student_works.length, //数据总数量 - pageSize: teacherdata.student_works.length, //一页显示几条 - current: this.state.page, - } - styletable = {"display": "block",} - } else { - // console.log("seacthdata设置数据2") - teacherlist = undefined; + //开始排序操作 + Startsortingt = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => { + //要提交的作品状态checkedValuesine + //要提交的分班状态checkedValuesineinfo + //searchtext 输入的姓名和学号 + //order 排序时间 + //debug=t 是老师的意思 + // console.log(ordervlue)7009 + var homeworkid = this.props.match.params.homeworkid; + let urll = `/homework_commons/${homeworkid}/works_list.json?`; + var order = "asc"; + if (ordervlue === "update_time") { + order = "desc"; + } + var checkedValuesines = checkedValuesine; + var checkedValuesineinfos = checkedValuesineinfo; + var searchtexts = searchtext + var data = { + search: searchtexts, + order: ordervlue, + b_order: order, + work_status: checkedValuesines, + course_group: checkedValuesineinfos, + page: page, + limit: limit, + } + // console.log("Startsorting"); + // console.log(data); + axios.post(urll, data).then((result) => { + // if (result.status === 200) {/] + // console.log(url) + // console.log("作品列表______________________") + // console.log(JSON.stringify(result)) + if(this.props.isNotMember()===false){ + if (result !== undefined) { + this.setState({ + teacherdata: result.data, + task_status: result.data.task_status, + course_group_info: result.data.course_group_info, + loadingstate: false, + jobsettingsdata: result, + allow_late:result.data.allow_late, + publish_immediately: result.data.publish_immediately, + work_efficiency: result.data.work_efficiency, + end_immediately: result.data.end_immediately, + code_review: result.data.code_review, + challenges_count:result.data.challenges_count, + }) + this.props.Getdataback(result,result.data); + this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,page); } } + // } + }).catch((error) => { + console.log(error) + this.setState({ + loadingstate: false + }) + }) - } - if (student_works !== undefined) { + } - for (var i = 0; i { + let {page, limit} = this.state; + let datalist = []; + let columns = this.state.columns; + var columns2=[]; + if (teacherdata !== undefined) { + for (var i = 0; i < student_works.length; i++) { var timedata = moment(student_works[i].update_time).format('YYYY-MM-DD HH:mm'); - datalists.push({ + datalist.push({ myid: student_works[i].id, number: (parseInt(page) - 1) * parseInt(limit) + (i + 1), name: student_works[i].user_name, stduynumber: student_works[i].student_id, classroom: student_works[i].group_name, cost_time: student_works[i].cost_time, - submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时提交" : student_works[i].work_status === 2 ? "延时提交" : "未提交", + submitstate:student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时提交" :student_works[i].work_status === 2 ? "延时提交" : "未提交", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, - completion: student_works[i].complete_count === null ? "0" :student_works[i].complete_count === undefined ? "0":student_works[i].complete_count, + completion: student_works[i].complete_count === null ? "0" :student_works[i].complete_count === undefined ? "0": student_works[i].complete_count, levelscore: student_works[i].final_score, efficiencyscore: student_works[i].eff_score==="0.0"?"--":student_works[i].eff_score==="0"?"--":student_works[i].eff_score, - finalscore:student_works[i].work_score, + finalscore: student_works[i].work_score, operating: "查看", late_penalty: student_works[i].late_penalty=== null?"0":student_works[i].late_penalty === undefined?"0":student_works[i].late_penalty, ultimate_score:student_works[i].ultimate_score, @@ -578,126 +1617,309 @@ class Listofworksstudentone extends Component { } - } - console.log("554"); - console.log(columns2); + var teacherlist = { //分页 + total: student_works.length, //数据总数量 + pageSize: 20, //一页显示几条 + current: page, + } + if (work_efficiency === false) { + if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined||course_group_info === null){ + //这里没有分班 没有 关卡得分 没有效率分 + for(var i=0;i< this.state.columns.length;i++){ + var item = this.state.columns[i]; + if(item.title==="分班"){ + } + else if(item.title==="关卡得分"){ + } + else if(item.title==="效率分"){ + } + else if(this.props.isNotMember()===true&&item.title==="学号") { + }else{ + columns2.push(item); + } + } - this.setState({ - data: datalist, - datas: datalists, - teacherlist: teacherlist, - teacherlists: teacherlists, - loadingstate: false, - styletable: styletable, - columns:columns2, - }) - } - // 设置数据 - seacthdata = (teacherdata) => { - let datalist = []; + }else{ + if(course_group_info.length < 2){ + for(var i=0;i< this.state.columns.length;i++){ + var item = this.state.columns[i]; + if(item.title==="分班"){ + } + else if(item.title==="关卡得分"){ + } + else if(item.title==="效率分"){ + } + else if(this.props.isNotMember()===true&&item.title==="学号") { - var arr =[]; - for(var i=0;i { + + if (JSON.stringify(checkedValues) === "[]") { + // console.log(checkedValues); + this.setState({ + unlimited: 0, + course_groupyslstwo: [], + loadingstate: true, + page:1, + }) + this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); + } else if (checkedValues.length === data.length) { + this.setState({ + unlimited: 0, + course_groupyslstwo: [], + loadingstate: true, + page:1, + }) + this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); + } else { + // console.log(checkedValues); + this.setState({ + course_groupyslstwo: checkedValues, + unlimited: 1, + loadingstate: true, + page:1, + }) + this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); + } + + } + //作品状态2 + funtaskstatustwot = (checkedValues, data) => { + // console.log("funtaskstatustwo"); + // console.log(checkedValues); + if (JSON.stringify(checkedValues) === "[]") { + // console.log(checkedValues); + this.setState({ + unlimitedtwo: 1, + course_groupysls: undefined, + checkedValuesineinfo:[], + loadingstate: true, + page: 1, + }) + this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit); + } else if (checkedValues.length === data.length) { + this.setState({ + unlimitedtwo: 1, + course_groupysls: undefined, + checkedValuesineinfo:[], + loadingstate: true, + page: 1, + }) + this.Startsortingt(this.state.orders, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit); + } else { + this.setState({ + checkedValuesineinfo: checkedValues, + course_groupysls: checkedValues, + unlimitedtwo: 0, + loadingstate: true, + page: 1, + }) + this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit); + + + } + + } + //搜索学生 文字输入 + inputSearchValuest = (e) => { + // console.log(e.target.value) + if (e.target.value === "") { + this.setState({ + searchtext: undefined + }) + } else { + this.setState({ + searchtext: e.target.value + }) + } + + } + + //搜索学生按钮输入 + searchValuest = (value) => { + //点击直接搜索 + // if(value === ""){ + // message.error("请输入姓名或学号搜索"); + // return + // } + this.setState({ + loadingstate: true + }) + this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, this.state.page, this.state.limit); + // console.log(value) + + + } + + // 输入关键字后按回车,自动提交 + onSearchKeywordKeyUpt = (e) => { + if (e.keyCode === 13) { + // this.onSearch(); + // console.log("使用了回车键"); + this.setState({ + loadingstate: true + }) + this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); + } + } + //排序 + funordert = (e) => { + if (e === "update_time") { + // 时间 + // 时间排序是从小到大 + this.setState({ + orders: "update_time", + loadingstate: true, + }) + this.Startsortingt("update_time", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); + } + + if (e === "work_score") { + // 成绩 + //成绩排序是从大到小 + this.setState({ + orders: "work_score", + loadingstate: true, + }) + this.Startsortingt("work_score", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); + } + + if (e === "student_id") { + //学号 + //学号排序是从大到小 + this.setState({ + order: "student_id", + loadingstate: true, + }) + this.Startsortingt("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); + } + } + + + // 调分 + // 查看学员实训信息 - Viewstudenttraininginformation = (e) => { - // console.log("Listofworksstudentone.js"); + Viewstudenttraininginformationt = (e) => { + // console.log("Viewstudenttraininginformation"); // console.log(e); this.setState({ - userids: e.myid, + userids: e.myid, + }) + this.viewtrainingt(e.myid); + } + // 关闭调分 + cancelModulationModels = () => { + this.setState({visibles: false}) + } + // 关闭查看 + cancelModulationModel = () => { + this.setState({visible: false}) + } + // 调分 + Viewstudenttraininginformations = (e) => { + // console.log("Viewstudenttraininginformations2"); + // console.log(e.myid); + this.setState({ + visible: true, + userid: e.myid, + // Tune: }) - this.viewtraining(e.myid); } - viewtraining = (userids) => { - // console.log("viewtraining") - // console.log(userids) + //确定 + saveModulationModal = (value, num) => { + var userid = this.state.userid; + const url = `/student_works/${userid}/adjust_score.json`; + // console.log(url); + axios.post(url, { + score: num, + comment: value + }) + .then((response) => { + if (response.data.status == '0') { + this.setState({visible: false}); + this.props.showNotification(`调分成功`); + + this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); + } + }) + .catch(function (error) { + console.log(error); + }); + } + + viewtrainingt = (userids) => { // console.log(JSON.stringify(this.props.user)) var url = `/student_works/${userids}/shixun_work.json`; axios.get(url).then((result) => { if (result.status === 200) { - // console.log("Listofworksstudentone.js") + // console.log("TraineetraininginformationModal.js") // console.log(JSON.stringify(result)) let datalist = []; var game_list = result.data.game_list @@ -717,6 +1939,7 @@ class Listofworksstudentone extends Component { if(game_list[i].complete_status === 2 || game_list[i].complete_status===3){ boolgalist=false; } + } // console.log("viewtraining"); // console.log(datalist); @@ -734,148 +1957,533 @@ class Listofworksstudentone extends Component { }) } - // 关闭调分 - cancelModulationModels = () => { - this.setState({visibles: false}) - } - //排序 - funorder = (e) => { - if (e === "updated_at") { - // 时间 - // 时间排序是从小到大 - this.setState({ - order: "updated_at", - loadingstate: true, - }) - this.Getalistofworkstwo(e, "", "", "", this.state.page, this.state.limit); - } - - if (e === "work_score") { - // 成绩 - //成绩排序是从大到小 - this.setState({ - order: "work_score", - loadingstate: true, - }) - this.Getalistofworkstwo(e, "", "", "", this.state.page, this.state.limit); - } - if (e === "student_id") { - //学号 - //学号排序是从大到小 - this.setState({ - order: "student_id", - loadingstate: true, - }) - this.Getalistofworkstwo(e, "", "", "", this.state.page, this.state.limit); - } - } + //立即发布 + homeworkstart = () => { + let homeworkid = this.props.match.params.homeworkid; + let url = "/homework_commons/" + homeworkid + "/publish_groups.json"; - Startsorting = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => { - // console.log("获取作品列表Listofworksstudenttwo"); - var homeworkid = this.props.match.params.homeworkid; - let urll = `/homework_commons/${homeworkid}/works_list.json`; - // console.log(homeworkid); - // search:搜索关键字 - // order:排序方式:更新时间:update_time,最终成绩:work_score,学号:student_id - // b_order:desc:倒序 , asc:顺序 - // work_status:0:未提交, 1:按时提交, 2:延时提交,“”不限 - // course_group:分班情况 [232, 231], []:不限(空数组) - var order = "asc"; - if (ordervlue === "updated_at") { - order = "desc"; - } - var data = { - search: "", - order: ordervlue, - b_order: order, - work_status: "", - course_group: "", - page: page, - limit: limit, + axios.get(url).then((response) => { - } - axios.post(urll, data).then((result) => { - if (result !== undefined) { - // console.log("学生公开的作品列表") - // console.log(JSON.stringify(result)) - if(this.props.isNotMember()===false) { + if (response.status === 200) { + let starttime = this.props.getNowFormatDates(1); + let endtime = this.props.getNowFormatDates(2); this.setState({ - teacherdata: result.data, - task_status: result.data.task_status, - course_group_info: result.data.course_group_info, - student_works: result.data.student_works, - loadingstate: false, - jobsettingsdata: result, - publish_immediately: result.data.publish_immediately, - work_efficiency: result.data.work_efficiency, - end_immediately: result.data.end_immediately, - code_review: result.data.code_review, - challenges_count:result.data.challenges_count, - view_report:result.data.view_report, + modalname: "立即发布", + modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, + svisible: true, + Topval:"学生将立即收到作业", + // Botvalleft:"暂不发布", + Botval:`本操作只对"未发布"的分班有效`, + starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), + endtime: "截止时间:" + endtime, + starttimes:starttime, + typs:"start", + Cancelname: "暂不发布", + Savesname: "立即发布", + Cancel: this.homeworkhide, + Saves: this.homeworkstartend, + course_groups: response.data.course_groups, }) - this.props.Getdataback(result,result.data); - this.seacthdata(result.data); } + }).catch((error) => { + console.log(error) + }); + + } + //立即截止 + homeworkends = () => { + console.log("1160"); + let homeworkid = this.props.match.params.homeworkid; + let url = "/homework_commons/" + homeworkid + "/end_groups.json"; + + axios.get(url).then((response) => { + + if (response.status === 200) { + this.setState({}) + this.setState({ + modalname: "立即截止", + modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, + svisible: true, + Topval:"学生将不能再提交作业", + // Botvalleft:"暂不截止", + Botval:`本操作只对"提交中"的分班有效`, + Cancelname: "暂不截止", + Savesname: "立即截止", + Cancel: this.homeworkhide, + Saves: this.coursetaskend, + starttime: undefined, + endtime: undefined, + course_groups: response.data.course_groups, + typs:"end", + }) } }).catch((error) => { console.log(error) - this.setState({ - loadingstate: false + }); + } +// 立即发布 + homeworkstartend = (ds,endtime) => { + var homeworkid = this.props.match.params.homeworkid; + let {course_groupslist} = this.state; + + let coursesId = this.props.match.params.coursesId; + let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json"; + axios.post(url, { + homework_ids: [homeworkid], + group_ids: course_groupslist, + end_time:endtime, + }).then((result) => { + if (result.status === 200) { + if (result.data.status === 0) { + notification.open({ + message: "提示", + description: result.data.message + }); + this.homeworkhide() + } + + } + }).catch((error) => { + console.log(error); + }) + } + notlimiteds = () => { + this.setState({ + checkedValuesine: undefined, + course_groupyslstwo: [], + unlimited: 0, + loadingstate: true, + page:1, + }) + this.Startsortingt(this.state.orders, [], this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); + + } + notlimitedst = () => { + // console.log(this.state.course_group_info); + this.setState({ + unlimitedtwo: 1, + checkedValuesineinfo: [], + course_groupysls: undefined, + loadingstate: true, + }) + this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, [], this.state.searchtext, 1, this.state.limit); + } + //立即截止确定按钮 + coursetaskend = () => { + var homeworkid = this.props.match.params.homeworkid; + let {course_groupslist} = this.state; + + + const cid = this.props.match.params.coursesId; + let url = "/courses/" + cid + "/homework_commons/end_homework.json"; + axios.post(url, { + group_ids: course_groupslist, + homework_ids: [homeworkid], + }) + .then((response) => { + if (response.data.status == 0) { + notification.open({ + message: "提示", + description: response.data.message + }); + this.homeworkhide() + } }) + .catch(function (error) { + console.log(error); + }); + } + + getcourse_groupslist = (id) => { + this.setState({ + course_groupslist: id }) } - TablePagination = (e) => { - // console.log(e.current); - var teacherlists = { //分页 - total: this.state.student_works.length, //数据总数量 - pageSize: 10, //一页显示几条 - current: e.current, - } + homeworkhide = () => { + this.isupdatas() this.setState({ - page: e.current, - teacherlists: teacherlists + modalname: undefined, + modaltype: undefined, + svisible: false, + Topval: undefined, + Topvalright: undefined, + Botvalleft: undefined, + Botval: undefined, + starttime: undefined, + endtime: undefined, + Cancelname: undefined, + Savesname: undefined, + Cancel: undefined, + Saves: undefined, + StudentList_value: undefined, + addname: undefined, + addnametype: false, + addnametab: undefined, + course_groupyslstwo: undefined, + typs:undefined, + starttimes:undefined, }) + } + + workshowmodel = () => { + this.setState({ + showmodel: true + }) } + hideshowmodel = () => { + this.setState({ + showmodel: false + }) + } paginationonChanges = (pageNumber) => { this.setState({ page: pageNumber, loadingstate: true, }) - this.Getalistofworkstwo(this.state.order, "", "", "", pageNumber, this.state.limit); + this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, this.state.limit); + } - //计算成绩 + setComputeTime=()=>{ - let {teacherdata}=this.state; this.setState({ computeTimetype:false }) let homeworkid = this.props.match.params.homeworkid; - let url = "/homework_commons/"+homeworkid+"/update_student_score.json?shixun_id="+teacherdata.shixun_id; + let url = "/homework_commons/"+homeworkid+"/update_score.json"; axios.get(url).then((response) => { - this.props.showNotification(`${response.data.message}`); - // var homeworkid = this.props.match.params.homeworkid; - // this.Getalistofworks(homeworkid); - this.Getalistofworkstwo("", "", "", "", 1, 20); + if(response){ + this.props.showNotification(response.data.message); + this.setState({ + loadingstate: true + }) + this.Startsortingt(this.state.order, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); + } }).catch((error) => { console.log(error) }); } + + render() { - let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; - // console.log(this.state.data); + let {columns,course_groupysls, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible,visibles, game_list,columnsstu, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; + + + // console.log(this.state.data); // console.log("841"); // console.log(this.state.columns); return ( + 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} + /> + + + + + + + + {computeTimetype===false? + + 正在执行成绩计算,请稍后刷新页面查看结果 + 温馨提示:执行时间因作品数量而异 + + :""} + + {/*作品状态GraduationTaskssettinglist*/} + + + 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} + + {teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true? + 计算成绩 + : + + {teacherdata&&teacherdata.homework_status[0]=== "未发布"? "": + + 计算成绩 + + } + } + + + + this.onSearchKeywordKeyUpt(e)} + onInput={this.inputSearchValuest} + onSearch={this.searchValuest} + > + + + + + + 作品状态: + this.notlimiteds()}>不限 + this.funtaskstatust(e, task_status && task_status)} + style={{paddingTop: '4px'}}> + + {task_status === undefined ? "" : task_status.map((item, key) => { + return ( + + {item.name} + ({item.count}) + + + + ) + })} + + {/*请输入姓名或学号搜索*/} + + + + + + {/*分班情况*/} + + + {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}) + + + ) + }) + } + + } + + + + + + + + + {teacherdata === undefined ? "" : teacherdata.student_works.length}个检索结果({teacherdata === undefined ? "" : teacherdata.all_member_count}学生) + + + + + + {orders === "update_time" ? "时间" : orders === "work_score" ? "成绩" : orders === "student_id" ? "学号" : ""}排序 + + + this.funordert("update_time")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>更新时间 + this.funordert("work_score")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>最终成绩 + this.funordert("student_id")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>学生学号 + + + + + + + + + + { + JSON.stringify(data) === "[]" ? + + + + + + 没有数据可以显示! + + + + + : + + + + + {data === undefined ? "" : } + + + } + + + + { + teacherdata && teacherdata.work_count && teacherdata.work_count > limit ? + + + + : "" + } + + + + ) :( + teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ? // 学生不能查看别人的 @@ -996,7 +2604,7 @@ class Listofworksstudentone extends Component { {computeTimetype===true? 计算成绩 : - + {teacherdata&&teacherdata.homework_status[0]=== "未发布"? "": 计算成绩 @@ -1021,7 +2629,7 @@ class Listofworksstudentone extends Component { {data === undefined ? "222222" : } @@ -1087,7 +2695,7 @@ class Listofworksstudentone extends Component { {data === undefined ? "" : 计算成绩 : - + {teacherdata&&teacherdata.homework_status[0]=== "未发布"? "": 计算成绩 @@ -1205,7 +2813,7 @@ class Listofworksstudentone extends Component { {datas === undefined ? "" : } @@ -1243,7 +2851,7 @@ class Listofworksstudentone extends Component { - + ) ) } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index 4ff7b2cad..3fbf8254a 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -11,7 +11,6 @@ import '../css/Courses.css'; import './style.css'; import '../css/busyWork.css'; import '../poll/pollStyle.css'; -import Listofworks from "./Listofworks"; import Listofworksstudentone from './Listofworksstudentone'; import Trainingjobsetting from './Trainingjobsetting'; import Workquestionandanswer from './Workquestionandanswer'; @@ -280,26 +279,15 @@ class ShixunHomeworkPage extends Component { modalCancel={this.Downloadcal} modalsType={this.state.DownloadType} /> - { - // 教师列表 - parseInt(tab) === 0 ? (isAdmin === true ? - this.Getdataback(jobsettingsdata, teacherdata)}> - : - this.Getdataback(jobsettingsdata, teacherdata)}>) - : - parseInt(tab) === 1 ? - this.Getdataback(jobsettingsdata, teacherdata)}> - : - parseInt(tab) === 2 ? - this.Getdataback(jobsettingsdata, teacherdata)}> - : - this.Getdataback(jobsettingsdata, teacherdata)}> - } + + {parseInt(tab) === 0 && this.Getdataback(jobsettingsdata, teacherdata)}>} + + {parseInt(tab) === 1 && this.Getdataback(jobsettingsdata, teacherdata)}>} + + {parseInt(tab) === 2 && this.Getdataback(jobsettingsdata, teacherdata)}>} + + {parseInt(tab) === 3 && this.Getdataback(jobsettingsdata, teacherdata)}>} + )
没有数据可以显示!