dev_ec
hjm 6 years ago
commit 8df8dc95d5

@ -63,8 +63,8 @@ gem 'elasticsearch-rails'
gem 'oauth2' gem 'oauth2'
# xlsx # xlsx
# gem 'axlsx', '3.0.0.pre' gem 'axlsx', '3.0.0.pre'
# gem 'axlsx_rails', '0.3.0' gem 'axlsx_rails', '0.3.0'
#Ruby 2.2+ has removed test/unit from the core library. #Ruby 2.2+ has removed test/unit from the core library.
if RUBY_VERSION>='2.2' if RUBY_VERSION>='2.2'

@ -17,18 +17,11 @@ class EcYearsController < ApplicationController
# 添加年份 # 添加年份
def create def create
@major_school = EcMajorSchool.find(params[:ec_major_school_id]) @major_school = EcMajorSchool.find(params[:ec_major_school_id])
ec_years = @major_school.ec_years.pluck(:year) if @major_school.ec_years.exists?(year: params[:year].to_i)
exist_year = ec_years.include?(params[:year].to_i)
if exist_year
@status = -1 @status = -1
else else
prev_year = "#{params[:year].to_i - 1}" service = CopyEcYearService.new(@major_school, params[:year].to_i)
prev_ec_year = @major_school.ec_years.where(:year => prev_year).first service.call
if prev_ec_year.blank?
EcYear.create!(:year => params[:year], :ec_major_school_id => @major_school.id)
else
copy_year(prev_ec_year, params[:year])
end
@status = 1 @status = 1
end end
@major_manager = true @major_manager = true
@ -246,7 +239,7 @@ class EcYearsController < ApplicationController
template_file = EcTemplate.find_by_name "课程列表导入模板" template_file = EcTemplate.find_by_name "课程列表导入模板"
if template_file.present? if template_file.present?
file = template_file.attachments.first file = template_file.attachments.first
@file_url = "/attachments/download/#{file.id}/#{file.filename}" @file_url = '' #"/attachments/download/#{file.id}/#{file.filename}"
else else
@file_url = "javascript:void(0);" @file_url = "javascript:void(0);"
end end
@ -357,236 +350,6 @@ class EcYearsController < ApplicationController
@year = EcYear.find(params[:id]) @year = EcYear.find(params[:id])
end end
# 复制最新一届下的所有数据. previous_ec_year: 本专业最新一届, new_year: 新建的届别
def copy_year previous_ec_year, new_year
ActiveRecord::Base.transaction do
begin
# 如果是第一次创建届别,则直接创建
if previous_ec_year.blank?
raise("没有界别可以复制")
else
logger.info("############previous_ec_year: #{previous_ec_year.id}")
# 多个中间表需要替换的id
egs_record = [] # 记录ec_graduation_subitems的新旧值 例如: [[prev_egs, new_egs], [...]]
egr_record = [] # 记录ec_graduation_requirements的新旧值, 例如: [[prev_egr, new_egr], [...]]
ec_record = [] # 记录ec_courses
ece_record = [] # 记录ec_course_evaluations
eces_record= [] # 记录ec_course_evaluation_subitems
ect_record = [] # 记录ec_course_targets
# 复制 "届别"
ec_year = EcYear.create!(:year => new_year,
:ec_major_school_id => previous_ec_year.ec_major_school_id,
:calculation_value => previous_ec_year.calculation_value)
# 复制 "毕业要求"
previous_ec_year.ec_graduation_requirements.try(:each) do |pre_egr|
new_egr = EcGraduationRequirement.new
new_egr.attributes = pre_egr.attributes.dup.except("id", "ec_year_id")
new_egr.ec_year_id = ec_year.id
new_egr.save!
egr_record << [pre_egr.id, new_egr.id]
# 复制 "毕业要求子标点"
pre_egr.ec_graduation_subitems.try(:each) do |pre_egs|
new_egs = EcGraduationSubitem.new
new_egs.attributes = pre_egs.attributes.dup.except("id", "ec_graduation_requirement_id")
new_egs.ec_graduation_requirement_id = new_egr.id
new_egs.save!
# 记录新旧对应关系,为之后的中间表做记录
egs_record << [pre_egs.id, new_egs.id]
prev_ersvss = EcRequireSubVsStandard.where(:ec_graduation_subitem_id => pre_egs.id)
prev_ersvss.each do |prev_ersvs|
new_ersvss = EcRequireSubVsStandard.new
new_ersvss.attributes = prev_ersvs.attributes.dup.except("id", "ec_graduation_subitem_id")
new_ersvss.ec_graduation_subitem_id = new_egs.id
new_ersvss.save!
end
end
end
# 复制 "培养目标"
pre_eto = previous_ec_year.ec_training_objective
if pre_eto.present?
new_eto = EcTrainingObjective.new
new_eto.attributes = pre_eto.attributes.dup.except("id", "ec_year_id")
new_eto.ec_year_id = ec_year.id
new_eto.save!
# 复制 "培养目标分项"
pre_eto.ec_training_subitems.try(:each) do |pre_ets|
new_ets = EcTrainingSubitem.new
new_ets.attributes = pre_ets.attributes.dup.except("id", "ec_training_objective_id")
new_ets.ec_training_objective_id = new_eto.id
new_ets.save!
# 复制 "毕业要去 vs 培养目标"
pre_ervsos = EcRequirementVsObjective.where(:ec_training_objective_id => pre_ets.id)
pre_ervsos.each do |ervso|
new_ervso = EcRequirementVsObjective.new
new_ervso.attributes = ervso.attributes.dup.except("id", "ec_training_objective_id", "ec_graduation_requirement_id")
new_ervso.ec_training_objective_id = new_ets.id
new_egr_id = -1
egr_record.each do |egr_id|
if egr_id[0] == ervso.ec_graduation_requirement_id
new_egr_id = egr_id[1]
end
end
raise("找不对应的毕业要求") if new_egr_id == -1
new_ervso.ec_graduation_requirement_id = new_egr_id
new_ervso.save!
end
end
end
# 复制 "课程体系"
previous_ec_year.ec_courses.try(:each) do |pre_ec|
new_ec = EcCourse.create!(name: pre_ec.name, ec_year_id: ec_year.id)
ec_record << [pre_ec.id, new_ec.id]
# 复制 "课程考核标准"
pre_ec.ec_course_evaluations.try(:each) do |pre_ece|
new_ece = EcCourseEvaluation.create!(name: pre_ece.name,
evluation_count: pre_ece.evluation_count,
ec_course_id: new_ec.id,
is_course_type: pre_ece.is_course_type)
ece_record << [pre_ece.id, new_ece.id]
# 复制 "考核分项"
pre_ece.ec_course_evaluation_subitems.try(:each) do |pre_eces|
new_eces = EcCourseEvaluationSubitem.create!(name: pre_eces.name, ec_course_evaluation_id: new_ece.id)
# 记录新旧对应关系,为之后的中间表做记录
eces_record << [pre_eces.id, new_eces.id]
end
end
# 复制 "课程目标"
pre_ec.ec_course_targets.try(:each) do |pre_ect|
new_ect = EcCourseTarget.new
new_ect.attributes = pre_ect.attributes.dup.except("id", "ec_course_id")
new_ect.ec_course_id = new_ec.id
new_ect.save!
# 记录新旧对应关系,为之后的中间表做记录
ect_record << [pre_ect.id, new_ect.id]
# 复制 "课程目标和毕业要求指标点"
pre_ect.ec_graduation_subitem_course_targets.try(:each) do |pre_egsct|
new_egsct = EcGraduationSubitemCourseTarget.new
new_egsct.attributes = pre_egsct.attributes.dup.except("id", "ec_graduation_subitem_id", "ec_course_target_id")
# 寻找对应的new_egs_id
logger.info("############egs_record:#{egs_record}")
logger.info("############ec_graduation_subitem_id: #{pre_egsct.ec_graduation_subitem_id}")
new_egs_id = -1
egs_record.each do |id|
if id[0] == pre_egsct.ec_graduation_subitem_id
new_egs_id = id[1]
end
end
raise("课程目标和毕业要求指标点找不到对应关系.") if new_egs_id == -1
new_egsct.ec_graduation_subitem_id = new_egs_id
new_egsct.ec_course_target_id = new_ect.id
new_egsct.save!
end
# 复制 "课程达成方法"
pre_ect.ec_course_achievement_methods.each do |pre_ecam|
# 寻找对应的 ec_course_id
new_ec_id = -1
new_ece_id = -1
new_eces_id = -1
ec_record.each do |ec_id|
if ec_id[0] == pre_ecam.ec_course_id
new_ec_id = ec_id[1]
end
end
# 寻找对应的ec_course_evaluation_id
ece_record.each do |ece_id|
if ece_id[0] == pre_ecam.ec_course_evaluation_id
new_ece_id = ece_id[1]
end
end
# 寻找对应的ec_course_evaluation_subitem_id
eces_record.each do |eces_id|
if eces_id[0] == pre_ecam.ec_course_evaluation_subitem_id
new_eces_id = eces_id[1]
end
end
new_ecam = EcCourseAchievementMethod.new
new_ecam.attributes = pre_ecam.attributes.dup.except("id", "ec_course_id", "ec_course_evaluation_id",
"ec_course_evaluation_subitem_id", "ec_course_target_id")
new_ecam.ec_course_id = new_ec_id if new_ec_id != -1
new_ecam.ec_course_evaluation_id = new_ece_id if new_ece_id != -1
new_ecam.ec_course_evaluation_subitem_id = new_eces_id if new_eces_id != -1
new_ecam.ec_course_target_id = new_ect.id
new_ecam.save!
# 复制 "课程评价达成关系"
pre_ecam.ec_achievement_evaluation_relates.each do |pre_eaer|
new_eaer = EcAchievementEvaluationRelate.new
new_eaer.attributes = pre_eaer.attributes.dup.except("id", "ec_course_achievement_method_id",
"ec_course_evaluation_subitem_id", "ec_course_target_id")
new_eaer.ec_course_achievement_method_id = new_ecam.id
# 寻找对应的 ec_course_evaluation_subitem_id
new_eces_id = -1
eces_record.each do |eces_id|
if eces_id[0] == pre_eaer.ec_course_evaluation_subitem_id
new_eces_id = eces_id[1]
end
end
new_eaer.ec_course_evaluation_subitem_id = new_eces_id if new_eces_id != -1
# 寻找对应的 ec_course_target_id
new_ect_id = -1
ect_record.each do |ect_id|
if ect_id[0] == pre_eaer.ec_course_target_id
new_ect_id = ect_id[1]
end
end
new_eaer.ec_course_target_id = new_ect_id if new_ect_id != -1
new_eaer.save!
end
end
end
# 复制 "课程支撑"
pre_ec.ec_course_supports.try(:each) do |pre_ecs|
new_ecs = EcCourseSupport.new
new_ecs.attributes = pre_ecs.attributes.dup.except("id", "ec_course_id")
new_ecs.ec_course_id = new_ec.id
new_ecs.save!
# 复制 "课程vs毕业要求"
pre_ecs.ec_graduation_subitem_courses.try(:each) do |pre_egsc|
new_egs_id = -1
egs_record.each do |egs_id|
if egs_id[0] == pre_egsc.ec_graduation_subitem_id
new_egs_id = egs_id[1]
end
end
new_egsc = EcGraduationSubitemCourse.new
new_egsc.attributes = pre_egsc.attributes.dup.except("id", "ec_graduation_subitem_id", "ec_course_support_id")
raise("找不到课程vs毕业要求的关联关系!") if new_egs_id == -1
new_egsc.ec_graduation_subitem_id = new_egs_id
new_egsc.ec_course_support_id = new_ecs.id
new_egsc.save!
end
end
# 复制 "成绩等级设置"
pre_ec.ec_score_levels.try(:each) do |pre_esl|
new_esl = EcScoreLevel.new
new_esl.attributes = pre_esl.attributes.dup.except("id", "ec_course_id")
new_esl.ec_course_id = new_ec.id
new_esl.save!
end
end
end
rescue Exception => e
logger.error("###########error_message: #{e.message}")
raise ActiveRecord::Rollback
end
end
end
# 导出培养目标excel # 导出培养目标excel
def export_training_objectives objects def export_training_objectives objects
xls_report = StringIO.new xls_report = StringIO.new

@ -9,4 +9,7 @@ class EcGraduationSubitem < ActiveRecord::Base
# 课程目标配置 # 课程目标配置
has_many :ec_course_targets, :through => :ec_graduation_subitem_course_targets has_many :ec_course_targets, :through => :ec_graduation_subitem_course_targets
has_many :ec_graduation_subitem_course_targets, :dependent => :destroy has_many :ec_graduation_subitem_course_targets, :dependent => :destroy
has_many :ec_require_sub_vs_standards
has_many :ec_graduation_standards, through: :ec_require_sub_vs_standards
end end

@ -1,3 +1,6 @@
class EcRequireSubVsStandard < ActiveRecord::Base class EcRequireSubVsStandard < ActiveRecord::Base
attr_accessible :ec_graduation_standard_id, :ec_graduation_subitem_id, :status attr_accessible :ec_graduation_standard_id, :ec_graduation_subitem_id, :status
belongs_to :ec_graduation_standard
belongs_to :ec_graduation_subitem
end end

@ -1,3 +1,5 @@
class EcRequirementVsObjective < ActiveRecord::Base class EcRequirementVsObjective < ActiveRecord::Base
attr_accessible :ec_graduation_requirement_id, :ec_training_objective_id, :status attr_accessible :ec_graduation_requirement_id, :ec_training_objective_id, :status
belongs_to :ec_graduation_requirement
belongs_to :ec_training_subitem
end end

@ -1,4 +1,5 @@
class EcTrainingSubitem < ActiveRecord::Base class EcTrainingSubitem < ActiveRecord::Base
belongs_to :ec_training_objective belongs_to :ec_training_objective
has_many :ec_requirement_vs_objectives, foreign_key: :ec_training_objective_id
end end

@ -16,4 +16,8 @@ class EcYear < ActiveRecord::Base
# 课堂配置 # 课堂配置
has_many :ec_courses, :dependent => :destroy has_many :ec_courses, :dependent => :destroy
acts_as_attachable acts_as_attachable
def prev_year
ec_major_school.ec_years.find_by_year(year - 1)
end
end end

@ -16,6 +16,7 @@ class School < ActiveRecord::Base
has_many :ec_majors, :through => :ec_major_schools has_many :ec_majors, :through => :ec_major_schools
has_many :ec_major_schools, :dependent => :destroy has_many :ec_major_schools, :dependent => :destroy
has_one :ec_template_major, conditions: 'template_major = 1', class_name: 'EcMajorSchool'
has_many :partners, :dependent => :destroy has_many :partners, :dependent => :destroy
has_many :customers, :dependent => :destroy has_many :customers, :dependent => :destroy

@ -0,0 +1,306 @@
class CopyEcYearService
attr_reader :major_school, :to_year
def initialize(major_school, year)
@major_school = major_school
@to_year = major_school.ec_years.new(year: year)
end
def call
if from_year.blank?
to_year.save!
return to_year
end
# 专业第一次创建届别时复制示例专业2017届
ActiveRecord::Base.transaction do
copy_ec_year!
copy_graduation_requirement!
copy_training_objective!
new_major_school? ? copy_template_ec_course! : copy_ec_courses!
end
to_year
end
private
def new_major_school?
@_new_major ||= major_school.ec_years.count.zero?
end
def from_year
@_from_year ||= new_major_school? ? template_major_year : to_year.prev_year
end
def template_major_year
EcYear.joins(:ec_major_school).where(ec_major_schools: { template_major: true }).find_by_year('2017')
end
def copy_ec_year!
to_year.calculation_value = from_year.calculation_value
to_year.save!
end
def copy_graduation_requirement!
requirements = from_year.ec_graduation_requirements.includes(ec_graduation_subitems: :ec_require_sub_vs_standards)
requirements.each do |requirement|
to_requirement = to_year.ec_graduation_requirements.new
to_requirement.attributes = requirement.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at')
to_requirement.save!
# 记录对应关系,创建支撑时使用
graduation_requirement_map[requirement.id] = to_requirement.id
copy_graduation_subitems(requirement, to_requirement)
end
end
def copy_graduation_subitems(requirement, to_requirement)
requirement.ec_graduation_subitems.each do |item|
to_item = to_requirement.ec_graduation_subitems.new
to_item.attributes = item.attributes.except('id', 'ec_graduation_requirement_id', 'created_at', 'updated_at')
to_item.save!
# 记录对应关系,创建支撑时使用
graduation_subitem_map[item.id] = to_item.id
copy_requirement_standard_supports!(item, to_item)
end
end
def copy_requirement_standard_supports!(graduation_subitem, to_graduation_subitem)
graduation_subitem.ec_require_sub_vs_standards.each do |support|
to_support = to_graduation_subitem.ec_require_sub_vs_standards.new
to_support.attributes = support.attributes.except('id', 'ec_graduation_subitem_id', 'created_at', 'updated_at')
to_support.save!
end
end
def copy_training_objective!
training_objective = from_year.ec_training_objective
return if training_objective.blank?
attributes = training_objective.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at')
to_training_objective = to_year.create_ec_training_objective!(attributes)
copy_training_subitems!(training_objective, to_training_objective)
end
def copy_training_subitems!(training_objective, to_training_objective)
training_subitems = training_objective.ec_training_subitems.includes(:ec_requirement_vs_objectives)
training_subitems.each do |item|
to_item = to_training_objective.ec_training_subitems.new
to_item.attributes = item.attributes.except('id', 'ec_training_objective_id', 'created_at', 'updated_at')
to_item.save!
copy_requirement_vs_objectives!(item, to_item)
end
end
def copy_requirement_vs_objectives!(training_item, to_training_item)
training_item.ec_requirement_vs_objectives.each do |support|
to_support = to_training_item.ec_requirement_vs_objectives.new(status: support.status)
to_support.ec_graduation_requirement_id = graduation_requirement_map[support.ec_graduation_requirement_id]
to_support.save!
end
end
def copy_template_ec_course!
course = from_year.ec_courses.includes(
:ec_score_levels,
ec_course_evaluations: :ec_course_evaluation_subitems,
ec_course_targets: :ec_graduation_subitem_course_targets,
ec_course_achievement_methods: :ec_achievement_evaluation_relates,
ec_course_supports: :ec_graduation_subitem_courses
).find_by_name('数据库原理')
to_course = to_year.ec_courses.new
to_course.attributes = course.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at')
to_course.save!
course_map[course.id] = to_course.id
copy_course_evaluations!(course, to_course)
copy_course_targets!(course, to_course)
copy_course_achievement_methods!(course, to_course)
copy_ec_course_supports!(course, to_course)
copy_score_levels!(course, to_course)
# 复制示例时需要复制学生和成绩数据
copy_year_students!
end
def copy_ec_courses!
courses = from_year.ec_courses.includes(
:ec_score_levels,
ec_course_evaluations: :ec_course_evaluation_subitems,
ec_course_targets: :ec_graduation_subitem_course_targets,
ec_course_achievement_methods: :ec_achievement_evaluation_relates,
ec_course_supports: :ec_graduation_subitem_courses
)
courses.each do |course|
to_course = to_year.ec_courses.new
to_course.attributes = course.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at')
to_course.save!
course_map[course.id] = to_course.id
copy_course_evaluations!(course, to_course)
copy_course_targets!(course, to_course)
copy_course_achievement_methods!(course, to_course)
copy_ec_course_supports!(course, to_course)
copy_score_levels!(course, to_course)
end
end
def copy_course_evaluations!(course, to_course)
course.ec_course_evaluations.each do |evaluation|
to_evaluation = to_course.ec_course_evaluations.new
to_evaluation.attributes = evaluation.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at')
to_evaluation.save!
course_evaluation_map[evaluation.id] = to_evaluation.id
copy_course_evaluation_subitems!(evaluation, to_evaluation)
end
end
def copy_course_evaluation_subitems!(evaluation, to_evaluation)
evaluation.ec_course_evaluation_subitems.each do |item|
to_item = to_evaluation.ec_course_evaluation_subitems.new
to_item.attributes = item.attributes.except('id', 'ec_course_evaluation_id', 'created_at', 'updated_at')
to_item.save!
course_evaluation_subitem_map[item.id] = to_item.id
end
end
def copy_course_targets!(course, to_course)
course.ec_course_targets.each do |target|
to_target = to_course.ec_course_targets.new
to_target.attributes = target.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at')
to_target.save!
course_target_map[target.id] = to_target.id
copy_graduation_subitem_course_targets!(target, to_target)
end
end
def copy_graduation_subitem_course_targets!(target, to_target)
target.ec_graduation_subitem_course_targets.each do |support|
to_support = to_target.ec_graduation_subitem_course_targets.new
to_support.attributes = support.attributes.except('id', 'ec_graduation_subitem_id', 'created_at', 'updated_at')
to_support.ec_graduation_subitem_id = graduation_subitem_map[support.ec_graduation_subitem_id]
to_support.save!
end
end
def copy_course_achievement_methods!(course, to_course)
course.ec_course_achievement_methods.each do |from|
to = to_course.ec_course_achievement_methods.new
to.attributes = from.attributes.except('id', 'ec_course_id', 'ec_course_target_id', 'ec_course_evaluation_id',
'ec_course_evaluation_subitem_id', 'created_at', 'updated_at')
to.ec_course_target_id = course_target_map[from.ec_course_target_id]
to.ec_course_evaluation_id = course_evaluation_map[from.ec_course_evaluation_id]
to.ec_course_evaluation_subitem_id = course_evaluation_subitem_map[from.ec_course_evaluation_subitem_id]
to.save!
copy_achievement_evaluation_relates!(from, to)
end
end
def copy_achievement_evaluation_relates!(method, to_method)
method.ec_achievement_evaluation_relates.each do |relate|
to_relate = to_method.ec_achievement_evaluation_relates.new
to_relate.attributes = relate.attributes.except('id', 'ec_course_achievement_method_id', 'ec_course_target_id',
'ec_course_evaluation_subitem_id', 'created_at', 'updated_at')
to_relate.ec_course_target_id = course_target_map[relate.ec_course_target_id]
to_relate.ec_course_evaluation_subitem_id = course_target_map[relate.ec_course_evaluation_subitem_id]
to_relate.save!
end
end
def copy_ec_course_supports!(course, to_course)
course.ec_course_supports.each do |support|
to_support = to_course.ec_course_supports.new
to_support.attributes = support.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at')
to_support.save!
copy_graduation_subitem_courses!(support, to_support)
end
end
def copy_graduation_subitem_courses!(course_support, to_course_support)
course_support.ec_graduation_subitem_courses.each do |item|
to_item = to_course_support.ec_graduation_subitem_courses.new
to_item.attributes = item.attributes.except('id', 'ec_course_support_id', 'ec_graduation_subitem_id',
'created_at', 'updated_at')
to_item.ec_graduation_subitem_id = graduation_subitem_map[item.ec_graduation_subitem_id]
to_item.save!
end
end
def copy_score_levels!(course, to_course)
course.ec_score_levels.each do |level|
to_level = to_course.ec_score_levels.new
to_level.attributes = level.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at')
to_level.save!
end
end
def copy_year_students!
students = from_year.ec_year_students.includes(:ec_student_achievements)
students.each do |student|
to_student = to_year.ec_year_students.new
to_student.attributes = student.attributes.except('id', 'ec_year_id', 'created_at', 'updated')
to_student.save!
copy_student_achievements!(student, to_student)
end
end
def copy_student_achievements!(student, to_student)
student.ec_student_achievements.each do |achievement|
to_achievement = to_student.ec_student_achievements.new
to_achievement.attributes = achievement.attributes.except('id', 'ec_year_student_id', 'ec_course_evaluation_id',
'ec_course_evaluation_subitem_id', 'created_at', 'updated_at')
to_achievement.ec_course_evaluation_id = course_evaluation_map[achievement.ec_course_evaluation_id]
to_achievement.ec_course_evaluation_subitem_id = course_evaluation_subitem_map[achievement.ec_course_evaluation_subitem_id]
to_achievement.save!
end
end
def graduation_requirement_map
@_graduation_requirement_map ||= {}
end
def graduation_subitem_map
@_graduation_subitem_map ||= {}
end
def course_map
@_course_map ||= {}
end
def course_evaluation_map
@_course_evaluation_map ||= {}
end
def course_evaluation_subitem_map
@_course_evaluation_subitem_map ||= {}
end
def course_target_map
@_course_target_map ||= {}
end
end

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.80b6ec5e.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.3fefc877.js"></script></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.c233538b.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.3a7bf64a.js"></script></body></html>

@ -125,12 +125,13 @@ const NewContentCareerPathIndex =Loadable({
loader: () => import('./modules/careerPath/managementsCareerPath/New_Content_Career_Path_Index'), loader: () => import('./modules/careerPath/managementsCareerPath/New_Content_Career_Path_Index'),
loading: Loading, loading: Loading,
}) })
{/*课程体系对毕业要求的支撑*/}
const ecCourseSupports=Loadable({ const ecCourseSupports=Loadable({
loader: () => import('./modules/ec/ecCourseSupports/ecCourseSupports'), loader: () => import('./modules/ec/ecCourseSupports/ecCourseSupports'),
loading: Loading, loading: Loading,
}) })
//课程体系
const ecCourseEvaluations=Loadable({ const ecCourseEvaluations=Loadable({
loader: () => import('./modules/ec/ecCourseEvaluations/ecCourseEvaluations'), loader: () => import('./modules/ec/ecCourseEvaluations/ecCourseEvaluations'),
loading: Loading, loading: Loading,
@ -141,11 +142,12 @@ const ecGradeEvaluations=Loadable({
loading: Loading, loading: Loading,
}) })
{/*课程目标评价方法*/}
const EvaluationMethods=Loadable({ const EvaluationMethods=Loadable({
loader: () => import('./modules/ec/ecCourseEvaluations/ecCourseEvaluationsbottom'), loader: () => import('./modules/ec/ecCourseEvaluations/ecCourseEvaluationsbottom'),
loading: Loading, loading: Loading,
}) })
{/*达成评价详情*/}
const EcCompletionCalculation=Loadable({ const EcCompletionCalculation=Loadable({
loader: () => import('./modules/ec/ecCompletion_calculation/ecCompletion_calculation'), loader: () => import('./modules/ec/ecCompletion_calculation/ecCompletion_calculation'),
loading: Loading, loading: Loading,
@ -190,18 +192,21 @@ class App extends Component {
<Route path="/ec_major_schools/:major_school_id/academic_years/:ec_year_id/reach_calculation_info" <Route path="/ec_major_schools/:major_school_id/academic_years/:ec_year_id/reach_calculation_info"
component={GraduatesRequirement}> component={GraduatesRequirement}>
</Route> </Route>
{/*课程体系对毕业要求的支撑*/}
<Route path="/ec_major_schools/:major_school_id/academic_years/:ec_year_id/requirement_vs_courses" component={ecCourseSupports}> <Route path="/ec_major_schools/:major_school_id/academic_years/:ec_year_id/requirement_vs_courses" component={ecCourseSupports}>
</Route> </Route>
{/*课程体系*/}
<Route path="/ec_courses/:ec_course_id/ec_course_reach_setting" component={ecCourseEvaluations} {...this.state} {...this.props}> <Route path="/ec_courses/:ec_course_id/ec_course_reach_setting" component={ecCourseEvaluations} {...this.state} {...this.props}>
</Route> </Route>
{/*达成评价详情*/}
<Route path="/ec_courses/:ec_course_id/competition_calculation_info" component={EcCompletionCalculation}> <Route path="/ec_courses/:ec_course_id/competition_calculation_info" component={EcCompletionCalculation}>
</Route> </Route>
{/*课程目标评价方法*/}
<Route path="/ec_courses/:ec_course_id/evaluation_methods" component={EvaluationMethods}> <Route path="/ec_courses/:ec_course_id/evaluation_methods" component={EvaluationMethods}>
</Route> </Route>
<Route path="/tasks/:stageId" component={IndexWrapperComponent}/> <Route path="/tasks/:stageId" component={IndexWrapperComponent}/>
@ -262,7 +267,7 @@ class App extends Component {
<Route path="/ec_courses/:ec_course_id/ec_course_support_setting" component={EcCourseSupportSetting}> <Route path="/ec_courses/:ec_course_id/ec_course_support_setting" component={EcCourseSupportSetting}>
</Route> </Route>
{/*达成评价详情*/}
<Route path="/ec_courses/:ec_course_id/competition_calculation_info" component={EcCompletionCalculation}> <Route path="/ec_courses/:ec_course_id/competition_calculation_info" component={EcCompletionCalculation}>
</Route> </Route>

@ -432,6 +432,7 @@ class EcCompletionCalculation extends Component {
<div className="educontent mb290"> <div className="educontent mb290">
<EcTitleCourseEvaluations <EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata} schooldata={schooldata}
ecComponentState={'ecCompletion'} ecComponentState={'ecCompletion'}
ecpath={"show"} ecpath={"show"}
@ -443,6 +444,8 @@ class EcCompletionCalculation extends Component {
<a href={schooldata.course_setting_url} className="color-grey-9 TrainingLecturer">课程体系</a> > <a href={schooldata.course_setting_url} className="color-grey-9 TrainingLecturer">课程体系</a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name} 达成评价详情</a> <a className="TrainingTheory major_name"> {schooldata.ec_course_name} 达成评价详情</a>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */} {/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<div className="color-grey-9 mr10">系统根据课程目标课程考核方式与课程目标评价方法一键计算评价课程目标的达成情况 <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
</div> </div>
<div className="padding20-30" id="training_objective_contents" <div className="padding20-30" id="training_objective_contents"

@ -267,7 +267,6 @@ class ecCourseEvaluations extends Component {
this.setState({ this.setState({
Modallist: "删除失败", Modallist: "删除失败",
Modallisttype:true, Modallisttype:true,
Modallist:'',
Modallists:'', Modallists:'',
deleteassociatedclasstype:false, deleteassociatedclasstype:false,
assclassvalue:'' assclassvalue:''
@ -860,6 +859,7 @@ class ecCourseEvaluations extends Component {
<div className="educontent mb40"> <div className="educontent mb40">
<EcTitleCourseEvaluations <EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata} schooldata={schooldata}
ecComponentState={ecComponentState} ecComponentState={ecComponentState}
ecpath={"show"} ecpath={"show"}
@ -870,6 +870,7 @@ class ecCourseEvaluations extends Component {
<p className="clearfix padding20-30 bor-bottom-greyE" id="SystemParametersP"> <p className="clearfix padding20-30 bor-bottom-greyE" id="SystemParametersP">
<a href={schooldata.course_setting_url} className="TrainingLecturer color-grey-9">课程体系 </a> > <a href={schooldata.course_setting_url} className="TrainingLecturer color-grey-9">课程体系 </a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name}</a> <a className="TrainingTheory major_name"> {schooldata.ec_course_name}</a>
<div className="color-grey-9 mr10">请结合本课程的教学情况修改考核方式并导入学生的对应考核成绩 <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
{/*课程考核方式与数据来源*/} {/*课程考核方式与数据来源*/}
{/* <span className="fl font-18 courseSystem"></span> */} {/* <span className="fl font-18 courseSystem"></span> */}
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */} {/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}

@ -703,6 +703,7 @@ class EcCourseEvaluationsbottom extends Component {
{/*</div>*/} {/*</div>*/}
<EcTitleCourseEvaluations <EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata} schooldata={schooldata}
ecpath={"show"} ecpath={"show"}
/> />
@ -712,7 +713,9 @@ class EcCourseEvaluationsbottom extends Component {
<p className="clearfix padding20-30 bor-bottom-greyE" id="SystemParametersP"> <p className="clearfix padding20-30 bor-bottom-greyE" id="SystemParametersP">
<a href={schooldata.course_setting_url} className="TrainingLecturer color-grey-9">课程体系 </a> > <a href={schooldata.course_setting_url} className="TrainingLecturer color-grey-9">课程体系 </a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name} </a> <a className="TrainingTheory major_name"> {schooldata.ec_course_name} </a>
{/*课程考核方式与数据来源*/} <div className="color-grey-9 mr10">请结合本课程的教学情况修改说明每个课程目标的评价环节和评估方式 <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
{/*课程考核方式与数据来源*/}
{/* <span className="fl font-18 courseSystem"></span> */} {/* <span className="fl font-18 courseSystem"></span> */}
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */} {/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<span className="Importclassroomdata" style={{top: '22px'}}> <span className="Importclassroomdata" style={{top: '22px'}}>

@ -245,6 +245,7 @@ class EcCourseSupportSetting extends Component {
<div className="newMain clearfix courseSupport"> <div className="newMain clearfix courseSupport">
<div className="educontent mb50"> <div className="educontent mb50">
<EcTitleCourseEvaluations <EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata} schooldata={schooldata}
ecComponentState={'ecCompletion'} ecComponentState={'ecCompletion'}
ecpath={"ec_course_support_setting"} ecpath={"ec_course_support_setting"}

@ -473,6 +473,7 @@ class ecCourseSupports extends Component {
<div className="educontent mb290"> <div className="educontent mb290">
<EcTitleCourseEvaluations <EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata} schooldata={schooldata}
ecComponentState={ecComponentState} ecComponentState={ecComponentState}
ecpath={"requirement_vs_courses"} ecpath={"requirement_vs_courses"}
@ -481,11 +482,13 @@ class ecCourseSupports extends Component {
<div className="edu-back-white eacourse"> <div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE" style={{position:'relative'}}> <div className="clearfix padding20-30 bor-bottom-greyE" style={{position:'relative'}}>
<span className="fl font-18 courseSystem">课程体系对毕业要求的支撑</span> <span className="font-18 courseSystem">课程体系对毕业要求的支撑</span>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */} {/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<span className={data.is_manager===false?"none":"Importclassroomdata"} style={{top: '29px'}}> <span className={data.is_manager===false?"none":"Importclassroomdata"} style={{top: '29px'}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={'/ec_major_schools/'+major_school_id+'/academic_years/'+ec_year_id+'/export_course_requirements?format=xls'}>导出课程体系支撑矩阵</a> <a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={'/ec_major_schools/'+major_school_id+'/academic_years/'+ec_year_id+'/export_course_requirements?format=xls'}>导出课程体系支撑矩阵</a>
</span> </span>
<div className="color-grey-9 mr10">用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 <a className={"color-blue"} onClick={() => window.elasticLayer(3534)} >查看详情</a></div>
</div> </div>
<div className="padding20-30" id="training_objective_contents"> <div className="padding20-30" id="training_objective_contents">
<span className="fl SystemParameters" >毕业要求指标点<a href={data.subitems_url}><span className="Systemnum">{data.subitems_count}</span></a></span> <span className="fl SystemParameters" >毕业要求指标点<a href={data.subitems_url}><span className="Systemnum">{data.subitems_count}</span></a></span>

@ -262,6 +262,7 @@ class ecGradeEvaluations extends Component {
<div className="educontent mb40"> <div className="educontent mb40">
<EcTitleCourseEvaluations <EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata} schooldata={schooldata}
ecpath={"show"} ecpath={"show"}
/> />
@ -271,6 +272,7 @@ class ecGradeEvaluations extends Component {
<p className="clearfix padding20-30 bor-bottom-greyE" id="SystemParametersP"> <p className="clearfix padding20-30 bor-bottom-greyE" id="SystemParametersP">
<a href={schooldata.course_setting_url} className="TrainingLecturer color-grey-9">课程体系 </a> > <a href={schooldata.course_setting_url} className="TrainingLecturer color-grey-9">课程体系 </a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name}</a> <a className="TrainingTheory major_name"> {schooldata.ec_course_name}</a>
{/*课程考核方式与数据来源*/} {/*课程考核方式与数据来源*/}
{/* <span className="fl font-18 courseSystem"></span> */} {/* <span className="fl font-18 courseSystem"></span> */}
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */} {/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}

@ -23,6 +23,7 @@ class ecStudentList extends Component {
schooldata:{}, schooldata:{},
majorschoollist:undefined, majorschoollist:undefined,
titlemessage:"提示", titlemessage:"提示",
ecComponentState:"ecStudentList",
visible:false, visible:false,
Modallist:'', Modallist:'',
Modallisttypes:0, Modallisttypes:0,
@ -318,8 +319,9 @@ class ecStudentList extends Component {
<div className="educontent mb290"> <div className="educontent mb290">
<EcTitleCourseEvaluations <EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata} schooldata={schooldata}
ecpath={"none"} ecpath={this.state.ecComponentState}
/> />
<div className="clearfix padding20-30 bor-bottom-greyE mb10 mt10 edu-back-white"> <div className="clearfix padding20-30 bor-bottom-greyE mb10 mt10 edu-back-white">
<span className="fl font-18 courseSystem ">学生列表</span> <span className="fl font-18 courseSystem ">学生列表</span>
@ -329,9 +331,11 @@ class ecStudentList extends Component {
<div className="edu-back-white eacourse"> <div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE"><span <div className="clearfix padding20-30 bor-bottom-greyE"><span
className="fl font-18 courseSystem">学生列表 className=" font-18 courseSystem">学生列表
{majorschoollist===undefined?"":majorschoollist.total_student} {majorschoollist===undefined?"":majorschoollist.total_student}
</span></div> </span>
<div className="color-grey-9 mr10">提供模板支持导入学生信息(请先下载模板) <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
</div>
<div className="padding20-30 padbottom" id="training_objective_contents"> <div className="padding20-30 padbottom" id="training_objective_contents">
{ismanager===false?"": {ismanager===false?"":

@ -21,7 +21,7 @@
margin-right: 10px; margin-right: 10px;
} }
#traningNav>li>.ecTitles { #traningNav>li>.ecTitles {
line-height: 18px !important; line-height: 16px !important;
} }
#traningNav>li>.ecTitlefont:hover{ #traningNav>li>.ecTitlefont:hover{

@ -21,6 +21,7 @@ class EcTitleCourseEvaluations extends Component {
render() { render() {
let{schooldata,ecComponentState,ecpaths}=this.state; let{schooldata,ecComponentState,ecpaths}=this.state;
return ( return (
<div> <div>
<div className="mb10 mt10 eaSystemp"> <div className="mb10 mt10 eaSystemp">
@ -49,16 +50,20 @@ class EcTitleCourseEvaluations extends Component {
<a className={"ecTitle ecTitles"} >4</a> <a className={"ecTitle ecTitles"} >4</a>
<a className={"ecTitlefont"} href={schooldata.requirement_vs_standard}>毕业要求 vs 通用标准</a> <a className={"ecTitlefont"} href={schooldata.requirement_vs_standard}>毕业要求 vs 通用标准</a>
</li> </li>
<li className={ecpaths==="ecStudentList"||ecpaths==="show"?"ecimgs11":"ecimgs"} style={{width: ecpaths==="ecStudentList"?'126px':'83px'}}>
<a className={ ecpaths==="ecStudentList"||ecpaths==="show"?"ml18 ecTitleFFF ecTitles":"ecTitle"} >5</a>
<a className={ ecpaths==="ecStudentList"||ecpaths==="show"?"ecTitlefontFFF":"ecTitlefont"} href={"/ec_major_schools/"+this.props.match.params.major_school_id+"/academic_years/"+this.props.match.params.ec_year_id+"/student_lists"}>学生</a>
</li>
<li className={ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ecimgs11":"ecimgs"}> <li className={ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ecimgs11":"ecimgs"}>
<a className={ ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ml18 ecTitleFFF ecTitles":"ecTitle ecTitles"} >5</a> <a className={ ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ml18 ecTitleFFF ecTitles":"ecTitle ecTitles"} >6</a>
<a className={ ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.course_setting_url}>课程体系</a> <a className={ ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.course_setting_url}>课程体系</a>
</li> </li>
<li className={ecpaths==="requirement_vs_courses"?"ecimgs3":"ecimgs"}> <li className={ecpaths==="requirement_vs_courses"?"ecimgs3":"ecimgs"}>
<a className={ ecpaths==="requirement_vs_courses"?"ecmarginleft ecTitleFFF ecTitles":"ecTitle ecTitles"} >6</a> <a className={ ecpaths==="requirement_vs_courses"?"ecmarginleft ecTitleFFF ecTitles":"ecTitle ecTitles"} >7</a>
<a className={ ecpaths==="requirement_vs_courses"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.requirement_vs_courses}>课程体系 vs 毕业要求</a> <a className={ ecpaths==="requirement_vs_courses"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.requirement_vs_courses}>课程体系 vs 毕业要求</a>
</li> </li>
<li className={ecpaths==="reach_calculation_info"?"ecimgs2 info2":"ecimgs"}> <li className={ecpaths==="reach_calculation_info"?"ecimgs2 info2":"ecimgs"}>
<a className={ ecpaths==="reach_calculation_info"?"ecTitleFFF ml18 ecTitles":"ecTitle ecTitles"} >7</a> <a className={ ecpaths==="reach_calculation_info"?"ecTitleFFF ml18 ecTitles":"ecTitle ecTitles"} >8</a>
<a className={ ecpaths==="reach_calculation_info"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.reach_calculation_info_url}>达成度评价结果</a> <a className={ ecpaths==="reach_calculation_info"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.reach_calculation_info_url}>达成度评价结果</a>
</li> </li>
{/*<li className={ecComponentState==="ecCourseSupports"?"active edu-menu-panel":"edu-menu-panel"}>*/} {/*<li className={ecComponentState==="ecCourseSupports"?"active edu-menu-panel":"edu-menu-panel"}>*/}

@ -599,6 +599,7 @@ class GraduatesRequirement extends Component {
<div className="newMain clearfix"> <div className="newMain clearfix">
<div className="educontent mb290"> <div className="educontent mb290">
<EcTitleCourseEvaluations <EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata} schooldata={schooldata}
ecComponentState={'ecCompletion'} ecComponentState={'ecCompletion'}
ecpath={"reach_calculation_info"} ecpath={"reach_calculation_info"}

Loading…
Cancel
Save