diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 94e95adbe..a102f92de 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1297,7 +1297,7 @@ class CoursesController < ApplicationController @is_teacher = @user_course_identity < Course::ASSISTANT_PROFESSOR @course_modules = @course.course_modules.where(hidden: 0) @hidden_modules = @course.course_modules.where(hidden: 1) - @second_category_type = ["shixun_homework", "graduation", "attachment", "board", "course_group", "video"] + @second_category_type = ["shixun_homework", "graduation", "attachment", "board", "course_group", "video", "common_homework", "group_homework"] end def board_list diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 0ee83e839..27444b3c9 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -89,6 +89,10 @@ module CoursesHelper case category.category_type when "shixun_homework" "/classrooms/#{course.id}/shixun_homework/#{category.id}" + when "common_homework" + "/classrooms/#{course.id}/common_homework/#{category.id}" + when "group_homework" + "/classrooms/#{course.id}/group_homework/#{category.id}" when "graduation" if category.name == "毕设选题" "/classrooms/#{course.id}/graduation_topics/#{category.course_module_id}" @@ -107,6 +111,10 @@ module CoursesHelper case category.category_type when "shixun_homework" get_homework_commons_count(course, 4, category.id) + when "common_homework" + get_homework_commons_count(course, 1, category.id) + when "group_homework" + get_homework_commons_count(course, 3, category.id) when "graduation" if category.name == "毕设选题" course.graduation_topics_count