ProFormA: refactor filename-gather-method

Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>
This commit is contained in:
kkoehn
2023-11-16 22:43:42 +01:00
committed by Sebastian Serth
parent 3f8f4cee5b
commit 122580b220

View File

@ -139,11 +139,12 @@ module ProformaService
end end
def task_files_meta_data def task_files_meta_data
# TODO: refactor?
task_files_hash = { task_files_hash = {
'@@order' => exercise_files.map {|file| "CodeOcean:CO-#{file.id}" }, '@@order' => [],
} }
exercise_files.each do |file| exercise_files.each do |file|
task_files_hash['@@order'] << "CodeOcean:CO-#{file.id}"
task_files_hash["CodeOcean:CO-#{file.id}"] = { task_files_hash["CodeOcean:CO-#{file.id}"] = {
'@@order' => ['CodeOcean:role'], '@@order' => ['CodeOcean:role'],
'CodeOcean:role' => { 'CodeOcean:role' => {
@ -152,6 +153,7 @@ module ProformaService
}, },
} }
end end
task_files_hash task_files_hash
end end