diff --git a/app/services/proforma_service/convert_exercise_to_task.rb b/app/services/proforma_service/convert_exercise_to_task.rb index 5c87f50e..c2ff1bbf 100644 --- a/app/services/proforma_service/convert_exercise_to_task.rb +++ b/app/services/proforma_service/convert_exercise_to_task.rb @@ -31,7 +31,7 @@ module ProformaService language: DEFAULT_LANGUAGE, model_solutions: model_solutions, meta_data: { - openHPI: { + CodeOcean: { instructions: @exercise.instructions, }, }, @@ -76,10 +76,12 @@ module ProformaService end def test_meta_data(file) - {openHPI: { - 'entry-point': file.filepath, - 'feedback-message': file.feedback_message, - }} + { + CodeOcean: { + 'entry-point': file.filepath, + 'feedback-message': file.feedback_message, + }, + } end def test_file(file) diff --git a/app/services/proforma_service/convert_task_to_exercise.rb b/app/services/proforma_service/convert_task_to_exercise.rb index e761efb5..206bda18 100644 --- a/app/services/proforma_service/convert_task_to_exercise.rb +++ b/app/services/proforma_service/convert_task_to_exercise.rb @@ -21,7 +21,7 @@ module ProformaService user: @user, title: @task.title, description: @task.description, - instructions: @task.meta_data&.dig(:openHPI)&.dig(:instructions), + instructions: @task.meta_data&.dig(:CodeOcean)&.dig(:instructions), files: files ) end @@ -34,7 +34,7 @@ module ProformaService @task.tests.map do |test_object| task_files.delete(test_object.files.first.id).tap do |file| file.weight = 1.0 - file.feedback_message = test_object.meta_data[:openHPI]&.dig(:'feedback-message') + file.feedback_message = test_object.meta_data[:CodeOcean]&.dig(:'feedback-message') end end end diff --git a/app/services/proforma_service/export_task.rb b/app/services/proforma_service/export_task.rb index f1afc741..ca97f1c7 100644 --- a/app/services/proforma_service/export_task.rb +++ b/app/services/proforma_service/export_task.rb @@ -9,7 +9,7 @@ module ProformaService def execute @task = ConvertExerciseToTask.call(exercise: @exercise) - namespaces = [{prefix: 'openHPI', uri: 'open.hpi.de'}] + namespaces = [{prefix: 'CodeOcean', uri: 'codeocean.openhpi.de'}] exporter = Proforma::Exporter.new(task: @task, custom_namespaces: namespaces) exporter.perform end diff --git a/spec/services/proforma_service/convert_exercise_to_task_spec.rb b/spec/services/proforma_service/convert_exercise_to_task_spec.rb index a8f277bb..87d90b90 100644 --- a/spec/services/proforma_service/convert_exercise_to_task_spec.rb +++ b/spec/services/proforma_service/convert_exercise_to_task_spec.rb @@ -38,7 +38,7 @@ RSpec.describe ProformaService::ConvertExerciseToTask do uuid: exercise.uuid, language: described_class::DEFAULT_LANGUAGE, meta_data: { - openHPI: { + CodeOcean: { instructions: exercise.instructions, }, }, @@ -167,7 +167,7 @@ RSpec.describe ProformaService::ConvertExerciseToTask do title: test_file.name, files: have(1).item, meta_data: { - openHPI: { + CodeOcean: { 'entry-point': test_file.filepath, 'feedback-message': 'feedback_message', }, diff --git a/spec/services/proforma_service/convert_task_to_exercise_spec.rb b/spec/services/proforma_service/convert_task_to_exercise_spec.rb index b357df01..cca0b967 100644 --- a/spec/services/proforma_service/convert_task_to_exercise_spec.rb +++ b/spec/services/proforma_service/convert_task_to_exercise_spec.rb @@ -39,7 +39,7 @@ describe ProformaService::ConvertTaskToExercise do parent_uuid: 'parent_uuid', language: 'language', meta_data: { - openHPI: { + CodeOcean: { instructions: 'instructions', }, }, @@ -233,7 +233,7 @@ describe ProformaService::ConvertTaskToExercise do test_type: 'test_type', files: test_files, meta_data: { - openHPI: { + CodeOcean: { 'feedback-message': 'feedback-message', 'testing-framework': 'testing-framework', 'testing-framework-version': 'testing-framework-version', @@ -278,7 +278,7 @@ describe ProformaService::ConvertTaskToExercise do Proforma::Test.new( files: test_files2, meta_data: { - openHPI: { + CodeOcean: { 'feedback-message': 'feedback-message', 'testing-framework': 'testing-framework', 'testing-framework-version': 'testing-framework-version', @@ -324,7 +324,7 @@ describe ProformaService::ConvertTaskToExercise do id: exercise.id, title: task.title, description: task.description, - instructions: task.meta_data[:openHPI][:instructions], + instructions: task.meta_data[:CodeOcean][:instructions], execution_environment: exercise.execution_environment, uuid: exercise.uuid, user: exercise.user, @@ -360,7 +360,7 @@ describe ProformaService::ConvertTaskToExercise do test_type: 'test_type', files: test_files, meta_data: { - openHPI: { + CodeOcean: { 'feedback-message': 'feedback-message', 'testing-framework': 'testing-framework', 'testing-framework-version': 'testing-framework-version', diff --git a/spec/services/proforma_service/export_task_spec.rb b/spec/services/proforma_service/export_task_spec.rb index 3c2b4f26..331a7ec7 100644 --- a/spec/services/proforma_service/export_task_spec.rb +++ b/spec/services/proforma_service/export_task_spec.rb @@ -30,7 +30,7 @@ describe ProformaService::ExportTask do before do allow(ProformaService::ConvertExerciseToTask).to receive(:call).with(exercise: exercise).and_return(task) - allow(Proforma::Exporter).to receive(:new).with(task: task, custom_namespaces: [{prefix: 'openHPI', uri: 'open.hpi.de'}]).and_return(exporter) + allow(Proforma::Exporter).to receive(:new).with(task: task, custom_namespaces: [{prefix: 'CodeOcean', uri: 'codeocean.openhpi.de'}]).and_return(exporter) end it do