Migrated to proforma 0.6
Fixed all failing specs
This commit is contained in:
@ -63,13 +63,16 @@ module ProformaService
|
||||
id: file.id,
|
||||
title: file.name,
|
||||
files: test_file(file),
|
||||
meta_data: {
|
||||
'feedback-message' => file.feedback_message,
|
||||
}.compact
|
||||
meta_data: test_meta_data(file)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def test_meta_data(file)
|
||||
[{namespace: 'openHPI', key: 'entry-point', value: file.filepath},
|
||||
{namespace: 'openHPI', key: 'feedback-message', value: file.feedback_message}]
|
||||
end
|
||||
|
||||
def test_file(file)
|
||||
[
|
||||
task_file(file).tap do |t_file|
|
||||
|
@ -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['feedback-message']
|
||||
file.feedback_message = test_object.meta_data.detect {|meta_data| meta_data[:namespace] == 'openHPI' && meta_data[:key] == 'feedback-message' }[:value]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -9,7 +9,8 @@ module ProformaService
|
||||
|
||||
def execute
|
||||
@task = ConvertExerciseToTask.call(exercise: @exercise)
|
||||
exporter = Proforma::Exporter.new(@task)
|
||||
namespaces = [{prefix: 'openHPI', uri: 'open.hpi.de'}]
|
||||
exporter = Proforma::Exporter.new(task: @task, custom_namespaces: namespaces)
|
||||
exporter.perform
|
||||
end
|
||||
end
|
||||
|
@ -10,8 +10,9 @@ module ProformaService
|
||||
|
||||
def execute
|
||||
if single_task?
|
||||
importer = Proforma::Importer.new(@zip)
|
||||
@task = importer.perform
|
||||
importer = Proforma::Importer.new(zip: @zip)
|
||||
import_result = importer.perform
|
||||
@task = import_result[:task]
|
||||
|
||||
exercise = base_exercise
|
||||
exercise_files = exercise&.files&.to_a
|
||||
|
Reference in New Issue
Block a user