diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index c0dbc6687..bd25f6977 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -243,4 +243,4 @@ function initOnlineOfflineListener() { '网络异常,请检测网络后重试。', }) }); -} \ No newline at end of file +} diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 213c9ceb1..377dc7dff 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -363,8 +363,8 @@ function buildColumns(that, student_works, studentData) { {/**/} {/**/} { isAdmin && 调整学生最终成绩
其它历史评分将全部失效}> - that.showModulationModal(record)} + that.showModulationModal(record)} >调分
} {/* toWorkDetailPage */} @@ -748,11 +748,17 @@ class CommonWorkList extends Component{ isPublish={true} doWhenSuccess={this.doWhenSuccess}> - this.saveModulationModal(value,num)} - /> + + { + modulationModalVisible === true ? + this.saveModulationModal(value, num)} + /> + : "" + } + {/* 内容区 */} diff --git a/public/react/src/modules/courses/coursesPublic/ModulationModal.js b/public/react/src/modules/courses/coursesPublic/ModulationModal.js index 1857f6814..4a679b515 100644 --- a/public/react/src/modules/courses/coursesPublic/ModulationModal.js +++ b/public/react/src/modules/courses/coursesPublic/ModulationModal.js @@ -1,7 +1,9 @@ import React,{ Component } from "react"; -import { Modal,Checkbox,Upload,Button,Icon,message,Input} from "antd"; +import {Modal, Checkbox, Upload, Button, Icon, message, Input, Form} from "antd"; import { WordNumberTextarea } from 'educoder'; +import './Newshixunmodel.css' +//调分 class ModulationModal extends Component{ constructor(props){ super(props); @@ -16,22 +18,32 @@ class ModulationModal extends Component{ Saves=()=>{ let {textareaval,Inputsval}=this.state; - if(textareaval===""||textareaval===undefined){ - this.setState({ - textareavaltype:true - }) - return - } + // if(textareaval===""||textareaval===undefined){ + // this.setState({ + // textareavaltype:true + // }) + // return + // } this.setState({ textareavaltype: false }) if(Inputsval===undefined||Inputsval===""){ - this.setState({ - Inputsvaltype:true - }) + this.setState({ + Inputsval: "", + Inputsvaltype: true, + Inputsvaltest: "请输入分数", + }) return } + + if (this.state.Inputsvaltype === true) { + return; + } + this.setState({ + Inputsvaltype: false, + Inputsvaltest: "", + }) this.props.Saves(textareaval,Inputsval) } @@ -43,21 +55,34 @@ class ModulationModal extends Component{ } setInputs=(e)=>{ + debugger var value=parseInt(e.target.value) if(isNaN(value)){ - value=0 + value = 0; + this.setState({ + Inputsval: value, + Inputsvaltype: true, + Inputsvaltest: "请输入分数", + }) }else{ if(value<0||value>100){ - value=0 + value = 0; + this.setState({ + Inputsval: value, + Inputsvaltype: true, + Inputsvaltest: "请输入0-100的分数", + }) + } } this.setState({ - Inputsval:value + Inputsval: value, + Inputsvaltype: false, }) } render(){ - let {textareaval,Inputsval,textareavaltype,Inputsvaltype}=this.state; + let {textareaval, Inputsval, textareavaltype, Inputsvaltype, Inputsvaltest} = this.state; return(
-
-

- - 该学生的最终成绩将不会按照评分规则进行计算 - -

- - -
- {/**/} - +
+
+ + + + *调分: + 分 + } + /> +
+ { + Inputsvaltype === true ? +

{Inputsvaltest}

+ : "" + } + +
+ +

调分后该学生的最终成绩将不会按照评分规则进行计算

+
+ +
+ 调分原因: this.settextarea(e)} + style={{width: "335px"}} + placeholder={"请输入调分原因(选填)"} + onInput={(e) => this.settextarea(e)} value={textareaval} maxlength={100} /> - -
  • 原因不能为空
  • +
    + + - - -
  • - -
  • -
  • 分数不能为空
  • -
    - + + +
    ) } } -export default ModulationModal; \ No newline at end of file +export default ModulationModal; +//
    +//

    +// +// 该学生的最终成绩将不会按照评分规则进行计算 +// +//

    +// +// +//
    +// {/**/} +// +// this.settextarea(e)} +// value={textareaval} +// maxlength={100} +// /> +// +// {/*
  • 原因不能为空
  • */} +//
    +//
    +// +// +// +//
  • +// +//
  • +//
  • 分数不能为空
  • +// */ +} +{/*
    */ +} diff --git a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css index f0f45a468..e31766c3f 100644 --- a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css +++ b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css @@ -266,4 +266,62 @@ .padding13-30 { padding: 13px 30px; box-sizing: border-box; -} \ No newline at end of file +} + +.displaymodulat { + display: flex; + display: -webkit-flex; + flex-direction: column; + align-items: center; +} + +.WordNumberTextarea { + outline: none; /* 去掉输入字符时的默认样式 */ + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + background-color: white; + text-shadow: none; + -webkit-writing-mode: horizontal-tb !important; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + resize: none; /*禁止拉伸*/ + border: none; /*去掉默认边框*/ + width: 100%; + height: 130px; + border: none; + display: block; +} + +.WordNumbernote { + padding: 0; + margin: 0; + list-style: none; + text-decoration: none; + box-sizing: border-box; + overflow: hidden; + height: auto; + border: 1px solid rgba(234, 234, 234, 1); + border-radius: 0.125rem; + margin: 10px 10px 0px 10px; + padding: 10px 10px 5px 10px; + backgroud: rgba(234, 234, 234, 1); + width: 335px; + +} + +.WordNumberTextarea-count { + display: inline-block; + float: right; + font-size: 16px; + color: #adadad; + padding-right: 0.25rem; +} + +.borerinput { + border: 1px solid #DD1717 !important; +} + +.borerinputs { + border: 1px solid #eee !important; +} + diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index f842a685b..90c76ee68 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 +1270,7 @@ class Studentshavecompletedthelist extends Component { } paginationonChanges = (pageNumber) => { - // console.log('Page: '); + // //console.log('Page: '); if (this.state.loadingstate === false) { this.setState({ page: pageNumber, @@ -1292,12 +1291,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 +1312,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 +1341,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 +1388,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 +1468,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 +1494,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 +1573,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 +1609,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 +1622,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 +1638,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 +1653,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 +1701,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 +1716,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({ @@ -1734,7 +1733,8 @@ class Studentshavecompletedthelist extends Component { completion: exercise_users[i].objective_score === undefined ? "--" : exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score, levelscore: exercise_users[i].subjective_score === undefined ? "--" : exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score, efficiencyscore: exercise_users[i].score === undefined ? "--" : exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score, - finalscore: "评阅" + finalscore: "评阅", + user_id: exercise_users[i].user_id }) } else { datalist.push({ @@ -1749,7 +1749,8 @@ class Studentshavecompletedthelist extends Component { completion: exercise_users[i].objective_score === undefined ? "--" : exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score, levelscore: exercise_users[i].subjective_score === undefined ? "--" : exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score, efficiencyscore: exercise_users[i].score === undefined ? "--" : exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score, - finalscore: "--" + finalscore: "--", + user_id: exercise_users[i].user_id }) indexi++; } @@ -1767,7 +1768,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 +1855,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 +1909,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 +1960,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 +2011,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 +2038,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 +2102,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 +2139,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 +2161,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 +2298,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 +2326,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 +2357,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 +2376,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 +2564,61 @@ class Studentshavecompletedthelist extends Component { setExerciseReviewAndAnswer = () => { } + // 调分 + Adjustment = (e) => { + 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 = `/exercises/${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 +2634,11 @@ class Studentshavecompletedthelist extends Component {
    :
    + {testpapergradingboll === true ? this.Adjustments()} + Saves={(value, num) => this.Testpapergrading(value, num)} + /> : ""}