refactor: rename and convert type of args
This commit is contained in:
parent
c4479cf8ab
commit
15b76f1fd9
|
@ -16,6 +16,7 @@ export default class index extends Component {
|
||||||
getAllPaper = () => {
|
getAllPaper = () => {
|
||||||
Marking.testList({ userId: this.userId })
|
Marking.testList({ userId: this.userId })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
console.log(res)
|
||||||
if (res.data.status == "10000") {
|
if (res.data.status == "10000") {
|
||||||
let papers = [...res.data.data.papers]
|
let papers = [...res.data.data.papers]
|
||||||
this.setState(
|
this.setState(
|
||||||
|
@ -33,8 +34,9 @@ export default class index extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
getAnswer = () => {
|
getAnswer = () => {
|
||||||
Marking.testAnswer({ userId: this.userId, testId: "1" })
|
Marking.testAnswer({ userId: this.userId, testId: 1 })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
console.log(res)
|
||||||
if (res.data.status == "10000") {
|
if (res.data.status == "10000") {
|
||||||
this.setState({
|
this.setState({
|
||||||
keyTest: res.data.data.keyTest
|
keyTest: res.data.data.keyTest
|
||||||
|
@ -55,7 +57,7 @@ export default class index extends Component {
|
||||||
let testPaper = null;
|
let testPaper = null;
|
||||||
if (this.state.keyTest != undefined || this.state.keyTest != null) {
|
if (this.state.keyTest != undefined || this.state.keyTest != null) {
|
||||||
testPaper = this.state.keyTest.map((item) => {
|
testPaper = this.state.keyTest.map((item) => {
|
||||||
return <img src={item.Pic_src} alt="加载失败" className="test-question-img"/>
|
return <img src={item} alt="加载失败" className="test-question-img"/>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default class index extends Component {
|
||||||
}
|
}
|
||||||
// 当前试卷
|
// 当前试卷
|
||||||
getCurrentPaper = () => {
|
getCurrentPaper = () => {
|
||||||
Marking.testDisplay({ userId: this.userId, testId: this.state.papers[0].Test_id.toString() })
|
Marking.testDisplay({ userId: this.userId, testId: this.state.papers[0] })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.status == "10000") {
|
if (res.data.status == "10000") {
|
||||||
let currentPaper = JSON.parse(JSON.stringify(res.data.data))
|
let currentPaper = JSON.parse(JSON.stringify(res.data.data))
|
||||||
|
@ -75,9 +75,9 @@ export default class index extends Component {
|
||||||
// 阅卷区
|
// 阅卷区
|
||||||
showTest = () => {
|
showTest = () => {
|
||||||
let testPaper = null;
|
let testPaper = null;
|
||||||
if (this.state.currentPaper.picSrcs != undefined) {
|
if (this.state.currentPaper.testInfos != undefined) {
|
||||||
testPaper = this.state.currentPaper.picSrcs.map((item) => {
|
testPaper = this.state.currentPaper.testInfos.map((item) => {
|
||||||
return <img src={item.Pic_src} alt="加载失败" className="test-question-img"/>
|
return <img src={item.pic_src} alt="加载失败" className="test-question-img"/>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,12 +118,12 @@ export default class index extends Component {
|
||||||
}
|
}
|
||||||
showSelect = () => {
|
showSelect = () => {
|
||||||
let scoreSelect = null;
|
let scoreSelect = null;
|
||||||
if (this.state.currentPaper.picSrcs != undefined) {
|
if (this.state.currentPaper.testInfos != undefined) {
|
||||||
scoreSelect = this.state.currentPaper.subTopic.map((item,index) => {
|
scoreSelect = this.state.currentPaper.subTopic.map((item,index) => {
|
||||||
return <div className="score-select">
|
return <div className="score-select">
|
||||||
{item.Question_detail_name}:<Select key={index} placeholder="请选择分数" style={{ width: 120 }} onSelect={this.select.bind(this,item.Question_detail_id)}>
|
{item.question_detail_name}:<Select key={index} placeholder="请选择分数" style={{ width: 120 }} onSelect={this.select.bind(this,item.test_detail_id)}>
|
||||||
{
|
{
|
||||||
this.selectBox(item.Question_detail_score)
|
this.selectBox(item.question_detail_score)
|
||||||
}
|
}
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -193,11 +193,10 @@ export default class index extends Component {
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
let Qustion_detail_id = Util.getTextByJs(this.state.selectId);
|
let Qustion_detail_id = Util.getTextByJs(this.state.selectId);
|
||||||
let Question_detail_score = Util.getTextByJs(this.state.selectScore);
|
let Question_detail_score = Util.getTextByJs(this.state.selectScore);
|
||||||
console.log()
|
|
||||||
if (value == 1) {
|
if (value == 1) {
|
||||||
Marking.testPoint({
|
Marking.testPoint({
|
||||||
userId: this.userId,
|
userId: this.userId,
|
||||||
testId: this.state.papers[0].Test_id.toString(),
|
testId: this.state.currentPaper.testId,
|
||||||
scores: Question_detail_score,
|
scores: Question_detail_score,
|
||||||
testDetailId: Qustion_detail_id
|
testDetailId: Qustion_detail_id
|
||||||
})
|
})
|
||||||
|
@ -226,8 +225,8 @@ export default class index extends Component {
|
||||||
handleOk = () => {
|
handleOk = () => {
|
||||||
Marking.testProblem({
|
Marking.testProblem({
|
||||||
userId: this.userId,
|
userId: this.userId,
|
||||||
testId: this.state.papers[0].Test_id.toString(),
|
testId: this.state.currentPaper.testId,
|
||||||
problemType: this.state.problemValue.toString()
|
problemType: this.state.problemValue
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
@ -19,11 +19,11 @@ export default class index extends Component {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.status == "10000") {
|
if (res.data.status == "10000") {
|
||||||
let reviewList = []
|
let reviewList = []
|
||||||
for (let i = 0; i < res.data.data.records.length; i++) {
|
for (let i = 0; i < res.data.data.testId.length; i++) {
|
||||||
reviewList.push({
|
reviewList.push({
|
||||||
order: i+1,
|
order: i+1,
|
||||||
test_id: res.data.data.records[i].Test_id,
|
test_id: res.data.data.testId[i],
|
||||||
score: res.data.data.records[i].Score
|
score: res.data.data.score[i]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
@ -39,16 +39,16 @@ export default class index extends Component {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
getSampleList = () => {
|
getSampleList = () => {
|
||||||
Marking.testExampleList({ userId: this.userId, testId: "1" })
|
Marking.testExampleList({ userId: this.userId, testId: 1 })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.status == "10000") {
|
if (res.data.status == "10000") {
|
||||||
let sampleList = []
|
let sampleList = []
|
||||||
for (let i = 0; i< res.data.data.exampleTestId.length; i++) {
|
for (let i = 0; i< res.data.data.exampleTestPapers.length; i++) {
|
||||||
sampleList.push({
|
sampleList.push({
|
||||||
order: i,
|
order: i,
|
||||||
question_id: res.data.data.exampleTestId[i].Test_id,
|
question_id: res.data.data.exampleTestPapers[i].test_id,
|
||||||
question_name: res.data.data.exampleTestId[i].Candidate,
|
question_name: res.data.data.exampleTestPapers[i].candidate,
|
||||||
score: res.data.data.exampleTestId[i].Final_score,
|
score: res.data.data.exampleTestPapers[i].final_score,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -89,7 +89,7 @@ export default class index extends Component {
|
||||||
let testPaper = null;
|
let testPaper = null;
|
||||||
if (this.state.samplePaper != undefined || this.state.samplePaper != null) {
|
if (this.state.samplePaper != undefined || this.state.samplePaper != null) {
|
||||||
testPaper = this.state.samplePaper.map((item) => {
|
testPaper = this.state.samplePaper.map((item) => {
|
||||||
return <img src={item.Pic_src} alt="加载失败" className="test-question-img"/>
|
return <img src={item.pic_src} alt="加载失败" className="test-question-img"/>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ export default class index extends Component {
|
||||||
}
|
}
|
||||||
selectRow = (record) => {
|
selectRow = (record) => {
|
||||||
console.log(record.order)
|
console.log(record.order)
|
||||||
Marking.testDetail({ userId: this.userId, exampleTestId: record.question_id.toString() })
|
Marking.testDetail({ userId: this.userId, exampleTestId: record.question_id })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.status == "10000") {
|
if (res.data.status == "10000") {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
Loading…
Reference in New Issue