forked from Open-CT/openscore
feat:group selfMark
This commit is contained in:
parent
db45985e4e
commit
a8b26798cd
|
@ -1 +1 @@
|
|||
{"C:\\Users\\chen\\go\\src\\open-ct\\controllers":1632573379237283200}
|
||||
{"C:\\Users\\yang\\Desktop\\阅卷系统\\controllers":1632576621003759500}
|
|
@ -55,6 +55,10 @@ const group = {
|
|||
return axios.post('/marking/supervisor/problem/list ', data)
|
||||
},
|
||||
|
||||
selfMarkList(data) {
|
||||
return axios.post('/marking/supervisor/selfMark/list ', data)
|
||||
},
|
||||
|
||||
MonitorPoint(data) {
|
||||
return axios.post('/marking/supervisor/point', data)
|
||||
},
|
||||
|
@ -67,5 +71,10 @@ const group = {
|
|||
return axios.post('/marking/supervisor/arbitrament/unmark/list', data)
|
||||
},
|
||||
|
||||
selfTestId(data) {
|
||||
return axios.post('/marking/supervisor/arbitrament/unmark/list', data)
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
export default group
|
|
@ -53,6 +53,12 @@ const Marking = {
|
|||
testReviewPoint(data) {
|
||||
return axios.post('/marking/score/test/review/point', data)
|
||||
},
|
||||
testSelf(data) {
|
||||
return axios.post('/marking/score/self/list', data)
|
||||
},
|
||||
testSelfScore(data) {
|
||||
return axios.post('/marking/score/self/point', data)
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -35,12 +35,7 @@ export default class index extends Component {
|
|||
width: 150,
|
||||
dataIndex: 'current',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 150,
|
||||
dataIndex: 'operation',
|
||||
render: (text, record, index) => <Link to={{pathname: '/home/group/marking', state:{TestId: this.state.selfScoreRecordVOList[index].TestId}}}>自评</Link>
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ export default class index extends Component {
|
|||
inpValu: '',
|
||||
currentPaper: {},
|
||||
subTopic: [],
|
||||
testLength:0,
|
||||
testLength: 0,
|
||||
markScore: [],
|
||||
keyTest: [],
|
||||
sampleList: [],
|
||||
|
@ -41,8 +41,9 @@ export default class index extends Component {
|
|||
this.getProblemTestId()
|
||||
} else {
|
||||
this.setState({
|
||||
type: '正评卷'
|
||||
type: '自评卷'
|
||||
})
|
||||
this.getSelfTestId()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,8 +82,24 @@ export default class index extends Component {
|
|||
console.log(e)
|
||||
})
|
||||
}
|
||||
// 正评卷
|
||||
|
||||
// 自评卷
|
||||
getSelfTestId = () => {
|
||||
group.selfTestId({ supervisorId: "2" })
|
||||
.then((res) => {
|
||||
if (res.data.status == "10000") {
|
||||
let currentTestId = res.data.data.ProblemUnmarkVOList[0].TestId
|
||||
this.setState({
|
||||
count: res.data.data.ProblemUnmarkVOList.length,
|
||||
currentTestId
|
||||
})
|
||||
this.getCurrentPaper();
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
// 当前试卷
|
||||
getCurrentPaper = () => {
|
||||
Marking.testDisplay({ userId: '2', testId: this.state.currentTestId })
|
||||
|
@ -199,17 +216,19 @@ export default class index extends Component {
|
|||
this.showWarning(1)
|
||||
}}>提交</Button>
|
||||
</div>
|
||||
<div className="push-paper" >
|
||||
{
|
||||
this.state.type !== "自评卷" ? <div className="push-paper" >
|
||||
<Button className="push-problem" style={{ width: 60 }} onClick={() => {
|
||||
this.showWarning(2)
|
||||
}}>问题卷</Button>
|
||||
<Button className="push-excellent" style={{ width: 60 }} onClick={() => {
|
||||
this.showWarning(3)
|
||||
}}>优秀卷</Button>
|
||||
</div>
|
||||
{
|
||||
this.problemModal()
|
||||
}
|
||||
</div> : null
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -276,6 +295,7 @@ export default class index extends Component {
|
|||
} else if (this.state.type === '问题卷') {
|
||||
this.getProblemTestId()
|
||||
} else {
|
||||
this.getSelfTestId()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -300,7 +320,7 @@ export default class index extends Component {
|
|||
userId: this.userId,
|
||||
testId: this.state.currentTestId,
|
||||
problemType: this.state.problemValue,
|
||||
problemMessage :this.state.inpValu
|
||||
problemMessage: this.state.inpValu
|
||||
})
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
|
@ -321,7 +341,7 @@ export default class index extends Component {
|
|||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
Marking.testProblem({
|
||||
userId: this.userId,
|
||||
testId: this.state.currentTestId,
|
||||
|
@ -393,7 +413,7 @@ export default class index extends Component {
|
|||
// 试卷区
|
||||
showTest = () => {
|
||||
let testPaper = null;
|
||||
if (this.state.paperButton ===1) {
|
||||
if (this.state.paperButton === 1) {
|
||||
if (this.state.currentPaper.testInfos != undefined) {
|
||||
testPaper = this.state.currentPaper.testInfos.map((item) => {
|
||||
return <div className="test-question-img" data-content-before={this.imgScore(item.test_detail_id)}>
|
||||
|
@ -401,18 +421,18 @@ export default class index extends Component {
|
|||
</div>
|
||||
})
|
||||
}
|
||||
}else if(this.state.paperButton === 2) {
|
||||
} else if (this.state.paperButton === 2) {
|
||||
if (this.state.keyTest != undefined || this.state.keyTest != null) {
|
||||
testPaper = this.state.keyTest.map((item) => {
|
||||
return <div className="answer-question-img">
|
||||
<img src={'data:image/jpg;base64,'+item} alt="加载失败" />
|
||||
<img src={'data:image/jpg;base64,' + item} alt="加载失败" />
|
||||
</div>
|
||||
})
|
||||
}
|
||||
}else if(this.state.paperButton === 3) {
|
||||
} else if (this.state.paperButton === 3) {
|
||||
if (this.state.samplePaper !== undefined || this.state.samplePaper !== null) {
|
||||
testPaper = this.state.samplePaper.map((item) => {
|
||||
return <img src={'data:image/jpg;base64,' + item.picCode} alt="加载失败" className="answer-question-img"/>
|
||||
return <img src={'data:image/jpg;base64,' + item.picCode} alt="加载失败" className="answer-question-img" />
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -469,7 +489,7 @@ export default class index extends Component {
|
|||
.then((res) => {
|
||||
if (res.data.status === "10000") {
|
||||
let sampleList = []
|
||||
for (let i = 0; i< res.data.data.exampleTestPapers.length; i++) {
|
||||
for (let i = 0; i < res.data.data.exampleTestPapers.length; i++) {
|
||||
sampleList.push({
|
||||
order: i,
|
||||
question_id: res.data.data.exampleTestPapers[i].test_id,
|
||||
|
@ -569,14 +589,14 @@ export default class index extends Component {
|
|||
}
|
||||
</div>
|
||||
<div className="mark-score">
|
||||
{this.state.paperButton===1?
|
||||
{this.state.paperButton === 1 ?
|
||||
this.renderScoreDropDown() : null
|
||||
}
|
||||
{this.state.paperButton===1?
|
||||
this.renderPush() :null
|
||||
{this.state.paperButton === 1 ?
|
||||
this.renderPush() : null
|
||||
}
|
||||
{this.state.paperButton===3?
|
||||
this.sampleTable() :null
|
||||
{this.state.paperButton === 3 ?
|
||||
this.sampleTable() : null
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,97 +4,113 @@ import { Modal, Dropdown, Button, message, Space, Tooltip, Select, Radio, Input,
|
|||
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
||||
import './index.less'
|
||||
import group from "../../../../api/group";
|
||||
import Marking from "../../../../api/marking";
|
||||
import * as Util from "../../../../util/Util";
|
||||
const { Option } = Select;
|
||||
export default class index extends Component {
|
||||
userId = "1"
|
||||
supervisorId = "2"
|
||||
state = {
|
||||
problemVisible: false,
|
||||
problemValue: 1,
|
||||
inpValu: '',
|
||||
currentPaper: {},
|
||||
currentPaperNum: 0,
|
||||
testLength: 0,
|
||||
selectId: [],
|
||||
selectScore: [],
|
||||
subTopic: [],
|
||||
markScore: [],
|
||||
TestId: undefined
|
||||
}
|
||||
|
||||
|
||||
|
||||
componentDidMount() {
|
||||
if (this.props.location.state) {
|
||||
this.setState({
|
||||
TestId: this.props.location.state.TestId
|
||||
})
|
||||
this.getCurrentPaper(this.props.location.state.TestId)
|
||||
}
|
||||
this.questionList();
|
||||
}
|
||||
|
||||
handleOk = (value) => {
|
||||
if (this.state.problemValue == 2) {
|
||||
Marking.testProblem({
|
||||
userId: this.userId,
|
||||
testId: this.state.currentPaper.testId,
|
||||
problemType: this.state.problemValue,
|
||||
problemMessage: this.state.inpValu
|
||||
})
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
selectId: [],
|
||||
selectScore: [],
|
||||
})
|
||||
this.props.history.push('/home/markMonitor/self')
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
} else {
|
||||
Marking.testProblem({
|
||||
userId: this.userId,
|
||||
testId: this.state.currentPaper.testId,
|
||||
problemType: this.state.problemValue
|
||||
})
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
selectId: [],
|
||||
selectScore: [],
|
||||
})
|
||||
this.props.history.push('/home/markMonitor/self')
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
// 选择区
|
||||
state = {
|
||||
questionList: [],
|
||||
tableData: [],
|
||||
count: undefined
|
||||
}
|
||||
|
||||
this.setState({
|
||||
problemVisible: false,
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
handleCancel = (value) => {
|
||||
this.setState({
|
||||
problemVisible: false,
|
||||
});
|
||||
};
|
||||
// 当前试卷
|
||||
getCurrentPaper = (test_id) => {
|
||||
Marking.testDisplay({ userId: '2', testId: parseInt(test_id) })
|
||||
questionList = () => {
|
||||
group.questionList({ supervisorId: "2" })
|
||||
.then((res) => {
|
||||
if (res.data.status == "10000") {
|
||||
let currentPaper = res.data.data
|
||||
let subTopic = res.data.data.subTopic
|
||||
let markScore = []
|
||||
for (let i = 0; i < subTopic.length; i++) {
|
||||
markScore.push(subTopic[i].score_type.split('-'))
|
||||
this.setState({
|
||||
questionList: res.data.data.questionsList
|
||||
})
|
||||
console.log(res.data.data.questionsList)
|
||||
this.tableData(res.data.data.questionsList[0].QuestionId)
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
columns = [
|
||||
{
|
||||
title: '试卷号',
|
||||
width: 150,
|
||||
dataIndex: 'TestId',
|
||||
},
|
||||
{
|
||||
title: '阅卷人一账号',
|
||||
width: 150,
|
||||
dataIndex: 'ExaminerFirstId',
|
||||
},
|
||||
{
|
||||
title: '阅卷人一名称',
|
||||
width: 150,
|
||||
dataIndex: 'ExaminerFirstName',
|
||||
},
|
||||
{
|
||||
title: '阅卷人一分数',
|
||||
width: 150,
|
||||
dataIndex: 'ExaminerFirstScore',
|
||||
},
|
||||
{
|
||||
title: '阅卷人二账号',
|
||||
width: 150,
|
||||
dataIndex: 'ExaminerSecondId',
|
||||
},
|
||||
{
|
||||
title: '阅卷人二名称',
|
||||
width: 150,
|
||||
dataIndex: 'ExaminerSecondName',
|
||||
},
|
||||
{
|
||||
title: '阅卷人二分数',
|
||||
width: 150,
|
||||
dataIndex: 'ExaminerSecondScore',
|
||||
},
|
||||
{
|
||||
title: '阅卷人三账号',
|
||||
width: 150,
|
||||
dataIndex: 'ExaminerThirdId',
|
||||
},
|
||||
{
|
||||
title: '阅卷人三名称',
|
||||
width: 150,
|
||||
dataIndex: 'ExaminerThirdName',
|
||||
},
|
||||
{
|
||||
title: '阅卷人三分数',
|
||||
width: 150,
|
||||
dataIndex: 'ExaminerThirdScore',
|
||||
},
|
||||
{
|
||||
title: '标准误差',
|
||||
width: 150,
|
||||
dataIndex: 'StandardError',
|
||||
},
|
||||
{
|
||||
title: '实际误差',
|
||||
width: 150,
|
||||
dataIndex: 'PracticeError',
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
tableData = (questionId) => {
|
||||
group.selfMarkList({ supervisorId: "2", questionId: questionId })
|
||||
.then((res) => {
|
||||
if (res.data.status == "10000") {
|
||||
let tableData = [];
|
||||
for (let i = 0; i < res.data.data.arbitramentTestVOList.length; i++) {
|
||||
let item = res.data.data.arbitramentTestVOList[i]
|
||||
tableData.push(item)
|
||||
}
|
||||
this.setState({
|
||||
currentPaper,
|
||||
subTopic,
|
||||
markScore,
|
||||
tableData,
|
||||
count: res.data.data.count
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -102,257 +118,70 @@ export default class index extends Component {
|
|||
console.log(e)
|
||||
})
|
||||
}
|
||||
// 打分展示
|
||||
imgScore = (item) => {
|
||||
let index
|
||||
for (let i = 0; i < this.state.selectId.length; i++) {
|
||||
if (item == this.state.selectId[i]) {
|
||||
index = i
|
||||
}
|
||||
}
|
||||
console.log(this.state.selectScore[index])
|
||||
return this.state.selectScore[index]
|
||||
}
|
||||
// 阅卷区
|
||||
showTest = () => {
|
||||
let testPaper = null;
|
||||
if (this.state.currentPaper.testInfos != undefined) {
|
||||
testPaper = this.state.currentPaper.testInfos.map((item) => {
|
||||
return <div className="test-question-img" data-content-before={this.imgScore(item.test_detail_id)}>
|
||||
<img src={'data:image/jpg;base64,' + item.picCode} alt="加载失败" />
|
||||
</div>
|
||||
})
|
||||
}
|
||||
|
||||
return testPaper
|
||||
}
|
||||
selectBox = (index) => {
|
||||
// 题目选择区
|
||||
selectBox = () => {
|
||||
let selectList
|
||||
if (this.state.markScore.length != 0) {
|
||||
selectList = this.state.markScore[index].map((item, i) => {
|
||||
return <Option key={i} value={item} label={item}>{item}</Option>
|
||||
if (this.state.questionList.length != 0) {
|
||||
selectList = this.state.questionList.map((item, i) => {
|
||||
return <Option key={i} value={item.QuestionName} label={item.QuestionName}>{item.QuestionName}</Option>
|
||||
})
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
return selectList
|
||||
}
|
||||
select = (e) => {
|
||||
let index
|
||||
for (let i = 0; i < this.state.questionList.length; i++) {
|
||||
if (this.state.questionList[i].QuestionName === e) {
|
||||
index = i
|
||||
}
|
||||
}
|
||||
this.tableData(this.state.questionList[index].QuestionId)
|
||||
}
|
||||
// 选择区
|
||||
|
||||
showSelect = () => {
|
||||
let scoreSelect = null;
|
||||
if (this.state.currentPaper.testInfos != undefined) {
|
||||
scoreSelect = this.state.currentPaper.subTopic.map((item, index) => {
|
||||
return <div className="score-select">
|
||||
{item.question_detail_name}:<Select
|
||||
paperMark =() => {
|
||||
this.props.history.push('/home/group/markTasks/3')
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<DocumentTitle title="阅卷系统-自评卷">
|
||||
<div className="group-marking-page" data-component="group-marking-page">
|
||||
<div className="search-container">
|
||||
<div className="question-select">
|
||||
题目选择:<Select
|
||||
showSearch
|
||||
key={index}
|
||||
placeholder="请选择分数"
|
||||
style={{ width: 120 }}
|
||||
onSelect={this.select.bind(this, item.test_detail_id)}
|
||||
optionFilterProp="label"
|
||||
onSelect={(e) => { this.select(e) }}
|
||||
filterOption={(input, option) =>
|
||||
option.label.indexOf(input) >= 0
|
||||
}
|
||||
filterSort={(optionA, optionB) =>
|
||||
optionA.label.localeCompare(optionB.label)
|
||||
}
|
||||
defaultValue={this.state.selectScore[index]}
|
||||
placeholder={this.state.questionList.length > 0 ? this.state.questionList[0].QuestionName : null}
|
||||
defaultValue={this.state.questionList.length > 0 ? this.state.questionList[0].QuestionName : null}
|
||||
>
|
||||
{
|
||||
this.selectBox(index)
|
||||
this.selectBox()
|
||||
}
|
||||
</Select>
|
||||
</div>
|
||||
})
|
||||
}
|
||||
|
||||
return scoreSelect
|
||||
}
|
||||
select = (item, value) => {
|
||||
console.log(item)
|
||||
if (this.state.selectId.length < 3) {
|
||||
this.setState({
|
||||
selectId: [...this.state.selectId, item],
|
||||
selectScore: [...this.state.selectScore, value]
|
||||
})
|
||||
} else {
|
||||
let reviseSelectNo = 0;
|
||||
let newSelectScore = [];
|
||||
for (let i = 0; i < this.state.selectId.length; i++) {
|
||||
if (this.state.selectId[i] == item) {
|
||||
reviseSelectNo = i
|
||||
}
|
||||
}
|
||||
this.state.selectScore.map((e, index) => {
|
||||
if (index == reviseSelectNo) {
|
||||
newSelectScore.push(value)
|
||||
} else {
|
||||
newSelectScore.push(e)
|
||||
}
|
||||
})
|
||||
this.setState({
|
||||
selectScore: newSelectScore
|
||||
})
|
||||
}
|
||||
console.log(this.state.selectId, this.state.selectScore)
|
||||
}
|
||||
renderScoreDropDown() {
|
||||
|
||||
return (
|
||||
<div className="score-container">
|
||||
{
|
||||
this.showSelect()
|
||||
}
|
||||
<div className="paper-num">
|
||||
待自评数:{this.state.count}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
renderPush() {
|
||||
|
||||
return (
|
||||
<div className="push-container">
|
||||
<div>
|
||||
<Button type="primary" style={{ width: 60 }} className="push-submit" onClick={() => {
|
||||
this.showWarning(1)
|
||||
}}>提交</Button>
|
||||
<div className="paper-mark" onClick={() => {this.paperMark()}}>
|
||||
评阅所有自评卷
|
||||
</div>
|
||||
<div className="push-paper" >
|
||||
<Button className="push-problem" style={{ width: 60 }} onClick={() => {
|
||||
this.showWarning(2)
|
||||
}}>问题卷</Button>
|
||||
<Button className="push-excellent" style={{ width: 60 }} onClick={() => {
|
||||
this.showWarning(3)
|
||||
}}>优秀卷</Button>
|
||||
</div>
|
||||
{
|
||||
this.problemModal()
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
showWarning = (value) => {
|
||||
let title = '';
|
||||
let okContent = '提交后系统将记录该试卷';
|
||||
switch (value) {
|
||||
case 1:
|
||||
title = '请确认是否提交该试卷';
|
||||
break;
|
||||
case 2:
|
||||
title = '请确认是否提交该问题卷';
|
||||
break;
|
||||
case 3:
|
||||
title = '请确认是否提交该优秀卷';
|
||||
break;
|
||||
}
|
||||
|
||||
if (value == 1) {
|
||||
let selectOrdered = []
|
||||
for (let i = 0; i < this.state.subTopic.length; i++) {
|
||||
for (let j = 0; j < this.state.selectId.length; j++) {
|
||||
if (this.state.selectId[j] == this.state.subTopic[i].test_detail_id) {
|
||||
selectOrdered.push(this.state.selectScore[j])
|
||||
}
|
||||
}
|
||||
}
|
||||
let content = '该试卷评分记录为:';
|
||||
for (let i = 0; i < selectOrdered.length; i++) {
|
||||
content += selectOrdered[i] + '\n'
|
||||
}
|
||||
okContent = content + '提交后系统将记录该试卷';
|
||||
}
|
||||
|
||||
Modal.confirm({
|
||||
title: title,
|
||||
icon: <ExclamationCircleOutlined />,
|
||||
content: okContent,
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
let Qustion_detail_id = Util.getTextByJs(this.state.selectId);
|
||||
let Question_detail_score = Util.getTextByJs(this.state.selectScore);
|
||||
if (value == 1) {
|
||||
group.MonitorPoint({
|
||||
supervisorId: '2',
|
||||
testId: this.state.TestId,
|
||||
scores: Question_detail_score,
|
||||
testDetailId: Qustion_detail_id
|
||||
})
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
selectId: [],
|
||||
selectScore: [],
|
||||
currentPaper: {},
|
||||
})
|
||||
message.success('提交成功');
|
||||
this.props.history.push('/home/markMonitor/self')
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
} else if (value == 3) {
|
||||
console.log('3')
|
||||
} else {
|
||||
console.log('2', this)
|
||||
this.setState({
|
||||
problemVisible: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
onRidioChange = e => {
|
||||
console.log('radio checked', e.target.value);
|
||||
this.setState({
|
||||
problemValue: e.target.value,
|
||||
});
|
||||
}
|
||||
|
||||
handelChange(e) {
|
||||
this.setState({
|
||||
inpValu: e.target.value
|
||||
})
|
||||
}
|
||||
|
||||
problemModal() {
|
||||
const { problemValue } = this.state;
|
||||
return (
|
||||
<Modal
|
||||
title="请选择问题卷类型"
|
||||
visible={this.state.problemVisible}
|
||||
onOk={() => this.handleOk(2)}
|
||||
onCancel={() => { this.handleCancel(2) }}
|
||||
>
|
||||
<Radio.Group onChange={this.onRidioChange} value={problemValue}>
|
||||
<Space direction="vertical">
|
||||
<Radio value={1}>图像不清</Radio>
|
||||
<Radio value={2}>答错题目</Radio>
|
||||
<Radio value={3}>其他错误</Radio>
|
||||
</Space>
|
||||
</Radio.Group>
|
||||
<Input placeholder="请输入问题" onChange={this.handelChange.bind(this)} style={{ marginTop: 10 }} />
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<DocumentTitle title="阅卷系统-自评卷">
|
||||
<div className="group-marking-page" data-component="group-marking-page">
|
||||
<div className="mark-paper">
|
||||
{
|
||||
this.showTest()
|
||||
}
|
||||
</div>
|
||||
<div className="mark-score">
|
||||
{
|
||||
this.renderScoreDropDown()
|
||||
}
|
||||
{
|
||||
this.renderPush()
|
||||
}
|
||||
<div className="display-container">
|
||||
<Table
|
||||
pagination={{ position: ['bottomCenter'] }}
|
||||
columns={this.columns}
|
||||
dataSource={this.state.tableData}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</DocumentTitle>
|
||||
|
|
|
@ -2,82 +2,31 @@
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #F0F2F5;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.search-container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
> .mark-paper {
|
||||
flex: 4;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
width: calc(100% - 1px);
|
||||
box-sizing: border-box;
|
||||
margin: 0px 70px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.test-question-img{
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
max-height: calc(33% - 20px);
|
||||
margin-top: 20px;
|
||||
position: relative;
|
||||
img {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
max-height: 100%;
|
||||
margin-left: 1px;
|
||||
padding-left: 24px;
|
||||
height: 60px;
|
||||
.paper-num {
|
||||
margin-left: 56px;
|
||||
}
|
||||
&::before{
|
||||
content: attr(data-content-before);
|
||||
position: absolute;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 2px solid red;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
font-weight: 600;
|
||||
.paper-mark {
|
||||
float:right;
|
||||
margin-left: auto;
|
||||
margin-right: 24px;
|
||||
color: #1890FF;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mark-score {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.score-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.score-select {
|
||||
.display-container{
|
||||
margin-top: 24px;
|
||||
font-size: 14px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
.push-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top: 30px;
|
||||
.push-paper {
|
||||
padding: 48px 24px 24px;
|
||||
display: flex;
|
||||
border-bottom: 1px solid #D9D9D9;
|
||||
button {
|
||||
box-sizing: border-box;
|
||||
margin:0px 7px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,49 +1,47 @@
|
|||
import React, { Component, useState } from 'react'
|
||||
import DocumentTitle from 'react-document-title'
|
||||
import { Table, Modal, Dropdown, Button, message, Space, Tooltip, Select, Radio, Input } from 'antd';
|
||||
import { ExclamationCircleOutlined, } from '@ant-design/icons';
|
||||
import { Modal, Dropdown, Button, message, Space, Tooltip, Select, Radio, Input } from 'antd';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
||||
import Zmage from 'react-zmage'
|
||||
|
||||
import './index.less'
|
||||
import Marking from "../../../api/marking";
|
||||
|
||||
import * as Util from "../../../util/Util";
|
||||
import Marking from "../../../api/marking";
|
||||
const { Option } = Select;
|
||||
export default class index extends Component {
|
||||
|
||||
userId = "1"
|
||||
|
||||
state = {
|
||||
reviewVisible: true,
|
||||
reviewList: [],
|
||||
problemVisible: false,
|
||||
inpValu: '',
|
||||
problemValue: 1,
|
||||
inpValu: '',
|
||||
papers: [],
|
||||
currentPaper: {},
|
||||
currentPaperNum: 0,
|
||||
testLength: 0,
|
||||
selectId: [],
|
||||
selectScore: [],
|
||||
subTopic: [],
|
||||
markScore: [],
|
||||
}
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.getReviewList();
|
||||
this.getAllPaper();
|
||||
}
|
||||
|
||||
getReviewList = () => {
|
||||
Marking.testReview({ userId: this.userId })
|
||||
// 总试卷获取
|
||||
getAllPaper = () => {
|
||||
Marking.testSelf({ userId: this.userId })
|
||||
.then((res) => {
|
||||
if (res.data.status == "10000") {
|
||||
let reviewList = []
|
||||
for (let i = 0; i < res.data.data.testId.length; i++) {
|
||||
reviewList.push({
|
||||
order: i + 1,
|
||||
test_id: res.data.data.testId[i],
|
||||
score: res.data.data.score[i]
|
||||
})
|
||||
let papers = [...res.data.data.TestIds]
|
||||
this.setState(
|
||||
{
|
||||
papers,
|
||||
}
|
||||
this.setState({
|
||||
reviewList
|
||||
})
|
||||
)
|
||||
this.getCurrentPaper();
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
|
@ -51,172 +49,22 @@ export default class index extends Component {
|
|||
})
|
||||
}
|
||||
|
||||
columns = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'order',
|
||||
},
|
||||
{
|
||||
title: '试卷号',
|
||||
dataIndex: 'test_id',
|
||||
},
|
||||
{
|
||||
title: '分数',
|
||||
dataIndex: 'score',
|
||||
},
|
||||
];
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
<DocumentTitle title="阅卷系统-自评">
|
||||
<div className="selfMark-tasks-page" data-component="selfMark-tasks-page">
|
||||
<div className="mark-paper">
|
||||
{
|
||||
this.showTest()
|
||||
}
|
||||
</div>
|
||||
<div className="mark-score">
|
||||
{
|
||||
this.renderScoreDropDown()
|
||||
}
|
||||
{
|
||||
this.renderPush()
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</DocumentTitle>
|
||||
)
|
||||
|
||||
}
|
||||
handleOk = (value) => {
|
||||
if (value == 1) {
|
||||
this.setState({
|
||||
reviewVisible: false,
|
||||
});
|
||||
} else {
|
||||
if (this.state.problemValue == 3) {
|
||||
Marking.testProblem({
|
||||
userId: this.userId,
|
||||
testId: this.state.currentPaper.testId,
|
||||
problemType: this.state.problemValue,
|
||||
problemMessage: this.state.inpValu
|
||||
})
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
selectId: [],
|
||||
selectScore: [],
|
||||
reviewVisible: true
|
||||
})
|
||||
this.getReviewList();
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
} else {
|
||||
Marking.testProblem({
|
||||
userId: this.userId,
|
||||
testId: this.state.currentPaper.testId,
|
||||
problemType: this.state.problemValue
|
||||
})
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
selectId: [],
|
||||
selectScore: [],
|
||||
reviewVisible: true
|
||||
})
|
||||
this.getReviewList();
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
this.setState({
|
||||
problemVisible: false,
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
handleCancel = (value) => {
|
||||
if (value == 1) {
|
||||
this.setState({
|
||||
reviewVisible: false,
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
problemVisible: false,
|
||||
});
|
||||
}
|
||||
};
|
||||
reviewModal() {
|
||||
return (
|
||||
<Modal
|
||||
title="回评列表"
|
||||
visible={this.state.reviewVisible}
|
||||
onOk={() => this.handleOk(1)}
|
||||
onCancel={() => { this.handleCancel(1) }}
|
||||
width={800}
|
||||
maskClosable={false}
|
||||
>
|
||||
{
|
||||
this.reviewTable()
|
||||
}
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
reviewTable() {
|
||||
return (
|
||||
<Table
|
||||
columns={this.columns}
|
||||
pagination={false}
|
||||
dataSource={this.state.reviewList}
|
||||
onRow={(record) => ({
|
||||
onClick: () => {
|
||||
this.selectRow(record);
|
||||
},
|
||||
})}
|
||||
/>
|
||||
)
|
||||
}
|
||||
selectRow = (record) => {
|
||||
this.getCurrentPaper(record.test_id)
|
||||
this.setState({
|
||||
reviewVisible: false
|
||||
})
|
||||
}
|
||||
// 当前试卷
|
||||
getCurrentPaper = (test_id) => {
|
||||
Marking.testDisplay({ userId: this.userId, testId: test_id })
|
||||
getCurrentPaper = () => {
|
||||
Marking.testDisplay({ userId: this.userId, testId: this.state.papers[0] })
|
||||
.then((res) => {
|
||||
if (res.data.status == "10000") {
|
||||
let currentPaper = res.data.data
|
||||
let subTopic = res.data.data.subTopic
|
||||
let testInfos = res.data.data.testInfos
|
||||
let testLength = res.data.data.subTopic.length
|
||||
let markScore = []
|
||||
let selectId = []
|
||||
let selectScore = []
|
||||
for (let i = 0; i < subTopic.length; i++) {
|
||||
markScore.push(subTopic[i].score_type.split('-'))
|
||||
selectId.push(testInfos[i].test_detail_id)
|
||||
// 判断用户改卷
|
||||
let userScore
|
||||
if (this.userId == testInfos[i].examiner_first_id) {
|
||||
userScore = testInfos[i].examiner_first_score
|
||||
} else if (this.userId == testInfos[i].examiner_second_id) {
|
||||
userScore = testInfos[i].examiner_second_score
|
||||
} else if (this.userId == testInfos[i].examiner_second_id) {
|
||||
userScore = testInfos[i].examiner_third_score
|
||||
}
|
||||
selectScore.push(userScore)
|
||||
}
|
||||
this.setState({
|
||||
currentPaper,
|
||||
subTopic,
|
||||
markScore,
|
||||
selectId,
|
||||
selectScore,
|
||||
testLength
|
||||
})
|
||||
}
|
||||
|
@ -225,6 +73,7 @@ export default class index extends Component {
|
|||
console.log(e)
|
||||
})
|
||||
}
|
||||
|
||||
// 打分展示
|
||||
imgScore = (item) => {
|
||||
let index
|
||||
|
@ -236,19 +85,21 @@ export default class index extends Component {
|
|||
console.log(this.state.selectScore[index])
|
||||
return this.state.selectScore[index]
|
||||
}
|
||||
|
||||
// 阅卷区
|
||||
showTest = () => {
|
||||
let testPaper = null;
|
||||
if (this.state.currentPaper.testInfos != undefined) {
|
||||
testPaper = this.state.currentPaper.testInfos.map((item) => {
|
||||
return <div className="test-question-img" data-content-before={this.imgScore(item.test_detail_id)}>
|
||||
<img src={'data:image/jpg;base64,' + item.picCode} alt="加载失败" />
|
||||
<img src={'data:image/jpg;base64,'+item.picCode} alt="加载失败" />
|
||||
</div>
|
||||
})
|
||||
}
|
||||
|
||||
return testPaper
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<DocumentTitle title="阅卷系统-评卷">
|
||||
|
@ -265,16 +116,13 @@ export default class index extends Component {
|
|||
{
|
||||
this.renderPush()
|
||||
}
|
||||
{
|
||||
this.reviewModal()
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</DocumentTitle>
|
||||
)
|
||||
}
|
||||
// 评分区
|
||||
|
||||
// 评分区
|
||||
selectBox = (index) => {
|
||||
let selectList
|
||||
if (this.state.markScore.length != 0) {
|
||||
|
@ -305,10 +153,10 @@ export default class index extends Component {
|
|||
filterSort={(optionA, optionB) =>
|
||||
optionA.label.localeCompare(optionB.label)
|
||||
}
|
||||
defaultValue={this.state.selectScore[index]}
|
||||
>
|
||||
{
|
||||
this.selectBox(index)
|
||||
// this.selectBox(item.question_detail_score)
|
||||
}
|
||||
</Select>
|
||||
</div>
|
||||
|
@ -355,6 +203,7 @@ export default class index extends Component {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
renderPush() {
|
||||
|
||||
return (
|
||||
|
@ -371,10 +220,10 @@ export default class index extends Component {
|
|||
<Button className="push-excellent" style={{ width: 60 }} onClick={() => {
|
||||
this.showWarning(3)
|
||||
}}>优秀卷</Button>
|
||||
</div> */}
|
||||
</div>
|
||||
{
|
||||
// this.problemModal()
|
||||
}
|
||||
this.problemModal()
|
||||
} */}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -409,7 +258,6 @@ export default class index extends Component {
|
|||
}
|
||||
okContent = content + '提交后系统将记录该试卷';
|
||||
}
|
||||
|
||||
Modal.confirm({
|
||||
title: title,
|
||||
icon: <ExclamationCircleOutlined />,
|
||||
|
@ -420,7 +268,10 @@ export default class index extends Component {
|
|||
let Qustion_detail_id = Util.getTextByJs(this.state.selectId);
|
||||
let Question_detail_score = Util.getTextByJs(this.state.selectScore);
|
||||
if (value == 1) {
|
||||
Marking.testReviewPoint({
|
||||
if (this.state.selectScore.length < this.state.testLength) {
|
||||
message.warning('请将分数打全')
|
||||
} else {
|
||||
Marking.testSelfScore({
|
||||
userId: this.userId,
|
||||
testId: this.state.currentPaper.testId,
|
||||
scores: Question_detail_score,
|
||||
|
@ -431,16 +282,16 @@ export default class index extends Component {
|
|||
this.setState({
|
||||
selectId: [],
|
||||
selectScore: [],
|
||||
currentPaper: {},
|
||||
reviewVisible: true
|
||||
currentPaper: {}
|
||||
})
|
||||
message.success('回评成功');
|
||||
this.props.history.push('/home/mark-tasks')
|
||||
this.getAllPaper();
|
||||
message.success('自评成功')
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
} else if (value == 3) {
|
||||
console.log('3')
|
||||
} else {
|
||||
|
@ -453,36 +304,83 @@ export default class index extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
// handelChange(e) {
|
||||
// this.setState({
|
||||
// inpValu: e.target.value
|
||||
// })
|
||||
// }
|
||||
// onRidioChange = e => {
|
||||
// console.log('radio checked', e.target.value);
|
||||
// this.setState({
|
||||
// problemValue: e.target.value,
|
||||
// });
|
||||
// }
|
||||
// problemModal() {
|
||||
// const { problemValue } = this.state;
|
||||
// return (
|
||||
// <Modal
|
||||
// title="请选择问题卷类型"
|
||||
// visible={this.state.problemVisible}
|
||||
// onOk={() => this.handleOk(2)}
|
||||
// onCancel={() => { this.handleCancel(2) }}
|
||||
// >
|
||||
// <Radio.Group onChange={this.onRidioChange} value={problemValue}>
|
||||
// <Space direction="vertical">
|
||||
// <Radio value={1}>图像不清</Radio>
|
||||
// <Radio value={2}>答错题目</Radio>
|
||||
// <Radio value={3}>其他错误</Radio>
|
||||
// </Space>
|
||||
// </Radio.Group>
|
||||
// <Input placeholder="请输入问题" onChange={this.handelChange.bind(this)} style={{ marginTop: 10 }} />
|
||||
// </Modal>
|
||||
// )
|
||||
// }
|
||||
handleOk = () => {
|
||||
if (this.state.problemValue == 3) {
|
||||
Marking.testProblem({
|
||||
userId: this.userId,
|
||||
testId: this.state.currentPaper.testId,
|
||||
problemType: this.state.problemValue,
|
||||
problemMessage :this.state.inpValu
|
||||
})
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
selectId: [],
|
||||
selectScore: [],
|
||||
currentPaper: {}
|
||||
})
|
||||
this.getAllPaper();
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
} else {
|
||||
// Marking.testProblem({
|
||||
// userId: this.userId,
|
||||
// testId: this.state.currentPaper.testId,
|
||||
// problemType: this.state.problemValue
|
||||
// })
|
||||
// .then((res) => {
|
||||
// this.setState({
|
||||
// selectId: [],
|
||||
// selectScore: [],
|
||||
// currentPaper: {}
|
||||
// })
|
||||
// this.getAllPaper();
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// console.log(e)
|
||||
// })
|
||||
}
|
||||
// this.setState({
|
||||
// problemVisible: false,
|
||||
// });
|
||||
};
|
||||
|
||||
// handleCancel = () => {
|
||||
// console.log('Clicked cancel button');
|
||||
// this.setState({
|
||||
// problemVisible: false,
|
||||
// });
|
||||
// };
|
||||
// onRidioChange = e => {
|
||||
// console.log('radio checked', e.target.value);
|
||||
// this.setState({
|
||||
// problemValue: e.target.value,
|
||||
// });
|
||||
// }
|
||||
// handelChange(e) {
|
||||
// this.setState({
|
||||
// inpValu: e.target.value
|
||||
// })
|
||||
// }
|
||||
// problemModal() {
|
||||
// const { problemValue } = this.state;
|
||||
// return (
|
||||
// <Modal
|
||||
// title="请选择问题卷类型"
|
||||
// visible={this.state.problemVisible}
|
||||
// onOk={this.handleOk}
|
||||
// onCancel={this.handleCancel}
|
||||
// >
|
||||
// <Radio.Group onChange={this.onRidioChange} value={problemValue}>
|
||||
// <Space direction="vertical">
|
||||
// <Radio value={1}>图像不清</Radio>
|
||||
// <Radio value={2}>答错题目</Radio>
|
||||
// <Radio value={3}>其他错误</Radio>
|
||||
// </Space>
|
||||
// </Radio.Group>
|
||||
// <Input placeholder="请输入问题" onChange={this.handelChange.bind(this)} style={{ marginTop: 10 }} />
|
||||
// </Modal>
|
||||
// )
|
||||
// }
|
||||
}
|
|
@ -4079,8 +4079,8 @@ csstype@^3.0.2:
|
|||
|
||||
customize-cra@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.nlark.com/customize-cra/download/customize-cra-1.0.0.tgz#73286563631aa08127ad4d30a2e3c89cf4e93c8d"
|
||||
integrity sha1-cyhlY2MaoIEnrU0wouPInPTpPI0=
|
||||
resolved "https://registry.yarnpkg.com/customize-cra/-/customize-cra-1.0.0.tgz#73286563631aa08127ad4d30a2e3c89cf4e93c8d"
|
||||
integrity sha512-DbtaLuy59224U+xCiukkxSq8clq++MOtJ1Et7LED1fLszWe88EoblEYFBJ895sB1mC6B4uu3xPT/IjClELhMbA==
|
||||
dependencies:
|
||||
lodash.flow "^3.5.0"
|
||||
|
||||
|
@ -9654,8 +9654,8 @@ react-app-polyfill@^2.0.0:
|
|||
|
||||
react-app-rewired@^2.1.8:
|
||||
version "2.1.8"
|
||||
resolved "https://registry.nlark.com/react-app-rewired/download/react-app-rewired-2.1.8.tgz#e192f93b98daf96889418d33d3e86cf863812b56"
|
||||
integrity sha1-4ZL5O5ja+WiJQY0z0+hs+GOBK1Y=
|
||||
resolved "https://registry.yarnpkg.com/react-app-rewired/-/react-app-rewired-2.1.8.tgz#e192f93b98daf96889418d33d3e86cf863812b56"
|
||||
integrity sha512-wjXPdKPLscA7mn0I1de1NHrbfWdXz4S1ladaGgHVKdn1hTgKK5N6EdGIJM0KrS6bKnJBj7WuqJroDTsPKKr66Q==
|
||||
dependencies:
|
||||
semver "^5.6.0"
|
||||
|
||||
|
|
Loading…
Reference in New Issue