|
|
@ -1,10 +1,10 @@
|
|
|
|
import React, {Component} from "react";
|
|
|
|
import React, {Component} from "react";
|
|
|
|
import {WordsBtn} from 'educoder';
|
|
|
|
import {WordsBtn} from 'educoder';
|
|
|
|
import {Table} from "antd";
|
|
|
|
import {Table,InputNumber} from "antd";
|
|
|
|
import {Link,Switch,Route,Redirect} from 'react-router-dom';
|
|
|
|
import {Link,Switch,Route,Redirect} from 'react-router-dom';
|
|
|
|
import moment from 'moment';
|
|
|
|
import moment from 'moment';
|
|
|
|
import { MonacoDiffEditor } from 'react-monaco-editor';
|
|
|
|
import { MonacoDiffEditor } from 'react-monaco-editor';
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
class ShixunCustomsPass extends Component {
|
|
|
|
class ShixunCustomsPass extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
constructor(props) {
|
|
|
@ -18,10 +18,51 @@ class ShixunCustomsPass extends Component {
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
editgame_scores=(e,id,maxsum,code_rate,copy_user_id)=>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let{datas}=this.state;
|
|
|
|
|
|
|
|
let newdatas=datas;
|
|
|
|
|
|
|
|
let score=e.target.value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(score!=null&&score!=undefined&&score!=""){
|
|
|
|
|
|
|
|
if(score<0){
|
|
|
|
|
|
|
|
this.props.showNotification("不能小于0");
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
customsids:id
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else if(score>maxsum){
|
|
|
|
|
|
|
|
this.props.showNotification(`不能大于关卡分值${maxsum}`);
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
customsids:id
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
let work_id=this.props.data.work_id;
|
|
|
|
|
|
|
|
let url=`/student_works/${work_id}/adjust_review_score.json`
|
|
|
|
|
|
|
|
axios.post(url,{
|
|
|
|
|
|
|
|
type:"review",
|
|
|
|
|
|
|
|
score:score,
|
|
|
|
|
|
|
|
challenge_id:id,
|
|
|
|
|
|
|
|
code_rate:code_rate,
|
|
|
|
|
|
|
|
copy_user_id:copy_user_id
|
|
|
|
|
|
|
|
}).then((result)=>{
|
|
|
|
|
|
|
|
if(result.data.status===0){
|
|
|
|
|
|
|
|
this.props.updatas();
|
|
|
|
|
|
|
|
this.props.showNotification(result.data.message);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.props.showNotification(result.data.message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.props.showNotification("调分为空将不会修改之前的分数");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let {data}=this.props;
|
|
|
|
let {data}=this.props;
|
|
|
|
console.log(data)
|
|
|
|
let {customsids}=this.state;
|
|
|
|
|
|
|
|
// console.log(data)
|
|
|
|
let datas=[];
|
|
|
|
let datas=[];
|
|
|
|
|
|
|
|
|
|
|
|
data&&data.challenge_list.forEach((item,key)=>{
|
|
|
|
data&&data.challenge_list.forEach((item,key)=>{
|
|
|
@ -33,6 +74,8 @@ class ShixunCustomsPass extends Component {
|
|
|
|
finishtime:item.copy_username,
|
|
|
|
finishtime:item.copy_username,
|
|
|
|
elapsedtime:item.copy_end_time===null?"无":item.copy_end_time===undefined?"无":item.copy_end_time===""?"无":moment(item.copy_end_time).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
elapsedtime:item.copy_end_time===null?"无":item.copy_end_time===undefined?"无":item.copy_end_time===""?"无":moment(item.copy_end_time).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
empvalue:item.code_rate,
|
|
|
|
empvalue:item.code_rate,
|
|
|
|
|
|
|
|
challenge_id:{id:item.id},
|
|
|
|
|
|
|
|
copy_user_id:item.copy_user_id
|
|
|
|
// adjustmentminute:asdasd
|
|
|
|
// adjustmentminute:asdasd
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -112,6 +155,20 @@ class ShixunCustomsPass extends Component {
|
|
|
|
render: (text, record) => (
|
|
|
|
render: (text, record) => (
|
|
|
|
<span className={"color-grey-9"}>
|
|
|
|
<span className={"color-grey-9"}>
|
|
|
|
{record.elapsedtime}
|
|
|
|
{record.elapsedtime}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
},{
|
|
|
|
|
|
|
|
title: '调分',
|
|
|
|
|
|
|
|
key: 'adjustmentminute',
|
|
|
|
|
|
|
|
dataIndex: 'adjustmentminute',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
|
|
|
<span>
|
|
|
|
|
|
|
|
<a><InputNumber size="small" className={customsids===record.challenge_id.id?"bor-red":""} defaultValue={record.evaluating.final_score}
|
|
|
|
|
|
|
|
onBlur={(e) => this.editgame_scores(e,record.challenge_id.id,record.evaluating.all_score,record.empvalue,record.copy_user_id)}
|
|
|
|
|
|
|
|
// min={0} max={record.game_scores.game_score_full}
|
|
|
|
|
|
|
|
/></a>
|
|
|
|
|
|
|
|
{/*<a style={{textAlign: "center"}} className="color-blue font-14 mr20">查看</a>*/}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
@ -138,7 +195,15 @@ class ShixunCustomsPass extends Component {
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.props.isAdmin()===false){
|
|
|
|
|
|
|
|
columns.some((item,key)=> {
|
|
|
|
|
|
|
|
if (item.title === "调分") {
|
|
|
|
|
|
|
|
columns.splice(key, 1)
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
|
@ -177,6 +242,9 @@ class ShixunCustomsPass extends Component {
|
|
|
|
.customsPass{
|
|
|
|
.customsPass{
|
|
|
|
text-align: left !important;
|
|
|
|
text-align: left !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.ant-table-thead > tr > th, .ant-table-tbody > tr > td {
|
|
|
|
|
|
|
|
padding: 16px 12px;
|
|
|
|
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
`}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
{datas===undefined?"":<Table
|
|
|
|
{datas===undefined?"":<Table
|
|
|
|