|
|
@ -2,6 +2,7 @@
|
|
|
|
class EcCourseAchievementMethodsController < ApplicationController
|
|
|
|
class EcCourseAchievementMethodsController < ApplicationController
|
|
|
|
before_filter :find_target, :only => [:edit_course_target, :create_evaluation_methods]
|
|
|
|
before_filter :find_target, :only => [:edit_course_target, :create_evaluation_methods]
|
|
|
|
skip_before_filter :verify_authenticity_token, :only => [:create_evaluation_methods, :sync_course_data]
|
|
|
|
skip_before_filter :verify_authenticity_token, :only => [:create_evaluation_methods, :sync_course_data]
|
|
|
|
|
|
|
|
before_filter :find_ec_course, :only => [:index]
|
|
|
|
|
|
|
|
|
|
|
|
include ApplicationHelper
|
|
|
|
include ApplicationHelper
|
|
|
|
|
|
|
|
|
|
|
@ -59,11 +60,9 @@ class EcCourseAchievementMethodsController < ApplicationController
|
|
|
|
###############################################################
|
|
|
|
###############################################################
|
|
|
|
def index
|
|
|
|
def index
|
|
|
|
achievement_list = []
|
|
|
|
achievement_list = []
|
|
|
|
# 具体工程课程
|
|
|
|
|
|
|
|
ec_course = EcCourse.find params[:ec_course_id]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 课程的所有目标
|
|
|
|
# 课程的所有目标
|
|
|
|
targets = ec_course.ec_course_targets
|
|
|
|
targets = @ec_course.ec_course_targets
|
|
|
|
targets.each do |target|
|
|
|
|
targets.each do |target|
|
|
|
|
evaluate_data = []
|
|
|
|
evaluate_data = []
|
|
|
|
# 评价环节
|
|
|
|
# 评价环节
|
|
|
@ -95,7 +94,7 @@ class EcCourseAchievementMethodsController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
achievement_list << {target_id: target.id, target_evaluate_data: evaluate_data}
|
|
|
|
achievement_list << {target_id: target.id, target_evaluate_data: evaluate_data}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
render :json => {achievement_list: achievement_list}
|
|
|
|
render :json => {achievement_list: achievement_list, is_manager: @is_manager}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -306,4 +305,13 @@ class EcCourseAchievementMethodsController < ApplicationController
|
|
|
|
@target = EcCourseTarget.find params[:ec_course_target_id]
|
|
|
|
@target = EcCourseTarget.find params[:ec_course_target_id]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def find_ec_course
|
|
|
|
|
|
|
|
@ec_course = EcCourse.find(params[:ec_course_id])
|
|
|
|
|
|
|
|
@year = @ec_course.ec_year
|
|
|
|
|
|
|
|
@ec_major_school = @year.ec_major_school
|
|
|
|
|
|
|
|
@template_major = User.current.admin? || @ec_major_school.school.ec_school_users.pluck(:user_id).include?(User.current.id) ||
|
|
|
|
|
|
|
|
@ec_major_school.ec_major_school_users.pluck(:user_id).include?(User.current.id)
|
|
|
|
|
|
|
|
@is_manager = @template_major || @ec_course.ec_course_users.pluck(:user_id).include?(User.current.id)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|