@homework_commons=@course.homework_commons.where(:homework_type=>@homework_type).where("homework_commons.name like '%#{@search}%'").includes(:homework_detail_manual,:homework_group_settings,:student_works)
@homework_commons=@course.homework_commons.where(:homework_type=>@homework_type).where("homework_commons.name like '%#{@search}%'")
#count = StudentWorksScore.find_by_sql("SELECT count(distinct student_work_id) as count FROM student_works_scores sws, student_works sw, homework_commons hc where hc.id =#{homework_common.id} and sw.homework_common_id=hc.id and sw.is_delete = 0 and sws.student_work_id = sw.id and sws.user_id=#{User.current.id};").first.try(:count).to_i