Commit 4ed8fb07 by wangshuo

课后练习题

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