diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0aa0437fe..071099bf2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -155,16 +155,16 @@ module ApplicationHelper grade = Grade.where(:user_id => user.id, :container_id => container_id, :container_type => container_type).first if grade.nil? Grade.create!(:user_id => user.id, :container_id => container_id, :container_type => container_type, :score => score) + user.update_column(:grade, (score.to_i + user.grade.to_i)) end - user.update_column(:grade, (score.to_i + user.grade.to_i)) end def reward_experience(user, container_id, container_type, score) experience = Experience.where(:user_id => user.id, :container_id => container_id, :container_type => container_type).first if experience.nil? Experience.create!(:user_id => user.id, :container_id => container_id, :container_type => container_type, :score => score) + user.update_column(:experience, (score.to_i + user.experience.to_i)) end - user.update_column(:experience, (score.to_i + user.experience.to_i)) end # codeMirror语言转换 diff --git a/app/views/shixuns/_shixun_top.html.erb b/app/views/shixuns/_shixun_top.html.erb index 8f56ebd11..b248dfc1d 100644 --- a/app/views/shixuns/_shixun_top.html.erb +++ b/app/views/shixuns/_shixun_top.html.erb @@ -46,7 +46,12 @@ <% end %> - +
+
+
EDUCODER
+

LOADING

+
+