Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_course
SylorHuang 6 years ago
commit d72110f9a2

@ -128,7 +128,7 @@ module ApplicationHelper
if source.class.to_s == 'User'
File.join(relative_path, ["#{source.class}", "#{source.id}"])
else
File.join("/images/avatars", ["#{source.class}", "#{source.id}"])
File.join("images/avatars", ["#{source.class}", "#{source.id}"])
end
elsif source.class.to_s == 'User'
str = source.user_extension.try(:gender).to_i == 0 ? "b" : "g"
@ -146,7 +146,7 @@ module ApplicationHelper
def shixun_url_to_avatar(shixun)
if File.exist?(disk_filename(shixun.class, shixun.id))
File.join("/images/#{relative_path}", "#{shixun.class}", "#{shixun.id}")
File.join("images/#{relative_path}", "#{shixun.class}", "#{shixun.id}")
else
File.join("educoder", "index", "shixun", "shixun#{rand(23)}.jpg")
end

@ -111,7 +111,7 @@ class HomeworksService
if homework.work_efficiency
if homework.max_efficiency < student_work.efficiency
# homework.max_efficiency = student_work.efficiency
homework.update_column("max_efficiency", homework.max_efficiency)
homework.update_column("max_efficiency", student_work.efficiency)
end
# eff_score = homework.max_efficiency == 0 ? 0 : student_work.efficiency / homework.max_efficiency * homework.eff_score
# student_work.eff_score = format("%.2f", eff_score)
@ -200,7 +200,7 @@ class HomeworksService
# 如果作业的最大效率值有变更则更新所有作品的效率分
if homework.work_efficiency && homework.max_efficiency < work.efficiency
homework.update_column("max_efficiency", homework.max_efficiency)
homework.update_column("max_efficiency", work.efficiency)
end
end

@ -15,6 +15,7 @@ json.efficiency number_with_precision @work.efficiency, precision: 2
json.max_efficiency number_with_precision @homework.max_efficiency, precision: 2
json.passed_time @myshixun.passed_time
json.total_spend_time @myshixun.total_spend_time
json.user_score @myshixun.total_score
# 关卡完成情况
index = 1

Loading…
Cancel
Save