hjm 6 years ago
commit 3145fa9d7d

@ -73,8 +73,9 @@ class ExerciseReviewAndAnswer extends Component{
setScoreReason:undefined, setScoreReason:undefined,
setTip:"", setTip:"",
Id:undefined Id:undefined,
// 试卷总分
exerciseTotalScore:undefined
} }
} }
componentDidUpdate (prevProps) { componentDidUpdate (prevProps) {
@ -185,7 +186,8 @@ class ExerciseReviewAndAnswer extends Component{
exercise_answer_user:result.data.exercise_answer_user, exercise_answer_user:result.data.exercise_answer_user,
exercise_questions:result.data.exercise_questions, exercise_questions:result.data.exercise_questions,
user_exercise_status:1, user_exercise_status:1,
Id:result.data.exercise_answer_user.user_id Id:result.data.exercise_answer_user.user_id,
exerciseTotalScore:result.data.exercise_answer_user.score
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
@ -207,7 +209,8 @@ class ExerciseReviewAndAnswer extends Component{
exercise_scores:result.data.exercise_scores, exercise_scores:result.data.exercise_scores,
exercise_questions:result.data.exercise_questions, exercise_questions:result.data.exercise_questions,
user_exercise_status:result.data.exercise.user_exercise_status, user_exercise_status:result.data.exercise.user_exercise_status,
time:result.data.exercise.left_time time:result.data.exercise.left_time,
exerciseTotalScore:result.data.user_score
}) })
if(result.data.exercise.left_time != null){ if(result.data.exercise.left_time != null){
this.remainTime(); this.remainTime();
@ -490,7 +493,8 @@ class ExerciseReviewAndAnswer extends Component{
modalsBottomval, modalsBottomval,
ModalCancel, ModalCancel,
ModalSave, ModalSave,
Loadtype Loadtype,
exerciseTotalScore
}=this.state }=this.state
let isAdmin = this.props.isAdmin(); let isAdmin = this.props.isAdmin();
let isStudent =this.props.isStudent(); let isStudent =this.props.isStudent();
@ -579,8 +583,8 @@ class ExerciseReviewAndAnswer extends Component{
exercise_start_at && <span className="fl color-grey-9">开始答题时间{ exercise_start_at && moment(exercise_start_at).format(format) }</span> exercise_start_at && <span className="fl color-grey-9">开始答题时间{ exercise_start_at && moment(exercise_start_at).format(format) }</span>
} }
{ {
exercise_answer_user && !!exercise_answer_user.score && (isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore &&
<span className="color-grey-9 fr">总分<span className="color-orange-tip"> { exercise_answer_user.score }</span> </span> <span className="color-grey-9 fr">总分<span className="color-orange-tip"> { exerciseTotalScore }</span> </span>
} }
</span> </span>
{ {

@ -269,7 +269,7 @@ class shixunAnswer extends Component{
} }
{ {
item.operation ? item.operation ?
<a className={isAdmin ? "color-blue ml20":"color-blue"} target="_blank" href='javascript:void(0)' onClick={()=>this.scrollToAnchor(`${index+1}`)}>查看</a> <a className={isAdmin ? "color-blue ml20":"color-blue"} target="_blank" href='javascript:void(0)' onClick={()=>this.scrollToAnchor(`${questionType.question_id}${index+1}`)}>查看</a>
: :
<a className={isAdmin ? "color-grey-9 ml20":"color-grey-9"} target="_blank" href='javascript:void(0)'>--</a> <a className={isAdmin ? "color-grey-9 ml20":"color-grey-9"} target="_blank" href='javascript:void(0)'>--</a>
} }
@ -292,7 +292,7 @@ class shixunAnswer extends Component{
{ {
challenge.map((item,key)=>{ challenge.map((item,key)=>{
return( return(
<div className="pl30 pr30" id={`challenge_${key+1}`}> <div className="pl30 pr30" id={`challenge_${questionType.question_id}${key+1}`}>
<p className="clearfix mb20"> <p className="clearfix mb20">
<span className="panel-inner-icon mr15 fl mt3 backgroud4CACFF"> <span className="panel-inner-icon mr15 fl mt3 backgroud4CACFF">
<i className="fa fa-code font-16 color_white"></i> <i className="fa fa-code font-16 color_white"></i>

@ -46,7 +46,8 @@ class Infos extends Component{
type:0, type:0,
login:undefined, login:undefined,
isRenders:false, isRenders:false,
moduleName:"courses" moduleName:"courses",
next_gold:undefined
} }
} }
componentDidMount =()=>{ componentDidMount =()=>{
@ -75,7 +76,8 @@ class Infos extends Component{
data:result.data, data:result.data,
followed:result.data.followed, followed:result.data.followed,
sign:result.data.brief_introduction, sign:result.data.brief_introduction,
id:result.data.id id:result.data.id,
next_gold:result.data.tomorrow_attendance_gold
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
@ -133,6 +135,9 @@ class Infos extends Component{
data : update(prevState.data, {attendance_signed: {$set: true} }) data : update(prevState.data, {attendance_signed: {$set: true} })
}) })
) )
this.setState({
next_gold:result.data.next_gold
})
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -195,7 +200,8 @@ class Infos extends Component{
id, id,
login, login,
isRenders, isRenders,
moduleName moduleName,
next_gold
}=this.state; }=this.state;
let {username}= this.props.match.params; let {username}= this.props.match.params;
@ -291,7 +297,7 @@ class Infos extends Component{
data.attendance_signed ? data.attendance_signed ?
<React.Fragment> <React.Fragment>
<span className="user_default_btn user_grey_btn mb5 fl">已签到</span> <span className="user_default_btn user_grey_btn mb5 fl">已签到</span>
<span id="attendance_notice" className="none font-12 color-grey-6" style={{"display":"block"}}>明日签到&nbsp;<font className="color-orange">+{data && data.tomorrow_attendance_gold}</font>&nbsp;</span> <span id="attendance_notice" className="none font-12 color-grey-6" style={{"display":"block"}}>明日签到&nbsp;<font className="color-orange">+{next_gold}</font>&nbsp;</span>
</React.Fragment> </React.Fragment>
: :
<a herf="javascript:void(0);" onClick={this.signFor} id="attendance" className="user_default_btn user_orange_btn fl mb15">签到</a> <a herf="javascript:void(0);" onClick={this.signFor} id="attendance" className="user_default_btn user_orange_btn fl mb15">签到</a>

Loading…
Cancel
Save