From 81cb771bcd883d95243c0965a5622015d0234a07 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 11 Mar 2020 16:16:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=AE=E9=80=9A=E5=92=8C=E5=88=86=E7=BB=84?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=A2=9E=E5=8A=A0=E5=AD=90=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- app/helpers/courses_helper.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) 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