调整评分

issues25489
杨树林 5 years ago
parent 2ff464202f
commit da9ba68430

@ -23,6 +23,7 @@ import './yslexercisetable.css';
import {getImageUrl, toPath, sortDirections} from 'educoder'; import {getImageUrl, toPath, sortDirections} from 'educoder';
import CheckBoxGroup from "../../page/component/CheckBoxGroup"; import CheckBoxGroup from "../../page/component/CheckBoxGroup";
import NoneData from '../../../modules/courses/coursesPublic/NoneData' import NoneData from '../../../modules/courses/coursesPublic/NoneData'
import ModulationModal from "../coursesPublic/ModulationModal";
const Search = Input.Search; const Search = Input.Search;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
@ -38,6 +39,7 @@ class Studentshavecompletedthelist extends Component {
datas: [], datas: [],
page: 1, page: 1,
limit: 20, limit: 20,
testpapergradingboll: false,
styletable: { styletable: {
"display": "block" "display": "block"
}, },
@ -1028,11 +1030,9 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => ( render: (text, record) => (
<span> <span>
{record.finalscore==="--"? {record.finalscore==="--"?
<span style={{textAlign: "center",color: '#999999'}} <span className="color-blue" style={{textAlign: "center", cursor: "pointer"}}
>--</span> onClick={() => this.Adjustment(record)}
:record.submitstate === "未提交"? >调分</span>
<span style={{textAlign: "center",color: '#999999'}}
>--</span>
: :
<a style={{textAlign: "center"}} className="color-blue" <a style={{textAlign: "center"}} className="color-blue"
target="_blank" target="_blank"
@ -1227,11 +1227,9 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => ( render: (text, record) => (
<span> <span>
{record.finalscore==="--"? {record.finalscore==="--"?
<span style={{textAlign: "center",color: '#999999'}} <span className="color-blue" style={{textAlign: "center", cursor: "pointer"}}
>--</span> onClick={() => this.Adjustment(record)}
:record.submitstate === "未提交"? >调分</span>
<span style={{textAlign: "center",color: '#999999'}}
>--</span>
: :
<a style={{textAlign: "center"}} className="color-blue" <a style={{textAlign: "center"}} className="color-blue"
target="_blank" target="_blank"
@ -1245,8 +1243,8 @@ class Studentshavecompletedthelist extends Component {
exercise_status:0, exercise_status:0,
order_type: "desc", order_type: "desc",
} }
// console.log("Studentshavecompletedthelist"); // //console.log("Studentshavecompletedthelist");
// console.log(props.current_status); // //console.log(props.current_status);
// columnsys 老师列表 // columnsys 老师列表
// columnss 学生只能看自己的 未截止页面 // columnss 学生只能看自己的 未截止页面
// columnstwo 截止显示自己的 // columnstwo 截止显示自己的
@ -1254,7 +1252,7 @@ class Studentshavecompletedthelist extends Component {
} }
paginationonChange = (pageNumber) => { paginationonChange = (pageNumber) => {
// console.log('Page: '); // //console.log('Page: ');
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
page: pageNumber, page: pageNumber,
@ -1271,7 +1269,7 @@ class Studentshavecompletedthelist extends Component {
} }
paginationonChanges = (pageNumber) => { paginationonChanges = (pageNumber) => {
// console.log('Page: '); // //console.log('Page: ');
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
page: pageNumber, page: pageNumber,
@ -1292,12 +1290,12 @@ class Studentshavecompletedthelist extends Component {
componentDidMount() { componentDidMount() {
// if(this.props.isAdmin() === true){ // if(this.props.isAdmin() === true){
// this.Teacherliststudentlistsy(); // this.Teacherliststudentlistsy();
// console.log("1111111111111111"); // //console.log("1111111111111111");
// console.log(this.props.isAdmin()); // //console.log(this.props.isAdmin());
// }else { // }else {
this.Teacherliststudentlist(); this.Teacherliststudentlist();
// console.log("2222222222222"); // //console.log("2222222222222");
// console.log(this.props.isAdmin()); // //console.log(this.props.isAdmin());
// } // }
try { try {
this.props.triggerRef(this); this.props.triggerRef(this);
@ -1313,10 +1311,10 @@ class Studentshavecompletedthelist extends Component {
//试卷列表 //试卷列表
Teacherliststudentlist = () => { Teacherliststudentlist = () => {
// console.log("Teacherliststudentlist"); // 764 // //console.log("Teacherliststudentlist"); // 764
var thiss = this; var thiss = this;
var exercise_id = this.props.match.params.Id; 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 url = `/exercises/${exercise_id}/exercise_lists.json`;
axios.get((url), { axios.get((url), {
params: { params: {
@ -1342,7 +1340,7 @@ class Studentshavecompletedthelist extends Component {
}) })
if (response.data.current_answer_user === undefined || response.data.current_answer_user === null) { if (response.data.current_answer_user === undefined || response.data.current_answer_user === null) {
// 学生未截止 // 学生未截止
// console.log("试卷学生未截止"); // //console.log("试卷学生未截止");
this.Generatenewdatas(response.data.exercise_users); this.Generatenewdatas(response.data.exercise_users);
if (response.data.exercise_types.subjective === 0) { if (response.data.exercise_types.subjective === 0) {
if (this.state.noclassroom === undefined || this.state.noclassroom === "" || this.state.noclassroom === null) { if (this.state.noclassroom === undefined || this.state.noclassroom === "" || this.state.noclassroom === null) {
@ -1389,7 +1387,7 @@ class Studentshavecompletedthelist extends Component {
} }
} else { } else {
//学生已截止 //学生已截止
// console.log("试卷学生已截止"); // //console.log("试卷学生已截止");
if (response.data.exercise_types.subjective === 0) { if (response.data.exercise_types.subjective === 0) {
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
var arr =[]; var arr =[];
@ -1469,22 +1467,22 @@ class Studentshavecompletedthelist extends Component {
} }
//老师 //老师
else if (response.data.exercise_types.user_permission === 0) { else if (response.data.exercise_types.user_permission === 0) {
// console.log(response.data.exercise_users) // //console.log(response.data.exercise_users)
// console.log(response) // //console.log(response)
// console.log("试卷老师加载中"); // //console.log("试卷老师加载中");
if (thiss.state.loadingstate === false) { if (thiss.state.loadingstate === false) {
thiss.setState({ thiss.setState({
loadingstate: true, loadingstate: true,
}) })
} }
console.log(response); //console.log(response);
console.log(1393); //console.log(1393);
thiss.Generatenewdatasy(response.data.exercise_users, response); thiss.Generatenewdatasy(response.data.exercise_users, response);
} }
}).catch((error) => { }).catch((error) => {
// console.log(error); // //console.log(error);
// console.log("其实数据加载失败了"); // //console.log("其实数据加载失败了");
// console.log("1111"); // //console.log("1111");
}); });
@ -1495,9 +1493,9 @@ class Studentshavecompletedthelist extends Component {
let datalist = []; let datalist = [];
let datalisttwo = []; let datalisttwo = [];
var teacherlist = undefined; var teacherlist = undefined;
// console.log("开始数据了"); // //console.log("开始数据了");
if (exercise_users !== undefined) { if (exercise_users !== undefined) {
// console.log("开始打印数据了"); // //console.log("开始打印数据了");
for (var i = 0; i < exercise_users.length; i++) { for (var i = 0; i < exercise_users.length; i++) {
if (exercise_users[i].commit_status === 1) { if (exercise_users[i].commit_status === 1) {
datalist.push({ datalist.push({
@ -1574,9 +1572,9 @@ class Studentshavecompletedthelist extends Component {
let datalist = []; let datalist = [];
var teacherlist = undefined; var teacherlist = undefined;
var noclassroom = undefined; var noclassroom = undefined;
// console.log("开始数据了"); // //console.log("开始数据了");
if (exercise_users !== undefined) { if (exercise_users !== undefined) {
// console.log("开始打印数据了"); // //console.log("开始打印数据了");
for (var i = 0; i < exercise_users.length; i++) { for (var i = 0; i < exercise_users.length; i++) {
datalist.push({ datalist.push({
myid: exercise_users[i].login, myid: exercise_users[i].login,
@ -1610,7 +1608,7 @@ class Studentshavecompletedthelist extends Component {
} }
TablePagination = (e) => { TablePagination = (e) => {
// console.log(e.current); // //console.log(e.current);
var teacherlist = { //分页 var teacherlist = { //分页
total: this.state.exercise_users.length, //数据总数量 total: this.state.exercise_users.length, //数据总数量
pageSize: 20, //一页显示几条 pageSize: 20, //一页显示几条
@ -1623,7 +1621,7 @@ class Studentshavecompletedthelist extends Component {
} }
TablePaginations = (e) => { TablePaginations = (e) => {
// console.log(e.current); // //console.log(e.current);
var teacherlists = { //分页 var teacherlists = { //分页
total: this.state.exercise_users, //数据总数量 total: this.state.exercise_users, //数据总数量
pageSize: 10, //一页显示几条 pageSize: 10, //一页显示几条
@ -1639,7 +1637,7 @@ class Studentshavecompletedthelist extends Component {
Searchdata = (order, commit_status, review, exercise_group_id, search, page, limit, order_type) => { Searchdata = (order, commit_status, review, exercise_group_id, search, page, limit, order_type) => {
var exercise_id = this.props.match.params.Id; 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 url = `/exercises/${exercise_id}/exercise_lists.json`;
var params = { var params = {
order: order, order: order,
@ -1654,7 +1652,7 @@ class Studentshavecompletedthelist extends Component {
axios.get(url, { axios.get(url, {
params: params params: params
}).then((response) => { }).then((response) => {
// console.log(JSON.stringify(response)); // //console.log(JSON.stringify(response));
this.setState({ this.setState({
Teacherliststudentlist: response.data, Teacherliststudentlist: response.data,
review: response.data.review, review: response.data.review,
@ -1702,7 +1700,7 @@ class Studentshavecompletedthelist extends Component {
} }
this.Generatenewdata(response.data.exercise_users, response.data.current_answer_user); this.Generatenewdata(response.data.exercise_users, response.data.current_answer_user);
}).catch((error) => { }).catch((error) => {
console.log(error) //console.log(error)
this.setState({ this.setState({
loadingstate: false, loadingstate: false,
}) })
@ -1717,9 +1715,9 @@ class Studentshavecompletedthelist extends Component {
let datalist = []; let datalist = [];
var indexi = 0; var indexi = 0;
var teacherlist = undefined; var teacherlist = undefined;
// console.log("开始数据了"); // //console.log("开始数据了");
if (exercise_users !== undefined) { if (exercise_users !== undefined) {
// console.log("开始打印数据了"); // //console.log("开始打印数据了");
for (var i = 0; i < exercise_users.length; i++) { for (var i = 0; i < exercise_users.length; i++) {
if (exercise_users[i].commit_status === 1) { if (exercise_users[i].commit_status === 1) {
datalist.push({ datalist.push({
@ -1767,7 +1765,7 @@ class Studentshavecompletedthelist extends Component {
if (indexi === exercise_users.length) { if (indexi === exercise_users.length) {
//都没评论 不显示评论 //都没评论 不显示评论
if (response.data.exercise_types.groups_count > 0) { if (response.data.exercise_types.groups_count > 0) {
// console.log("77771111111"); // //console.log("77771111111");
//分班大于0显示分班 //分班大于0显示分班
//7ge //7ge
// this.state.columnsys.map((item,key)=>{ // this.state.columnsys.map((item,key)=>{
@ -1854,8 +1852,8 @@ class Studentshavecompletedthelist extends Component {
arr.push(item); arr.push(item);
} }
} }
// console.log(thiss.state.columnsys); // //console.log(thiss.state.columnsys);
// console.log(arr); // //console.log(arr);
this.setState({ this.setState({
data: datalist, data: datalist,
@ -1908,7 +1906,7 @@ class Studentshavecompletedthelist extends Component {
} else { } else {
//包括主观题 //包括主观题
if (indexi === exercise_users.length) { if (indexi === exercise_users.length) {
console.log("2548包含主观题不包含分班"); //console.log("2548包含主观题不包含分班");
if (response.data.exercise_types.groups_count > 0) { if (response.data.exercise_types.groups_count > 0) {
var arr =[]; var arr =[];
@ -1959,7 +1957,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
} else { } else {
// console.log("2699包含主观题包含分班"); // //console.log("2699包含主观题包含分班");
if (response.data.exercise_types.groups_count > 0) { if (response.data.exercise_types.groups_count > 0) {
this.setState({ this.setState({
data: datalist, data: datalist,
@ -2010,7 +2008,7 @@ class Studentshavecompletedthelist extends Component {
TablePaginationsy = (e) => { TablePaginationsy = (e) => {
// console.log(e.current); // //console.log(e.current);
var teacherlist = { //分页 var teacherlist = { //分页
total: this.state.exercise_users.length, //数据总数量 total: this.state.exercise_users.length, //数据总数量
pageSize: 20, //一页显示几条 pageSize: 20, //一页显示几条
@ -2037,19 +2035,19 @@ class Studentshavecompletedthelist extends Component {
order_type: order_type order_type: order_type
} }
}).then((response) => { }).then((response) => {
// console.log("528"); // //console.log("528");
// console.log(JSON.stringify(response)); // //console.log(JSON.stringify(response));
if(response===undefined){ if(response===undefined){
return return
} }
this.setState({ this.setState({
loadingstate: false, loadingstate: false,
}) })
// console.log(response); // //console.log(response);
// console.log(1997); // //console.log(1997);
this.Generatenewdatasy(response.data.exercise_users, response); this.Generatenewdatasy(response.data.exercise_users, response);
}).catch((error) => { }).catch((error) => {
// console.log(error) // //console.log(error)
this.setState({ this.setState({
loadingstate: false, 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); 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) => { checkeboxstwo = (checkedValues, data) => {
// console.log(checkedValues) // //console.log(checkedValues)
if (JSON.stringify(checkedValues) === "[]") { if (JSON.stringify(checkedValues) === "[]") {
// console.log(checkedValues); // //console.log(checkedValues);
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
loadingstate: true, 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); this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else { } 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); 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) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
@ -2160,7 +2158,7 @@ class Studentshavecompletedthelist extends Component {
} }
notlimitedst = () => { notlimitedst = () => {
// console.log(); // //console.log();
// var datas=this.state.course_groups; // var datas=this.state.course_groups;
// for(var ik=0;ik<datas.length;ik++){ // for(var ik=0;ik<datas.length;ik++){
// datas[ik].exercise_group_id=undefined; // datas[ik].exercise_group_id=undefined;
@ -2182,7 +2180,7 @@ class Studentshavecompletedthelist extends Component {
if (JSON.stringify(checkedValues) === "[]") { if (JSON.stringify(checkedValues) === "[]") {
// console.log(checkedValues); // //console.log(checkedValues);
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
unlimited: 0, unlimited: 0,
@ -2217,7 +2215,7 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type); this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else { } else {
// console.log(checkedValues); // //console.log(checkedValues);
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
unlimited: 1, unlimited: 1,
@ -2260,9 +2258,9 @@ class Studentshavecompletedthelist extends Component {
} }
funtaskstatustwo = (checkedValues, data) => { funtaskstatustwo = (checkedValues, data) => {
// console.log(checkedValues); // //console.log(checkedValues);
if (JSON.stringify(checkedValues) === "[]") { if (JSON.stringify(checkedValues) === "[]") {
// console.log(checkedValues); // //console.log(checkedValues);
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
course_groupysls: undefined, 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) 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 { } else {
// console.log(checkedValues); // //console.log(checkedValues);
if (this.state.loadingstate === false) { if (this.state.loadingstate === false) {
this.setState({ this.setState({
checkedValuesineinfo: checkedValues, checkedValuesineinfo: checkedValues,
@ -2325,7 +2323,7 @@ class Studentshavecompletedthelist extends Component {
onSearchKeywordKeyUp = (e) => { onSearchKeywordKeyUp = (e) => {
if (e.keyCode === 13) { if (e.keyCode === 13) {
// this.onSearch(); // this.onSearch();
// console.log("使用了回车键"); // //console.log("使用了回车键");
// if(this.state.searchtext === ""){ // if(this.state.searchtext === ""){
// message.error("请输入姓名或学号搜索"); // message.error("请输入姓名或学号搜索");
// return // 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.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); // 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) => { inputSearchValues = (e) => {
// console.log(e.target.value) // //console.log(e.target.value)
if (e.target.value === "") { if (e.target.value === "") {
this.setState({ this.setState({
searchtext: undefined, searchtext: undefined,
@ -2563,19 +2561,63 @@ class Studentshavecompletedthelist extends Component {
setExerciseReviewAndAnswer = () => { 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() { render() {
const isAdmin = this.props.isAdmin(); 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; 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("Studentshavecompletedthelist");
// console.log(this.props.current_status); // //console.log(this.props.current_status);
// console.log("获取到的数据"); // //console.log("获取到的数据");
// console.log(datas); // //console.log(datas);
// console.log(data); // //console.log(data);
// console.log("this.props.Commonheadofthetestpaper.exercise_status"); // //console.log("this.props.Commonheadofthetestpaper.exercise_status");
// console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status); // //console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status);
// console.log(exercise_status); // //console.log(exercise_status);
return ( return (
isAdmin === true ? isAdmin === true ?
( (
@ -2591,6 +2633,11 @@ class Studentshavecompletedthelist extends Component {
</div> </div>
: :
<div> <div>
{testpapergradingboll === true ? <ModulationModal
visible={testpapergradingboll}
Cancel={() => this.Adjustments()}
Saves={(value, num) => this.Testpapergrading(value, num)}
/> : ""}
<div className="edu-back-white" > <div className="edu-back-white" >
<ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}> <ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}>

Loading…
Cancel
Save