课堂设置页的调整

dev_hs
cxt 6 years ago
parent 8e4e7e4011
commit 2461351ce7

@ -117,6 +117,7 @@ class CoursesController < ApplicationController
# Get /courses/:id/settings # Get /courses/:id/settings
# Edit Page # Edit Page
def settings def settings
@course_modules = @course.course_modules.where.not(module_type: 'activity')
end end
# POST /courses # POST /courses

@ -185,7 +185,7 @@ class Course < ApplicationRecord
end end
def all_course_module_types def all_course_module_types
%w[activity announcement online_learning shixun_homework common_homework group_homework graduation exercise poll attachment board course_group] %w[activity announcement online_learning shixun_homework common_homework group_homework exercise attachment course_group graduation poll board]
end end
def get_course_module_by_type(type) def get_course_module_by_type(type)

@ -9,7 +9,11 @@ json.start_date @course.start_date
json.end_date @course.end_date json.end_date @course.end_date
json.is_public @course.is_public json.is_public @course.is_public
json.course_module_types @course.course_modules.where(hidden: 0).pluck(:module_type) json.course_module_types @course.course_modules.where(hidden: 0).pluck(:module_type)
json.course_module_names @course.course_modules.where(hidden: 0).pluck(:module_name) json.course_modules @course_modules do |module_type|
json.module_type module_type.module_type
json.hidden module_type.hidden
json.module_name module_type.module_name
end
json.authentication @course.authentication json.authentication @course.authentication
json.professional_certification @course.professional_certification json.professional_certification @course.professional_certification
json.subject_id @course.subject_id json.subject_id @course.subject_id

Loading…
Cancel
Save