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

dev_forum
jingquan huang 6 years ago
commit 4180b1d3bc

@ -69,7 +69,10 @@ class GamesController < ApplicationController
if res && res['code'].to_i != 0
raise("实训云平台繁忙繁忙等级99")
end
@vnc_url = "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless"
# 无域名版本
#@vnc_url = "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless"
# 有域名版本
@vnc_url = "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless"
rescue Exception => e
Rails.logger.error(e.message)
end
@ -593,7 +596,7 @@ class GamesController < ApplicationController
:times => params[:first].to_i, :podType => @shixun.webssh, :content_modified => content_modified,
:containers => "#{Base64.urlsafe_encode64(shixun_container_limit(@shixun))}",
:persistenceName => @shixun.identifier, :tpmScript => "#{tpmScript}", :sec_key => sec_key,
:timeLimit => "#{game_challenge.exec_time}", :isPublished => (@shixun.status < 2 ? 0 : 1) }
:timeLimit => game_challenge.exec_time, :isPublished => (@shixun.status < 2 ? 0 : 1) }
# 评测有文件输出的需要特殊传字段 path表示文件存储的位置
br_params['file'] = Base64.urlsafe_encode64({path: "#{game_challenge.picture_path}"}.to_json) if game_challenge.picture_path.present?

@ -78,10 +78,10 @@ class GraduationTasksController < ApplicationController
# 教师评阅搜索 0: 未评, 1 已评
unless params[:teacher_comment].blank?
graduation_work_ids = GraduationWorkScore.where(graduation_work_id: @work_list.map(&:id)).pluck(:graduation_work_id)
if params[:teacher_comment] == 0
@work_list = @work_list.where.not(id: graduation_work_ids)
elsif params[:teacher_comment] == 1
@work_list = @work_list.where(id: graduation_work_ids).where.not(work_status: 0)
if params[:teacher_comment].to_i == 0
@work_list = @work_list.where("work_status != 0")
elsif params[:teacher_comment].to_i == 1
@work_list = @work_list.where("work_status != 0").where(id: graduation_work_ids)
end
end

@ -22,8 +22,6 @@ module ElasticsearchAble
fragment_size: EduSetting.get('es_highlight_fragment_size') || 30,
tag: '<span class="highlight">',
fields: {
name: { type: 'plain' },
subject: { type: 'plain' },
challenge_names: { type: 'plain' },
challenge_tag_names: { type: 'plain' },
description: { type: 'plain' },

@ -3,4 +3,5 @@
:logfile: log/sidekiq.log
:queues:
- [default, 3]
- [searchkick, 10]
- [notify, 100]

@ -4,7 +4,7 @@ class MigrateCourseMembers < ActiveRecord::Migration[5.2]
Course.find_each do |course|
position = 1
course.course_groups.reorder("CONVERT(course_groups.name USING gbk) COLLATE gbk_chinese_ci ASC").find_each do |group|
course.course_groups.reorder("CONVERT(course_groups.name USING gbk) COLLATE gbk_chinese_ci ASC").each do |group|
group.update_attribute(:position, position)
position += 1
end

@ -1,11 +0,0 @@
class MigrateCourseGroupPosition < ActiveRecord::Migration[5.2]
def change
Course.find_each do |course|
position = 1
course.course_groups.reorder("CONVERT(course_groups.name USING gbk) COLLATE gbk_chinese_ci ASC").find_each do |group|
group.update_attribute(:position, position)
position += 1
end
end
end
end
Loading…
Cancel
Save