diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 35488ecc5..f5a2436c9 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -529,6 +529,14 @@ class ShixunsController < ApplicationController tip_show_exception("/myshixuns/#{current_myshixun.try(:identifier)}/reset_my_game") end + + if current_myshixun.repo_name.nil? + g = Gitlab.client + repo_name = g.project(current_myshixun.gpid).try(:path_with_namespace) + current_myshixun.update_column(:repo_name, repo_name) + end + + # 如果存在实训,则直接进入实训 # 如果实训允许跳关,传参params[:challenge_id]跳入具体的关卡 @current_task = diff --git a/app/services/concerns/elasticsearch_able.rb b/app/services/concerns/elasticsearch_able.rb index c08aab029..59c2c890b 100644 --- a/app/services/concerns/elasticsearch_able.rb +++ b/app/services/concerns/elasticsearch_able.rb @@ -20,7 +20,17 @@ module ElasticsearchAble def highlight_options { fragment_size: EduSetting.get('es_highlight_fragment_size') || 30, - tag: '' + tag: '', + fields: { + name: { type: 'plain' }, + subject: { type: 'plain' }, + challenge_names: { type: 'plain' }, + challenge_tag_names: { type: 'plain' }, + description: { type: 'plain' }, + subject_stages: { type: 'plain' }, + content: { type: 'plain' }, + descendants_contents: { type: 'plain' }, + } } end diff --git a/db/migrate/20190720025309_add_ts_mem_for_outputs.rb b/db/migrate/20190720025309_add_ts_mem_for_outputs.rb new file mode 100644 index 000000000..1cf3f3e6f --- /dev/null +++ b/db/migrate/20190720025309_add_ts_mem_for_outputs.rb @@ -0,0 +1,5 @@ +class AddTsMemForOutputs < ActiveRecord::Migration[5.2] + def change + add_column :outputs, :ts_mem, :float + end +end diff --git a/db/migrate/20190720025341_add_ts_time_for_outputs.rb b/db/migrate/20190720025341_add_ts_time_for_outputs.rb new file mode 100644 index 000000000..a5366fbd0 --- /dev/null +++ b/db/migrate/20190720025341_add_ts_time_for_outputs.rb @@ -0,0 +1,5 @@ +class AddTsTimeForOutputs < ActiveRecord::Migration[5.2] + def change + add_column :outputs, :ts_time, :float + end +end