Merge branches 'dev_Ysm' and 'dev_admin' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl

# Conflicts:
#	app/controllers/application_controller.rb
dev_oauth
杨树林 6 years ago
parent ab5032e4b7
commit 1889e8794f

@ -834,7 +834,7 @@ class CoursesIndex extends Component{
}
></Route>
{/*修改精品课堂*/}
<Route path="/courses/:coursesId/newgolds/settings/:id"
<Route path="/courses/:coursesId/newgolds/settings"
render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />)
}

@ -353,17 +353,17 @@ class CoursesBanner extends Component {
window.location.href = "/courses/" + this.props.match.params.coursesId + "/settings";
};
postsettingstwo=()=>{
var ids =1;
try {
if(this.state.coursedata.is_public){
ids=1;
}else {
ids=0;
}
}catch (e) {
}
window.location.href = `/courses/${this.props.match.params.coursesId}/newgolds/settings/${ids}`;
// var ids =1;
// try {
// if(this.state.coursedata.is_public){
// ids=1;
// }else {
// ids=0;
// }
// }catch (e) {
//
// }
window.location.href = `/courses/${this.props.match.params.coursesId}/newgolds/settings`;
};

@ -208,7 +208,7 @@ class Elearning extends Component{
})
}
render(){
let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun} =this.state;
let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages} =this.state;
const isNotMembers=this.props.isNotMember();//非课堂成员
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return(
@ -305,11 +305,22 @@ class Elearning extends Component{
<Spin size="large" spinning={isSpin} id={"cdiv"}>
<div className=" clearfix" style={{marginTop:"20px"}}>
{
stages===undefined||stages===JSON.stringify("[]")||stages.length===0?
<div>
<div className="alltask ">
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
</div>:
<div>
{/*开始学习*/}
<YslDetailCards {...this.state} {...this.props} Startlearningtwo={()=>this.Startlearningtwo()} Myreload={()=>this.Myreload()} ></YslDetailCards>
</div>
}
</div>
</Spin>

@ -34,6 +34,7 @@ class Testpapersettinghomepage extends Component{
DownloadType:false,
DownloadMessageval:undefined,
donwloading:false,
exercise_status:3,
}
}
//切换tab
@ -69,7 +70,8 @@ class Testpapersettinghomepage extends Component{
if(response.status === 200){
this.setState({
Commonheadofthetestpaper:response.data,
current_status:response.data.user_permission.current_status
current_status:response.data.user_permission.current_status,
exercise_status:response.data.exercise_status,
})
// console.log(JSON.stringify(response.data.show_statistic));
@ -262,11 +264,13 @@ class Testpapersettinghomepage extends Component{
this.props.history.goBack()
}
render(){
let {tab,visible,Commonheadofthetestpaper}=this.state;
let {tab,visible,Commonheadofthetestpaper,exercise_status}=this.state;
const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent();
// TODO
// console.log(Commonheadofthetestpaper.exercise_status);
return(
<div className="newMain clearfix ">
{/*<DownloadMessage*/}
@ -413,7 +417,7 @@ class Testpapersettinghomepage extends Component{
<a className="fr color-blue font-16 mt20" onClick={()=>this.setgameexercise(`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${this.props.current_user.login}`)}>开始答题</a>:
<Link className="fr color-blue font-16 mt20"
to={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${this.props.current_user.login}`}>
{Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status===3?"":Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status===4?"":start_Value[Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.current_status]}
{exercise_status===2?"":exercise_status===3?"":exercise_status===4?"":start_Value[exercise_status]}
</Link>
:""}

@ -130,7 +130,7 @@ class Goldsubject extends Component {
this.setState({
datatimetwo: data.start_date === undefined ? "" : moment(data.start_date, dateFormat),
datatime: data.end_date === undefined ? "" : moment(data.end_date, dateFormat),
is_public: this.props.match.params.id,
is_public: data.is_public,
Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification,
name: data.name,
@ -308,7 +308,7 @@ class Goldsubject extends Component {
credit: parseFloat(values.credit),
start_date:values.starttime,
end_date: values.endtime,
is_public: is_public, //这是也是带过来的值
is_public: this.state.is_public, //这是也是带过来的值
course_module_types: values.checkboxgroup,
school:values.school
}

@ -30,6 +30,7 @@ class PollDetailIndex extends Component{
user_permission:undefined,
DownloadType:false,
DownloadMessageval:undefined,
polls_status:3,
}
}
@ -41,7 +42,8 @@ class PollDetailIndex extends Component{
if(result.status==200){
this.setState({
pollDetail:result.data,
user_permission:result.data.user_permission
user_permission:result.data.user_permission,
polls_status:result.data.polls_status,
})
}
}).catch((error)=>{
@ -109,7 +111,7 @@ class PollDetailIndex extends Component{
})
}
render(){
let {tab,pollDetail,user_permission}=this.state;
let {tab,pollDetail,user_permission,polls_status}=this.state;
const { current_user } = this.props;
const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent();
@ -207,7 +209,7 @@ class PollDetailIndex extends Component{
user_permission && user_permission.current_status!=3 ?
<WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${this.props.current_user.login}`}>
{ user_permission && user_permission.current_status ==0 ? "继续答题" : user_permission.current_status == 1 ?
(pollDetail && pollDetail.polls_status===3?"":pollDetail && pollDetail.polls_status===4?"":"查看答题")
(polls_status===2?"":polls_status===3?"":polls_status===4?"":"查看答题")
: "开始答题" }
</WordsBtn>
:""

Loading…
Cancel
Save