diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 03cb07833..18255fb2b 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1503,11 +1503,10 @@ class CoursesController < ApplicationController @videos = CourseVideo.joins(" JOIN videos ON course_videos.course_id = #{@course.id} AND videos.id = course_videos.video_id LEFT JOIN ( - SELECT watch_course_videos.course_video_id, SUM(watch_course_videos.total_duration) AS time, COUNT(watch_video_histories.watch_course_video_id) AS num + SELECT watch_course_videos.course_video_id, SUM(watch_course_videos.total_duration) AS time, COUNT(watch_course_videos.course_video_id) AS num FROM watch_course_videos JOIN course_videos ON course_videos.id = watch_course_videos.course_video_id AND watch_course_videos.end_at IS NOT NULL JOIN course_members ON course_members.user_id = watch_course_videos.user_id AND course_members.course_id = #{@course.id} AND role = 4 - JOIN watch_video_histories ON watch_course_videos.id = watch_video_histories.watch_course_video_id AND watch_video_histories.end_at IS NOT NULL WHERE course_videos.course_id = #{@course.id} GROUP BY watch_course_videos.course_video_id ) AS hisotries ON hisotries.course_video_id = course_videos.id").select("course_videos.id") diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 8834df1af..454b11c6f 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -38,7 +38,8 @@ class ShixunWorkReport extends Component { work_comment_hidden:undefined, work_comment:undefined, has_commit: false, - shixun_detail:[] + shixun_detail:[], + view_tpi:false } } @@ -115,7 +116,8 @@ class ShixunWorkReport extends Component { work_comment:result.data.work_comment, spinning: false, has_commit: result.data.has_commit, - shixun_detail:result.data.shixun_detail + shixun_detail:result.data.shixun_detail, + view_tpi:result.data.view_tpi }) } @@ -307,7 +309,7 @@ class ShixunWorkReport extends Component { } render() { - let {data, showAppraiseModaltype, work_comment_hidden, work_comment, has_commit,shixun_detail} = this.state; + let {data, showAppraiseModaltype, work_comment_hidden, work_comment, has_commit,shixun_detail,view_tpi} = this.state; let category_id=data===undefined?"":data.category===null?"":data.category.category_id; let homework_common_id=data===undefined?"":data.homework_common_id; @@ -461,7 +463,7 @@ class ShixunWorkReport extends Component {
{ @@ -97,17 +132,21 @@ class Teacherentry extends Component {