diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 6c9de071d..8770a6519 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -477,6 +477,8 @@ class StudentWorksController < ApplicationController @user_evaluate_count = 0 end + @view_tpi = ((@user_course_identity < Course::STUDENT && current_user.is_certification_teacher) || current_user.admin_or_business?) && @work.myshixun.present? + # 图形效率图的数据 @echart_data = student_efficiency(@homework, @work) if @work.myshixun end diff --git a/app/views/student_works/shixun_work_report.json.jbuilder b/app/views/student_works/shixun_work_report.json.jbuilder index bd618c2d4..adf0a2ea5 100644 --- a/app/views/student_works/shixun_work_report.json.jbuilder +++ b/app/views/student_works/shixun_work_report.json.jbuilder @@ -87,4 +87,6 @@ if @shixun end end +json.view_tpi @view_tpi + diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 959ba9244..8834df1af 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -315,7 +315,8 @@ class ShixunWorkReport extends Component { const antIcon = ; // let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment===null||work_comment===undefined?false:true:work_comment===null||work_comment===undefined?false:true; - let showAppraiseModals=work_comment===null||work_comment===undefined?false:true; + // let showAppraiseModals=work_comment===null||work_comment===undefined?false:true; + // console.log(this.props.isAdmin()) document.title=data&&data.course_name; return ( @@ -460,13 +461,13 @@ class ShixunWorkReport extends Component {
总体评价
{ - shixun_detail&&shixun_detail.map((item,key)=>{ + this.props&&this.props.isAdmin()===true?shixun_detail&&shixun_detail.map((item,key)=>{ if(key===0){ return( 查看学员实训 ) } - }) + }):"" }