feat:group selfMark

This commit is contained in:
scales 2021-09-25 23:56:13 +08:00
parent db45985e4e
commit a8b26798cd
9 changed files with 436 additions and 730 deletions

View File

@ -1 +1 @@
{"C:\\Users\\chen\\go\\src\\open-ct\\controllers":1632573379237283200}
{"C:\\Users\\yang\\Desktop\\阅卷系统\\controllers":1632576621003759500}

View File

@ -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

View File

@ -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)
},
}

View File

@ -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>
},
]

View File

@ -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,16 +216,18 @@ export default class index extends Component {
this.showWarning(1)
}}>提交</Button>
</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()
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>
{
this.problemModal()
}
</div> : null
}
</div>
);
@ -276,8 +295,9 @@ export default class index extends Component {
} else if (this.state.type === '问题卷') {
this.getProblemTestId()
} else {
this.getSelfTestId()
}
}
}
})
.catch((e) => {
console.log(e)
@ -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({
@ -313,7 +333,7 @@ export default class index extends Component {
if (this.state.type === '仲裁卷') {
this.getArbitrationTestId();
} else if (this.state.type === '问题卷') {
this.getProblemTestId()
} else {
}
@ -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,
@ -338,7 +358,7 @@ export default class index extends Component {
if (this.state.type === '仲裁卷') {
this.getArbitrationTestId();
} else if (this.state.type === '问题卷') {
this.getProblemTestId()
} else {
}
@ -347,7 +367,7 @@ export default class index extends Component {
console.log(e)
})
}
this.setState({
problemVisible: false,
});
@ -361,9 +381,9 @@ export default class index extends Component {
};
handelChange(e) {
this.setState({
inpValu: e.target.value
inpValu: e.target.value
})
}
}
onRidioChange = e => {
console.log('radio checked', e.target.value);
this.setState({
@ -386,14 +406,14 @@ export default class index extends Component {
<Radio value={3}>其他错误</Radio>
</Space>
</Radio.Group>
<Input placeholder="请输入问题" onChange={this.handelChange.bind(this)} style={{ marginTop: 10 }} />
<Input placeholder="请输入问题" onChange={this.handelChange.bind(this)} style={{ marginTop: 10 }} />
</Modal>
)
}
//
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,20 +421,20 @@ 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="加载失败" />
</div>
return <div className="answer-question-img">
<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" />
})
}
}
}
return testPaper
}
@ -466,79 +486,79 @@ export default class index extends Component {
//
getSampleList = () => {
Marking.testExampleList({ userId: '1', testId: 1 })
.then((res) => {
if (res.data.status === "10000") {
let sampleList = []
for (let i = 0; i< res.data.data.exampleTestPapers.length; i++) {
sampleList.push({
order: i,
question_id: res.data.data.exampleTestPapers[i].test_id,
question_name: res.data.data.exampleTestPapers[i].candidate,
score: res.data.data.exampleTestPapers[i].final_score,
})
}
this.setState({
sampleList: sampleList
})
}
})
.catch((e) => {
console.log(e)
})
}
columns = [
.then((res) => {
if (res.data.status === "10000") {
let sampleList = []
for (let i = 0; i < res.data.data.exampleTestPapers.length; i++) {
sampleList.push({
order: i,
question_id: res.data.data.exampleTestPapers[i].test_id,
question_name: res.data.data.exampleTestPapers[i].candidate,
score: res.data.data.exampleTestPapers[i].final_score,
})
}
this.setState({
sampleList: sampleList
})
}
})
.catch((e) => {
console.log(e)
})
}
columns = [
{
title: '序号',
width: 90,
dataIndex: 'order',
title: '序号',
width: 90,
dataIndex: 'order',
},
{
title: '题号',
width: 90,
dataIndex: 'question_id',
title: '题号',
width: 90,
dataIndex: 'question_id',
},
{
title: '题名',
width: 90,
dataIndex: 'question_name',
title: '题名',
width: 90,
dataIndex: 'question_name',
},
{
title: '分数',
width: 90,
dataIndex: 'score',
title: '分数',
width: 90,
dataIndex: 'score',
},
];
sampleTable() {
];
sampleTable() {
return (
<Table columns={this.columns}
dataSource={this.state.sampleList}
scroll={{ x: 400 }}
pagination={{ position: ['bottomCenter'] }}
onRow={(record) => ({
onClick: () => {
this.selectRow(record);
},
})}
/>
<Table columns={this.columns}
dataSource={this.state.sampleList}
scroll={{ x: 400 }}
pagination={{ position: ['bottomCenter'] }}
onRow={(record) => ({
onClick: () => {
this.selectRow(record);
},
})}
/>
)
}
selectRow = (record) => {
}
selectRow = (record) => {
console.log(record.order)
Marking.testDetail({ userId: '1', exampleTestId: record.question_id })
.then((res) => {
if (res.data.status == "10000") {
this.setState({
samplePaper: res.data.data.test[record.order]
.then((res) => {
if (res.data.status == "10000") {
this.setState({
samplePaper: res.data.data.test[record.order]
})
console.log(this.state.samplePaper)
}
})
console.log(this.state.samplePaper)
}
})
.catch((e) => {
console.log(e)
})
}
.catch((e) => {
console.log(e)
})
}
render() {
return (
<DocumentTitle title={'试卷管理-' + this.state.type}>
@ -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>

View File

@ -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
}
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
showSearch
key={index}
placeholder="请选择分数"
style={{ width: 120 }}
onSelect={this.select.bind(this, item.test_detail_id)}
optionFilterProp="label"
filterOption={(input, option) =>
option.label.indexOf(input) >= 0
}
filterSort={(optionA, optionB) =>
optionA.label.localeCompare(optionB.label)
}
defaultValue={this.state.selectScore[index]}
>
{
this.selectBox(index)
}
</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
}
select = (e) => {
let index
for (let i = 0; i < this.state.questionList.length; i++) {
if (this.state.questionList[i].QuestionName === e) {
index = 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)
this.tableData(this.state.questionList[index].QuestionId)
}
renderScoreDropDown() {
//
return (
<div className="score-container">
{
this.showSelect()
}
</div>
);
paperMark =() => {
this.props.history.push('/home/group/markTasks/3')
}
renderPush() {
return (
<div className="push-container">
<div>
<Button type="primary" style={{ width: 60 }} className="push-submit" onClick={() => {
this.showWarning(1)
}}>提交</Button>
</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 className="search-container">
<div className="question-select">
题目选择<Select
showSearch
style={{ width: 120 }}
optionFilterProp="label"
onSelect={(e) => { this.select(e) }}
filterOption={(input, option) =>
option.label.indexOf(input) >= 0
}
filterSort={(optionA, optionB) =>
optionA.label.localeCompare(optionB.label)
}
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()
}
</Select>
</div>
<div className="paper-num">
待自评数{this.state.count}
</div>
<div className="paper-mark" onClick={() => {this.paperMark()}}>
评阅所有自评卷
</div>
</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>

View File

@ -3,81 +3,30 @@
height: 100%;
background-color: #F0F2F5;
display: flex;
flex-direction: row;
> .mark-paper {
flex: 4;
height: 100%;
flex-direction: column;
.search-container {
display: flex;
flex-direction: row;
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%;
}
&::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;
}
}
}
.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 {
margin-top: 24px;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
}
margin-left: 1px;
padding-left: 24px;
height: 60px;
.paper-num {
margin-left: 56px;
}
.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;
}
}
.paper-mark {
float:right;
margin-left: auto;
margin-right: 24px;
color: #1890FF;
cursor: pointer;
}
}
.display-container{
margin-top: 24px;
margin-left: 24px;
}
}

View File

@ -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]
})
}
this.setState({
reviewList
})
let papers = [...res.data.data.TestIds]
this.setState(
{
papers,
}
)
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,27 +268,30 @@ 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({
userId: this.userId,
testId: this.state.currentPaper.testId,
scores: Question_detail_score,
testDetailId: Qustion_detail_id
})
.then((res) => {
if (res.data.status == "10000") {
this.setState({
selectId: [],
selectScore: [],
currentPaper: {},
reviewVisible: true
})
message.success('回评成功');
this.props.history.push('/home/mark-tasks')
}
})
.catch((e) => {
console.log(e)
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,
testDetailId: Qustion_detail_id
})
.then((res) => {
if (res.data.status == "10000") {
this.setState({
selectId: [],
selectScore: [],
currentPaper: {}
})
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>
// )
// }
}

View File

@ -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"