23 lines
430 B
Ruby
23 lines
430 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ExerciseHelper
|
|
include LtiHelper
|
|
|
|
def embedding_parameters(exercise)
|
|
"locale=#{I18n.locale}&token=#{exercise.token}"
|
|
end
|
|
|
|
def qa_js_tag
|
|
javascript_include_tag "#{qa_url}/assets/qa_api.js"
|
|
end
|
|
|
|
def qa_url
|
|
config = CodeOcean::Config.new(:code_ocean)
|
|
enabled = config.read[:code_pilot][:enabled]
|
|
|
|
if enabled
|
|
config.read[:code_pilot][:url]
|
|
end
|
|
end
|
|
end
|