diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb index f40e18e1c..445d67087 100644 --- a/app/controllers/concerns/git_helper.rb +++ b/app/controllers/concerns/git_helper.rb @@ -53,4 +53,9 @@ module GitHelper container.update_attributes!(:repo_name => new_repo_name) end + #实训题的关卡url初始化 + def challenge_path(path) + cha_path = path.present? ? path.split(";") : [] + cha_path.reject(&:blank?)[0].try(:strip) + end end \ No newline at end of file diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0cdfeba06..d8ea8cd60 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,6 +1,7 @@ # 所有的方法请按首字母的顺序依次列出 module ApplicationHelper include Educoder::I18n + include GitHelper ONE_MINUTE = 60 * 1000 ONE_HOUR = 60 * ONE_MINUTE @@ -333,11 +334,6 @@ module ApplicationHelper raw arr.join('') end - #实训题的关卡url初始化 - def challenge_path(path) - cha_path = path.present? ? path.split(";") : [] - cha_path.reject(&:blank?)[0].try(:strip) - end end diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index a2a80c311..45666d296 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -1,5 +1,6 @@ module ExercisesHelper + # include GitHelper #获取每个学生对每个题的答案状态 def get_each_student_exercise(exercise_id,exercise_questions,user_id)