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

dev_course
cxt 6 years ago
commit e0e224a03a

@ -429,10 +429,10 @@ class StudentWorksController < ApplicationController
def shixun_work_report
@user = @work.user
@shixun = @homework.shixuns.take
@games = @work.myshixun.games.includes(:challenge, :game_codes,:outputs) if @work.myshixun
@games = @work.myshixun.games.includes(:challenge) if @work.myshixun
# 用户最大评测次数
@user_evaluate_count = @games.inject(0){|sum, g| sum + g.outputs.pluck(:query_index).first.to_i } if @games
@user_evaluate_count = @games.sum(:evaluate_count) if @games
# 图形效率图的数据
@echart_data = student_efficiency(@homework, @work)
end
@ -440,10 +440,10 @@ class StudentWorksController < ApplicationController
def export_shixun_work_report
@user = @work.user
@shixun = @homework.shixuns.take
@games = @work.myshixun.games.includes(:challenge, :game_codes,:outputs) if @work.myshixun
@games = @work.myshixun.games.includes(:challenge, :game_codes) if @work.myshixun
# 用户最大评测次数
@user_evaluate_count = @games.inject(0){|sum, g| sum + g.outputs.pluck(:query_index).first.to_i } if @games
@user_evaluate_count = @games.sum(:evaluate_count) if @games
# 图形效率图的数据
@echart_data = student_efficiency(@homework, @work)
@myself_eff = @echart_data[:efficiency_list].find { |item| item.last == @user.id }

@ -1,6 +1,6 @@
class RemoveShixunLongTextForShixuns < ActiveRecord::Migration[5.2]
def change
if Shixun.first.description.present?
if Shixun.first.has_attribute?(:description)
remove_columns :shixuns, :description, :propaedeutics, :evaluate_script
end
end

Loading…
Cancel
Save