proforma upgrade and small fixes

This commit is contained in:
Karol
2022-08-23 21:12:03 +02:00
parent 3effdbe600
commit 50b81df742
6 changed files with 16 additions and 16 deletions

View File

@ -28,7 +28,7 @@ gem 'net-smtp', require: false
gem 'nokogiri'
gem 'pagedown-bootstrap-rails'
gem 'pg'
gem 'proforma', github: 'openHPI/proforma', branch: 'v0.5.2'
gem 'proforma', github: 'openHPI/proforma', tag: 'v0.7.1'
gem 'prometheus_exporter'
gem 'pry-byebug'
gem 'puma'

View File

@ -1,13 +1,13 @@
GIT
remote: https://github.com/openHPI/proforma.git
revision: 243853e66034bc2afbb9c9661475d9718d007304
branch: v0.5.2
revision: cf61517a5cd765afb9d0d19ea1c692e18e3131d7
tag: v0.7.1
specs:
proforma (0.5.2)
activemodel (>= 5.2.3, < 7.2.0)
activesupport (>= 5.2.3, < 7.2.0)
nokogiri (~> 1.13)
rubyzip (~> 2.3)
proforma (0.7.1)
activemodel (>= 5.2.3, < 8.0.0)
activesupport (>= 5.2.3, < 8.0.0)
nokogiri (>= 1.10.2, < 2.0.0)
rubyzip (>= 1.2.2, < 3.0.0)
GEM
remote: https://rubygems.org/

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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')