Commit 4ed8fb07 by wangshuo

课后练习题

parent 9633c104
......@@ -376,6 +376,7 @@
flex-wrap: wrap;
justify-content: flex-start;
padding: 0 16px;
width: 100%;
li {
width: 40px;
height: 40px;
......
......@@ -25,8 +25,6 @@ class CampResolve extends Component {
});
this.body = document.getElementsByTagName('body')[0];
this.body.style.position = 'fixed';
};
close = () => {
let isShow = this.state.showCard;
......@@ -37,7 +35,7 @@ class CampResolve extends Component {
this.body = document.getElementsByTagName('body')[0];
this.body.style.position = 'static';
} else {
this.props.history.push(`/detail?id=${this.course_id}`)
}
};
componentDidMount() {
......@@ -59,6 +57,7 @@ class CampResolve extends Component {
return;
}
let data = res.data.data;
this.course_id = data.course_id;
_this.answerList = [];
this.rightNumber = 0;
data.list.map(item => {
......
......@@ -38,6 +38,7 @@ class CampTest extends Component {
}
let data = res.data.data;
this.qid = data.id;
this.course_id = data.course_id;
this.setState({
examList: data.list,
qtitle: data.qtitle,
......@@ -67,9 +68,10 @@ class CampTest extends Component {
this.setState({
showCard: false
});
this.body = document.getElementsByTagName('body')[0];
this.body.style.position = 'static';
} else {
this.props.history.push(`/detail?id=${this.course_id}`)
}
};
// 选择答案
......@@ -132,11 +134,11 @@ class CampTest extends Component {
data.uid = this.props.user.data.uid;
data.answer_record = this.answerList;
http.post(`${api.home}/m/aist/submit`, data).then((res) => {
console.log(res);
// if() {
//
// }
// http://m.julyedu.com/campResolve?video_id=2109&qid=21
if(res.data.code === 200) {
this.props.history.push(`/campResolve?keshi_id=${this.keshi_id}&qid=${this.qid}`)
}else{
Toast.info(res.data.msg, 2);
}
});
};
// 显示答题卡
......@@ -144,7 +146,6 @@ class CampTest extends Component {
this.setState({
showCard: true
});
this.body = document.getElementsByTagName('body')[0];
this.body.style.position = 'fixed';
};
......
......@@ -47,7 +47,7 @@ function TestItem(props) {
onClick={()=>props.checkOption(item)}
className={`
${currentQuestionOption === item.opt_id ? 'option_checked' : ''}
${((currentExam.user_answer===0 || currentExam.user_answer) && currentExam.answer_id === item.opt_id) ? 'user_check' : ''}
${((currentExam.user_answer===0 || currentExam.user_answer) && currentExam.user_answer === item.opt_id) ? 'user_check' : ''}
${((currentExam.user_answer===0 || currentExam.user_answer) && currentExam.answer_id === item.opt_id) ? 'right_check' : ''}
`}
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment