You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/views/ecs/course_targets/with_achievement_methods.js...

29 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

json.course_targets do
json.array! @course_targets do |course_target|
json.extract! course_target, :id, :position, :content
json.course_achievement_methods do
json.array! course_target.ec_course_achievement_methods do |achievement_method|
evaluation = achievement_method.ec_course_evaluation
json.extract! achievement_method, :id, :score, :percentage
json.course_evaluation do
json.partial! 'ecs/course_evaluations/shared/ec_course_evaluation_only', ec_course_evaluation: evaluation
end
json.course_evaluation_relates do
json.array! achievement_method.ec_achievement_evaluation_relates do |relate|
json.extract! relate, :id, :position, :ec_course_evaluation_subitem_id
subitem = relate.ec_course_evaluation_subitem
if evaluation.is_course_type?
json.name subitem&.name
else
json.name subitem&.name ? "#{evaluation.name}#{relate.position}:#{subitem&.name}" : "#{evaluation.name}#{relate.position}"
end
end
end
end
end
end
end