proforma upgrade and small fixes
This commit is contained in:
@ -7,7 +7,7 @@ class CodeharborLinksController < ApplicationController
|
||||
|
||||
def new
|
||||
base_url = CodeOcean::Config.new(:code_ocean).read[:codeharbor][:url] || ''
|
||||
@codeharbor_link = CodeharborLink.new(push_url: "#{base_url}/import_exercise",
|
||||
@codeharbor_link = CodeharborLink.new(push_url: "#{base_url}/import_task",
|
||||
check_uuid_url: "#{base_url}/import_uuid_check")
|
||||
authorize!
|
||||
end
|
||||
|
@ -14,9 +14,9 @@ module ExerciseService
|
||||
req.headers['Authorization'] = "Bearer #{@codeharbor_link.api_key}"
|
||||
req.body = {uuid: @uuid}.to_json
|
||||
end
|
||||
response_hash = JSON.parse(response.body, symbolize_names: true).slice(:task_found, :update_right)
|
||||
response_hash = JSON.parse(response.body, symbolize_names: true).slice(:uuid_found, :update_right)
|
||||
|
||||
{error: false, message: message(response_hash[:task_found], response_hash[:update_right])}.merge(response_hash)
|
||||
{error: false, message: message(response_hash[:uuid_found], response_hash[:update_right])}.merge(response_hash)
|
||||
rescue Faraday::Error, JSON::ParserError
|
||||
{error: true, message: I18n.t('exercises.export_codeharbor.error')}
|
||||
end
|
||||
|
@ -109,7 +109,7 @@ module ProformaService
|
||||
filename: filename(file),
|
||||
usage_by_lms: file.read_only ? 'display' : 'edit',
|
||||
visible: file.hidden ? 'no' : 'yes',
|
||||
internal_description: file.role || 'regular_file'
|
||||
# internal_description: file.role || 'regular_file'
|
||||
)
|
||||
add_content_to_task_file(file, task_file)
|
||||
task_file
|
||||
|
@ -1,7 +1,7 @@
|
||||
- if error
|
||||
= button_tag type: 'button', class:'btn btn-primary float-end export-button export-retry-button', data: {exercise_id: exercise.id} do
|
||||
i.fa-solid.fa-arrows-rotate.confirm-icon
|
||||
= t('exercises.export_codeharbor.buttons.retry')
|
||||
= button_tag type: 'button', class:'btn btn-primary float-end export-button export-retry-button', data: {exercise_id: exercise.id} do
|
||||
i.fa-solid.fa-arrows-rotate.confirm-icon
|
||||
= t('exercises.export_codeharbor.buttons.retry')
|
||||
- else
|
||||
- unless exported
|
||||
- if !task_found || update_right
|
||||
@ -9,6 +9,6 @@
|
||||
i.fa-solid.fa-check.confirm-icon
|
||||
= t('exercises.export_codeharbor.buttons.export')
|
||||
|
||||
= button_tag type: 'submit', class:'btn btn-secondary float-end export-button', data: {dismiss: 'modal'} do
|
||||
= button_tag type: 'submit', class:'btn btn-secondary float-end export-button', data: {bs_dismiss: 'modal'} do
|
||||
i.fa-solid.fa-xmark.abort-icon
|
||||
= exported ? t('exercises.export_codeharbor.buttons.close') : t('exercises.export_codeharbor.buttons.abort')
|
||||
|
Reference in New Issue
Block a user