diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index 3264c52fa..144bac6eb 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -816,7 +816,9 @@ class Question extends Component { + program_questions_count + single_questions_count + subjective_questions_count; - + const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; + const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; + const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; return ( @@ -878,15 +880,33 @@ class Question extends Component { ` } - this.showDrawer()} - Headertop={Headertop} + { + isysladmins===true? + this.showDrawer()} + Headertop={Headertop} + + /> + : + is_teacher===true&&professional_certification===true? + this.showDrawer()} + Headertop={Headertop} + + /> + : + + "" + } - /> {/*顶部*/} diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index da85ce0f7..a41050486 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -82,6 +82,11 @@ class Contentpart extends Component { render() { let {page}=this.state; let {defaultActiveKey,item_type,booljupyterurls}=this.props; + const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; + const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; + const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; + + const content = (
this.props.callback(e)}> - - + { + isysladmins===true? + + + :is_teacher===true&&professional_certification===true? + + + :"" + } +
{ defaultActiveKey===0||defaultActiveKey==="0"? - this.xinzenw(e)}> -
-

新增

-
-
+ isysladmins===true? + this.xinzenw(e)}> +
+

新增

+
+
+ : + is_teacher===true&&professional_certification===true? + this.xinzenw(e)}> +
+

新增

+
+
+ :"" :"" } @@ -208,7 +230,7 @@ class Contentpart extends Component { { defaultActiveKey===0||defaultActiveKey==="0"?