Skip to content

Import task: Handle exercises without tests / model solution files #2503

Open
@MrSerth

Description

@MrSerth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugrubyPull requests that update Ruby code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions