diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index 97b6a5174..780b87688 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -268,8 +268,8 @@ class ExerciseReviewAndAnswer extends Component{ exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}}) }),()=>{ if (position && type && (flag == undefined || flag==false)) { + $("#input_"+position+"_"+type).focus(); $("html").animate({ scrollTop: $("#Anchor_"+position+"_"+type).offset().top - 150 }); - if(id){ let { ajustSore } = this.state; let obj = ajustSore.filter(obj => obj.id === id).length > 0; @@ -382,26 +382,26 @@ class ExerciseReviewAndAnswer extends Component{ }).then((result)=>{ if(result.status==200){ this.props.showNotification('调分成功'); + this.getInfo(); + // let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1; - let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1; - - this.setState( - (prevState) => ({ - exercise_questions : update(prevState.exercise_questions, {[key]: { user_score: {$set: parseFloat(score).toFixed(1)},answer_status : {$set: statusScore},question_comments:{$set:result.data.question_comments} }}), - }) - ) + // this.setState( + // (prevState) => ({ + // exercise_questions : update(prevState.exercise_questions, {[key]: { user_score: {$set: parseFloat(score).toFixed(1)},answer_status : {$set: statusScore},question_comments:{$set:result.data.question_comments} }}), + // }) + // ) - this.setState( - (prevState) => ({ - ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: undefined},inputSore:{ $set:undefined }}}) - }) - ) - let {exerciseTotalScore} = this.state; - let newScore = parseFloat(parseFloat(exerciseTotalScore)+parseFloat(score)-parseFloat(oldScore)).toFixed(1); - this.setState({ - exerciseTotalScore:newScore - }) - this.showSetScore(key,true); + // this.setState( + // (prevState) => ({ + // ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: undefined},inputSore:{ $set:undefined }}}) + // }) + // ) + // let {exerciseTotalScore} = this.state; + // let newScore = parseFloat(parseFloat(exerciseTotalScore)+parseFloat(score)-parseFloat(oldScore)).toFixed(1); + // this.setState({ + // exerciseTotalScore:newScore + // }) + // this.showSetScore(key,true); } }).catch((error)=>{ console.log(error); @@ -932,6 +932,7 @@ class ExerciseReviewAndAnswer extends Component{ precision={1} className={ list && list.length>0 && list[0].setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"} onChange={(value)=>this.inputScore(value,item.question_id)} + id={`${"input_"+item.q_position+"_"+item.question_type}`} > {