issues25489
杨树林 5 years ago
parent 2356f28d21
commit fee5c58785

@ -8,43 +8,24 @@ class ModulationModal_exercise extends Component {
constructor(props) {
super(props);
this.state = {
group_ids: [],
fileList: [],
textareaval: undefined,
Inputsval: undefined
score: 0,
subjective_questions: 0,
objective_questions: 0,
}
//因为主观题加客观题的和是总分
}
componentDidMount = () => {
Saves = () => {
let {textareaval, Inputsval} = this.state;
// if(textareaval===""||textareaval===undefined){
// this.setState({
// textareavaltype:true
// })
// return
// }
this.setState({
textareavaltype: false
})
if (Inputsval === undefined || Inputsval === "") {
this.setState({
Inputsval: "",
Inputsvaltype: true,
Inputsvaltest: "请输入分数",
})
return
}
}
if (this.state.Inputsvaltype === true) {
return;
}
this.setState({
Inputsvaltype: false,
Inputsvaltest: "",
})
this.props.Saves(textareaval, Inputsval)
Saves = () => {
let {textareaval, subjective_questions, objective_questions, score} = this.state;
// this.props.Saves(textareaval, Inputsval)
}
@ -55,41 +36,18 @@ class ModulationModal_exercise extends Component {
}
setInputs = (e) => {
debugger
var value = parseInt(e.target.value)
if (isNaN(value)) {
value = 0;
this.setState({
Inputsval: value,
Inputsvaltype: true,
Inputsvaltest: "请输入分数",
})
} else {
if (value < 0 || value > 100) {
value = 0;
this.setState({
Inputsval: value,
Inputsvaltype: true,
Inputsvaltest: "请输入0-100的分数",
})
}
}
this.setState({
Inputsval: value,
Inputsvaltype: false,
})
}
render() {
let {textareaval, Inputsval, textareavaltype, Inputsvaltype, Inputsvaltest} = this.state;
let {Inputsvaltype, subjective_questions, objective_questions, score} = this.state;
return (
<div>
<Modal
keyboard={false}
className={"HomeworkModal"}
title={this.props.modalname || '调分'}
title={this.props.modalname || '评阅'}
visible={this.props.visible}
closable={false}
footer={null}
@ -101,13 +59,56 @@ class ModulationModal_exercise extends Component {
alignItems: "center",
}}>
<div className="mexertwo">
<p className="mexeheigth2">主观题成绩:</p>
<Input
className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"}
style={{
width: "120px",
height: "40px",
}}
placeholder="请填写主观题成绩"
onChange={(e) => this.setInputs(e)}
value={subjective_questions === undefined || subjective_questions === null ? "" : subjective_questions}/>
<p className="mexeheigth"> ,</p>
<p className="mexeheigth"><span>总分</span><span>45.0 </span><span></span></p>
</div>
<div className="mexertwo">
<p className="mexeheigth2">客观题成绩:</p>
<Input
className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"}
style={{
width: "120px",
height: "40px",
}}
placeholder="请填写客观题成绩"
onChange={(e) => this.setInputs(e)}
value={objective_questions === undefined || objective_questions === null ? "" : objective_questions}/>
<p className="mexeheigth"> ,</p>
<p className="mexeheigth"><span>总分</span><span>45.0 </span><span></span></p>
</div>
<div className="mexertwo">
<p className="mexeheigth2">最终成绩:</p>
<Input
className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"}
style={{
width: "120px",
height: "40px",
}}
placeholder="请填写最终成绩"
onChange={(e) => this.setInputs(e)}
value={score === undefined || score === null ? "" : score}/>
<p className="mexeheigth"> ,</p>
<p className="mexeheigth"><span>总分</span><span>45.0 </span><span></span></p>
</div>
<div style={{
marginTop: "27px",
width: " 336px",
marginLeft: "70px",
marginBottom: "29px",
}}>
<div className="minbuttionte">
<a className="task-btn color-white mr30" style={{width: "72px",}}
onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" style={{width: "72px",}}

@ -24,6 +24,7 @@ import {getImageUrl, toPath, sortDirections} from 'educoder';
import CheckBoxGroup from "../../page/component/CheckBoxGroup";
import NoneData from '../../../modules/courses/coursesPublic/NoneData'
import ModulationModal from "../coursesPublic/ModulationModal";
import ModulationModal_exercise from "../coursesPublic/ModulationModal_exercise";
const Search = Input.Search;
const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group;
@ -1030,9 +1031,9 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => (
<span>
{record.finalscore==="--"?
<span style={{color: "#9A9A9A"}}>
--
</span>
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
onClick={() => this.Adjustment(record.user_id)}>评阅</a>
:
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
@ -1227,9 +1228,9 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => (
<span>
{record.finalscore==="--"?
<span style={{color: "#9A9A9A"}}>
--
</span>
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
onClick={() => this.Adjustment(record.user_id)}>评阅</a>
:
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
@ -2613,9 +2614,9 @@ class Studentshavecompletedthelist extends Component {
var exercise_id = this.props.match.params.Id;
let url = `/exercises/${exercise_id}/adjust_score.json`;
axios.post(url, {
score: n,
user_id: this.state.exeuserid,
comment: v,
subjective_score: n,
objective_score: v,
})
.then((response) => {
if (response.data.status == '0') {
@ -2661,11 +2662,18 @@ class Studentshavecompletedthelist extends Component {
</div>
:
<div>
{testpapergradingboll === true ? <ModulationModal
visible={testpapergradingboll}
Cancel={() => this.Adjustments()}
Saves={(value, num) => this.Testpapergrading(value, num)}
/> : ""}
{/*{testpapergradingboll === true ? <ModulationModal*/}
{/* visible={testpapergradingboll}*/}
{/* Cancel={() => this.Adjustments()}*/}
{/* Saves={(value, num) => this.Testpapergrading(value, num)}*/}
{/*/> : ""}*/}
{
testpapergradingboll === true ? <ModulationModal_exercise
visible={testpapergradingboll}
Cancel={() => this.Adjustments()}
Saves={(value, num) => this.Testpapergrading(value, num)}
/> : ""
}
<div className="edu-back-white" >
<ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}>

Loading…
Cancel
Save