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