当删除所有题目后,总分还是显示,手动刷新后,才会消失

dev_unstable
hjm 6 years ago
parent 926a8748f2
commit f7b309562a

@ -322,14 +322,16 @@ class ExerciceNew extends Component{
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('删除成功')
const { exercise_questions } = this.state
const index = this.findIndexById(question_id)
this.fetchExercise()
// const { exercise_questions } = this.state
// const index = this.findIndexById(question_id)
this.setState(
(prevState) => ({
exercise_questions : update(prevState.exercise_questions, {$splice: [[index, 1]]})
})
)
// this.setState(
// (prevState) => ({
// exercise_questions : update(prevState.exercise_questions, {$splice: [[index, 1]]})
// })
// )
}
})
.catch(function (error) {

@ -60,13 +60,11 @@ class SingleEditor extends Component{
}
const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
} else if(!question_score || intScore == NaN) {
this.props.showNotification('分值:不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
}
}
}
if(!answerArray || answerArray.length == 0) {
this.props.showNotification('必须设置标准答案'); return;
}
@ -217,7 +215,7 @@ class SingleEditor extends Component{
<div>
分值
<InputNumber step={0.1} precision={1} min={0.1} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
<InputNumber step={0.1} precision={1} min={0} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
disabled={exerciseIsPublish}
></InputNumber>

@ -51,13 +51,11 @@ class MainEditor extends Component{
}
const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
} else if(!question_score || intScore == NaN) {
this.props.showNotification('分值:不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
}
}
}
// if(!answerArray || answerArray.length == 0 || !answerArray[0]) {
// this.props.showNotification('请输入参考答案'); return;
// }
@ -168,7 +166,7 @@ class MainEditor extends Component{
<div className="mt10">
分值
<InputNumber step={0.1} precision={1} min={0.1} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
<InputNumber step={0.1} precision={1} min={0} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
disabled={exerciseIsPublish}
></InputNumber>

@ -74,13 +74,13 @@ class NullEditor extends Component{
}
const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
} else if(!question_score || intScore == NaN) {
this.props.showNotification('分值:不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
}
}
}
let isEmpty = false;
standard_answers.forEach((answers, index) => {
answerArray.push({
@ -340,7 +340,7 @@ class NullEditor extends Component{
</div>
<div className="clearfix mt20">
分值
<InputNumber step={0.1} precision={1} min={0.1} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
<InputNumber step={0.1} precision={1} min={0} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
disabled={exerciseIsPublish} placeholder="请填写分数"
></InputNumber >

@ -268,7 +268,7 @@ class ShixunEditor extends Component{
</div>
<div>
<InputNumber step={0.1} precision={1} min={0.1} max={100}
<InputNumber step={0.1} precision={1} min={0} max={100}
style={{width: 100}} value={question_scores[index]}
placeholder="请填写分数" disabled={exerciseIsPublish}
onChange={(e) => this.on_question_score_change(e, index)}></InputNumber>

@ -92,14 +92,13 @@ class SingleEditor extends Component{
}
const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) {
this.props.showNotification('分值不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
}
}
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
} else if(!question_score || intScore == NaN) {
this.props.showNotification('分值:不能为空'); return;
}
if(!answerArray || answerArray.length == 0) {
this.props.showNotification('请先点击选择本选择题的正确选项'); return;
}
@ -301,7 +300,7 @@ class SingleEditor extends Component{
<div>
分值
<InputNumber step={0.1} precision={1} min={0.1} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
<InputNumber step={0.1} precision={1} min={0} max={100} style={{width: 100}} value={question_score} onChange={this.on_question_score_change}
disabled={exerciseIsPublish}
></InputNumber>&nbsp;

Loading…
Cancel
Save