diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index f842a685b..08c95af6a 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -23,6 +23,7 @@ import './yslexercisetable.css'; import {getImageUrl, toPath, sortDirections} from 'educoder'; import CheckBoxGroup from "../../page/component/CheckBoxGroup"; import NoneData from '../../../modules/courses/coursesPublic/NoneData' +import ModulationModal from "../coursesPublic/ModulationModal"; const Search = Input.Search; const RadioGroup = Radio.Group; const CheckboxGroup = Checkbox.Group; @@ -38,6 +39,7 @@ class Studentshavecompletedthelist extends Component { datas: [], page: 1, limit: 20, + testpapergradingboll: false, styletable: { "display": "block" }, @@ -1028,11 +1030,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( {record.finalscore==="--"? - -- - :record.submitstate === "未提交"? - -- + this.Adjustment(record)} + >调分 : ( {record.finalscore==="--"? - -- - :record.submitstate === "未提交"? - -- + this.Adjustment(record)} + >调分 : { - // console.log('Page: '); + // //console.log('Page: '); if (this.state.loadingstate === false) { this.setState({ page: pageNumber, @@ -1271,7 +1269,7 @@ class Studentshavecompletedthelist extends Component { } paginationonChanges = (pageNumber) => { - // console.log('Page: '); + // //console.log('Page: '); if (this.state.loadingstate === false) { this.setState({ page: pageNumber, @@ -1292,12 +1290,12 @@ class Studentshavecompletedthelist extends Component { componentDidMount() { // if(this.props.isAdmin() === true){ // this.Teacherliststudentlistsy(); - // console.log("1111111111111111"); - // console.log(this.props.isAdmin()); + // //console.log("1111111111111111"); + // //console.log(this.props.isAdmin()); // }else { this.Teacherliststudentlist(); - // console.log("2222222222222"); - // console.log(this.props.isAdmin()); + // //console.log("2222222222222"); + // //console.log(this.props.isAdmin()); // } try { this.props.triggerRef(this); @@ -1313,10 +1311,10 @@ class Studentshavecompletedthelist extends Component { //试卷列表 Teacherliststudentlist = () => { - // console.log("Teacherliststudentlist"); // 764 + // //console.log("Teacherliststudentlist"); // 764 var thiss = this; var exercise_id = this.props.match.params.Id; - // console.log(731); // 764 935 + // //console.log(731); // 764 935 var url = `/exercises/${exercise_id}/exercise_lists.json`; axios.get((url), { params: { @@ -1342,7 +1340,7 @@ class Studentshavecompletedthelist extends Component { }) if (response.data.current_answer_user === undefined || response.data.current_answer_user === null) { // 学生未截止 - // console.log("试卷学生未截止"); + // //console.log("试卷学生未截止"); this.Generatenewdatas(response.data.exercise_users); if (response.data.exercise_types.subjective === 0) { if (this.state.noclassroom === undefined || this.state.noclassroom === "" || this.state.noclassroom === null) { @@ -1389,7 +1387,7 @@ class Studentshavecompletedthelist extends Component { } } else { //学生已截止 - // console.log("试卷学生已截止"); + // //console.log("试卷学生已截止"); if (response.data.exercise_types.subjective === 0) { if (this.state.loadingstate === false) { var arr =[]; @@ -1469,22 +1467,22 @@ class Studentshavecompletedthelist extends Component { } //老师 else if (response.data.exercise_types.user_permission === 0) { - // console.log(response.data.exercise_users) - // console.log(response) - // console.log("试卷老师加载中"); + // //console.log(response.data.exercise_users) + // //console.log(response) + // //console.log("试卷老师加载中"); if (thiss.state.loadingstate === false) { thiss.setState({ loadingstate: true, }) } - console.log(response); - console.log(1393); + //console.log(response); + //console.log(1393); thiss.Generatenewdatasy(response.data.exercise_users, response); } }).catch((error) => { - // console.log(error); - // console.log("其实数据加载失败了"); - // console.log("1111"); + // //console.log(error); + // //console.log("其实数据加载失败了"); + // //console.log("1111"); }); @@ -1495,9 +1493,9 @@ class Studentshavecompletedthelist extends Component { let datalist = []; let datalisttwo = []; var teacherlist = undefined; - // console.log("开始数据了"); + // //console.log("开始数据了"); if (exercise_users !== undefined) { - // console.log("开始打印数据了"); + // //console.log("开始打印数据了"); for (var i = 0; i < exercise_users.length; i++) { if (exercise_users[i].commit_status === 1) { datalist.push({ @@ -1574,9 +1572,9 @@ class Studentshavecompletedthelist extends Component { let datalist = []; var teacherlist = undefined; var noclassroom = undefined; - // console.log("开始数据了"); + // //console.log("开始数据了"); if (exercise_users !== undefined) { - // console.log("开始打印数据了"); + // //console.log("开始打印数据了"); for (var i = 0; i < exercise_users.length; i++) { datalist.push({ myid: exercise_users[i].login, @@ -1610,7 +1608,7 @@ class Studentshavecompletedthelist extends Component { } TablePagination = (e) => { - // console.log(e.current); + // //console.log(e.current); var teacherlist = { //分页 total: this.state.exercise_users.length, //数据总数量 pageSize: 20, //一页显示几条 @@ -1623,7 +1621,7 @@ class Studentshavecompletedthelist extends Component { } TablePaginations = (e) => { - // console.log(e.current); + // //console.log(e.current); var teacherlists = { //分页 total: this.state.exercise_users, //数据总数量 pageSize: 10, //一页显示几条 @@ -1639,7 +1637,7 @@ class Studentshavecompletedthelist extends Component { Searchdata = (order, commit_status, review, exercise_group_id, search, page, limit, order_type) => { var exercise_id = this.props.match.params.Id; - // console.log(731); // 764 935 + // //console.log(731); // 764 935 var url = `/exercises/${exercise_id}/exercise_lists.json`; var params = { order: order, @@ -1654,7 +1652,7 @@ class Studentshavecompletedthelist extends Component { axios.get(url, { params: params }).then((response) => { - // console.log(JSON.stringify(response)); + // //console.log(JSON.stringify(response)); this.setState({ Teacherliststudentlist: response.data, review: response.data.review, @@ -1702,7 +1700,7 @@ class Studentshavecompletedthelist extends Component { } this.Generatenewdata(response.data.exercise_users, response.data.current_answer_user); }).catch((error) => { - console.log(error) + //console.log(error) this.setState({ loadingstate: false, }) @@ -1717,9 +1715,9 @@ class Studentshavecompletedthelist extends Component { let datalist = []; var indexi = 0; var teacherlist = undefined; - // console.log("开始数据了"); + // //console.log("开始数据了"); if (exercise_users !== undefined) { - // console.log("开始打印数据了"); + // //console.log("开始打印数据了"); for (var i = 0; i < exercise_users.length; i++) { if (exercise_users[i].commit_status === 1) { datalist.push({ @@ -1767,7 +1765,7 @@ class Studentshavecompletedthelist extends Component { if (indexi === exercise_users.length) { //都没评论 不显示评论 if (response.data.exercise_types.groups_count > 0) { - // console.log("77771111111"); + // //console.log("77771111111"); //分班大于0显示分班 //7ge // this.state.columnsys.map((item,key)=>{ @@ -1854,8 +1852,8 @@ class Studentshavecompletedthelist extends Component { arr.push(item); } } - // console.log(thiss.state.columnsys); - // console.log(arr); + // //console.log(thiss.state.columnsys); + // //console.log(arr); this.setState({ data: datalist, @@ -1908,7 +1906,7 @@ class Studentshavecompletedthelist extends Component { } else { //包括主观题 if (indexi === exercise_users.length) { - console.log("2548包含主观题不包含分班"); + //console.log("2548包含主观题不包含分班"); if (response.data.exercise_types.groups_count > 0) { var arr =[]; @@ -1959,7 +1957,7 @@ class Studentshavecompletedthelist extends Component { }) } } else { - // console.log("2699包含主观题包含分班"); + // //console.log("2699包含主观题包含分班"); if (response.data.exercise_types.groups_count > 0) { this.setState({ data: datalist, @@ -2010,7 +2008,7 @@ class Studentshavecompletedthelist extends Component { TablePaginationsy = (e) => { - // console.log(e.current); + // //console.log(e.current); var teacherlist = { //分页 total: this.state.exercise_users.length, //数据总数量 pageSize: 20, //一页显示几条 @@ -2037,19 +2035,19 @@ class Studentshavecompletedthelist extends Component { order_type: order_type } }).then((response) => { - // console.log("528"); - // console.log(JSON.stringify(response)); + // //console.log("528"); + // //console.log(JSON.stringify(response)); if(response===undefined){ return } 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, }) @@ -2101,9 +2099,9 @@ class Studentshavecompletedthelist extends Component { this.Searchdatasys(this.state.order, undefined, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type); } checkeboxstwo = (checkedValues, data) => { - // console.log(checkedValues) + // //console.log(checkedValues) if (JSON.stringify(checkedValues) === "[]") { - // console.log(checkedValues); + // //console.log(checkedValues); if (this.state.loadingstate === false) { this.setState({ loadingstate: true, @@ -2138,7 +2136,7 @@ class Studentshavecompletedthelist extends Component { this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type); } else { - // console.log(checkedValues); + // //console.log(checkedValues); this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type); if (this.state.loadingstate === false) { this.setState({ @@ -2160,7 +2158,7 @@ class Studentshavecompletedthelist extends Component { } notlimitedst = () => { - // console.log(); + // //console.log(); // var datas=this.state.course_groups; // for(var ik=0;ik { - // console.log(checkedValues); + // //console.log(checkedValues); if (JSON.stringify(checkedValues) === "[]") { - // console.log(checkedValues); + // //console.log(checkedValues); if (this.state.loadingstate === false) { this.setState({ course_groupysls: undefined, @@ -2297,7 +2295,7 @@ class Studentshavecompletedthelist extends Component { this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type) } else { - // console.log(checkedValues); + // //console.log(checkedValues); if (this.state.loadingstate === false) { this.setState({ checkedValuesineinfo: checkedValues, @@ -2325,7 +2323,7 @@ class Studentshavecompletedthelist extends Component { onSearchKeywordKeyUp = (e) => { if (e.keyCode === 13) { // this.onSearch(); - // console.log("使用了回车键"); + // //console.log("使用了回车键"); // if(this.state.searchtext === ""){ // message.error("请输入姓名或学号搜索"); // return @@ -2356,7 +2354,7 @@ class Studentshavecompletedthelist extends Component { this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, value, 1, this.state.limit, this.state.order_type); // this.Startsorting(this.state.order,this.state.checkedValuesine,this.state.checkedValuesineinfo,value); - // console.log(value) + // //console.log(value) }; @@ -2375,7 +2373,7 @@ class Studentshavecompletedthelist extends Component { //搜索学生 文字输入 inputSearchValues = (e) => { - // console.log(e.target.value) + // //console.log(e.target.value) if (e.target.value === "") { this.setState({ searchtext: undefined, @@ -2563,19 +2561,63 @@ class Studentshavecompletedthelist extends Component { setExerciseReviewAndAnswer = () => { } + // 调分 + Adjustment = (e) => { + // console.log("Adjustment"); + // console.log(e.myid); + this.setState({ + testpapergradingboll: true, + exeuserid: e.user_id, + }) + + } + //调分窗 + Adjustments = () => { + //弹出弹框 + this.setState({ + testpapergradingboll: false + }) + + } + + //试卷调分 + Testpapergrading = (v, n) => { + var exercise_id = this.props.match.params.Id; + let url = `/exercise_questions/${exercise_id}/adjust_score.json`; + axios.post(url, { + score: n, + user_id: this.state.exeuserid, + comment: v, + }) + .then((response) => { + if (response.data.status == '0') { + this.setState({testpapergradingboll: false}); + this.props.showNotification('调分成功'); + this.Teacherliststudentlist(); + } + }) + .catch(function (error) { + console.log(error); + this.setState({testpapergradingboll: false}) + }); + + + } + + render() { const isAdmin = this.props.isAdmin(); - 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); - // console.log("获取到的数据"); - // console.log(datas); - // console.log(data); - // console.log("this.props.Commonheadofthetestpaper.exercise_status"); - // console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status); - // console.log(exercise_status); + 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, testpapergradingboll} = this.state; + // //console.log("Studentshavecompletedthelist"); + // //console.log(this.props.current_status); + // //console.log("获取到的数据"); + // //console.log(datas); + // //console.log(data); + // //console.log("this.props.Commonheadofthetestpaper.exercise_status"); + // //console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status); + // //console.log(exercise_status); return ( isAdmin === true ? ( @@ -2591,6 +2633,11 @@ class Studentshavecompletedthelist extends Component { :
+ {testpapergradingboll === true ? this.Adjustments()} + Saves={(value, num) => this.Testpapergrading(value, num)} + /> : ""}