diff --git a/app/controllers/ec_courses_controller.rb b/app/controllers/ec_courses_controller.rb index 3bd700a8..9a3d491d 100644 --- a/app/controllers/ec_courses_controller.rb +++ b/app/controllers/ec_courses_controller.rb @@ -448,23 +448,19 @@ class EcCoursesController < ApplicationController 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} - } + 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} end def crud_score_level