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

dev_forum
daiao 6 years ago
commit 826413badc

@ -15,7 +15,17 @@ class Competitions::CompetitionModulesController < Competitions::BaseController
md = current_module.competition_module_md_content || current_module.build_competition_module_md_content
md.name = params[:md_name]
md.content = params[:md_content]
md.save!
ActiveRecord::Base.transaction do
md.save!
attachment_ids = Array.wrap(params[:attachment_ids]).map(&:to_i)
old_attachment_ids = md.attachments.pluck(:id)
destroy_ids = old_attachment_ids - attachment_ids
md.attachments.where(id: destroy_ids).delete_all
Attachment.where(id: attachment_ids - old_attachment_ids).update_all(container: md)
end
render_ok
end

@ -130,6 +130,7 @@ class MyshixunsController < ApplicationController
# is_public = test_sets.where(:position => j_test_set['caseId']).first.try(:is_public)
logger.info "actual_output:################################################# #{actual_output}"
ts_time = format("%.3f", j_test_set['testSetTime'].to_i).to_f
Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'],
:actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => max_query_index,
:compile_success => compile_success.to_i, :sec_key => sec_key, :ts_time => j_test_set['testSetTime'])

@ -10,13 +10,13 @@ module Searchable::Dependents::User
def check_searchable_dependents
if firstname_previously_changed? || lastname_previously_changed? || user_extension.school_id_previously_changed?
# reindex shixun
created_shixuns.each{ |shixun| shixun.reindex }
created_shixuns.each(&:reindex)
# reindex course
manage_courses.each(&:reindex)
# reindex subject
created_subjects.each { |subject| subject.reindex }
created_subjects.each(&:reindex)
end
end
end

@ -5,4 +5,7 @@ if md.present?
json.md_name md.name
json.md_content md.content
json.created_at md.created_at.strftime('%Y-%m-%d %H:%M:%S')
json.attachments do
json.array! md.attachments, partial: 'attachments/attachment_simple', as: :attachment
end
end

@ -7,6 +7,7 @@ json.test_sets @qurey_test_sets do |test_set|
json.actual_output evaluate_actual_output(test_set)
end
json.compile_success test_set.try(:compile_success)
json.ts_time test_set.ts_time
end
json.allowed_unlock @shixun.test_set_permission

@ -1,4 +1,4 @@
json.(@base_date, :grade, :gold, :experience, :status, :had_done, :position, :port, :record_consume_time, :mirror_name,
:picture, :web_route, :star, :next_game, :prev_game)
:picture, :web_route, :star, :next_game, :prev_game, :max_mem)
# # 测试集相关
json.partial! 'games/testset_list'

@ -1,13 +0,0 @@
defaults: &defaults
url: http://localhost:9200
development:
<<: *defaults
test:
<<: *defaults
production:
<<: *defaults
url: 'http://elastic:Elas+ucloud123@106.75.27.125:59200/'
# url: 'http://elastic:TEST_elastickibana321@es-cn-0pp174wsj000iubdx.public.elasticsearch.aliyuncs.com'
Loading…
Cancel
Save