When importing a ProFormA task that contains a test but without a test file or alternatively a model solution without a model solution file, CodeOcean throws an error.
Most likely, the error is caused through these two lines:
|
task_files.delete(test_object.files.first.id).tap do |file| |
|
task_files.delete(model_solution_object.files.first.id).tap do |file| |
Here, we are accessing the ID of the first file for both, but don't handle the case where no file exists.
When importing a ProFormA task that contains a test but without a test file or alternatively a model solution without a model solution file, CodeOcean throws an error.
Most likely, the error is caused through these two lines:
codeocean/app/services/proforma_service/convert_task_to_exercise.rb
Line 68 in 1e08f2c
codeocean/app/services/proforma_service/convert_task_to_exercise.rb
Line 79 in 1e08f2c
Here, we are accessing the ID of the first file for both, but don't handle the case where no file exists.