dev_SaaS
cxt 6 years ago
parent 7970754e84
commit a3c7087a48

@ -101,6 +101,16 @@ class EcCoursesController < ApplicationController
end end
end end
def ec_course_support_setting_data
respond_to do |format|
format.json {
course_targets = @ec_course.ec_course_targets.includes(:ec_graduation_subitems)
json_data = target_list_data(course_targets)
render :json => json_data
}
end
end
# 课程目标配置的更新操作() # 课程目标配置的更新操作()
# /ec_courses/1/crud_targets # /ec_courses/1/crud_targets
def crud_targets def crud_targets
@ -432,8 +442,26 @@ class EcCoursesController < ApplicationController
{score: 70, level: ""}, {score: 70, level: ""},
{score: 60, level: ""}] {score: 60, level: ""}]
end end
Rails.logger.info("222222222222222222222template_major: #{@template_major}") render :json => {levels: ls, is_manager: @is_manager}
Rails.logger.info("2222222222222222222222222is_manager: #{@is_manager}") }
end
end
def score_level_data
respond_to do |format|
format.json{
levels = @ec_course.ec_score_levels
ls = []
if levels.present?
levels.each do |l|
ls << {score: l.score, level: l.level}
end
else
ls = [{score: 90, level: ""},
{score: 80, level: ""},
{score: 70, level: ""},
{score: 60, level: ""}]
end
render :json => {levels: ls, is_manager: @is_manager} render :json => {levels: ls, is_manager: @is_manager}
} }
end end
@ -600,6 +628,7 @@ class EcCoursesController < ApplicationController
end end
end end
Rails.logger.info("111111111111111user_id: #{User.current.try(:id)}")
Rails.logger.info("template_major: #{@template_major}") Rails.logger.info("template_major: #{@template_major}")
Rails.logger.info("is_manager: #{@is_manager}") Rails.logger.info("is_manager: #{@is_manager}")

@ -54,6 +54,11 @@ class EcYearsController < ApplicationController
format.html { format.html {
render "/common/index", :layout => false render "/common/index", :layout => false
} }
end
end
def student_lists_data
respond_to do |format|
format.json { format.json {
template_file = EcTemplate.find_by_name "学生列表导入模板" template_file = EcTemplate.find_by_name "学生列表导入模板"
if template_file.present? if template_file.present?

@ -68,6 +68,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
post 'add_manager' post 'add_manager'
delete 'delete_manager' delete 'delete_manager'
get "ec_course_support_setting" get "ec_course_support_setting"
get "ec_course_support_setting_data"
get "ec_course_reach_setting" get "ec_course_reach_setting"
get "evaluation_methods" get "evaluation_methods"
match "search_courses", :via => [:get, :post] match "search_courses", :via => [:get, :post]
@ -81,6 +82,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
post 'crud_targets' post 'crud_targets'
post 'crud_score_level' post 'crud_score_level'
get 'score_level' get 'score_level'
get 'score_level_data'
end end
collection do collection do
get 'get_calculation_data' get 'get_calculation_data'
@ -143,6 +145,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
resources :ec_years, :path => "academic_years" do resources :ec_years, :path => "academic_years" do
member do member do
get 'student_lists' get 'student_lists'
get 'student_lists_data'
match 'import_students', :via => [:post] match 'import_students', :via => [:post]
get 'training_objectives' get 'training_objectives'
get 'graduation_requirement' get 'graduation_requirement'

Loading…
Cancel
Save