change namespace to CodeOcean
This commit is contained in:
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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',
|
||||
},
|
||||
|
@ -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',
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user