Skip to content

Incorrect handling of duplicated files in related graders #240

@LukasKlenner

Description

@LukasKlenner

If you have two graders where one grader depends on the other (e.q. private and public grader) in a setup like this:

graders {
        val graderPublic by creating {
            graderName.set("Public")
            rubricProviderName.set("RubricProvider-Public")
        }
        val graderPrivate by creating {
            parent(graderPublic)
            graderName.set("Private")
            rubricProviderName.set("RubricProvider-Private")
        }
    }

and two identically named files in both graders it seems to continue the grading process with the file in the child grader when executing the parent grader. If the public grader consists of the class

@TestForSubmission
public class ExampleTest {
    @Test
    public void test() {
        fail();
    }
}

the private grader of the class

@TestForSubmission
public class ExampleTest {
    @Test
    public void test() {
    }
}

and both Rubrics being

Rubric.builder()
        .title("Example")
        .addChildCriteria(Criterion.builder()
            .shortDescription("test")
            .grader(Grader.testAwareBuilder()
                .requirePass(JUnitTestRef.ofMethod(() -> ExampleTest.class.getDeclaredMethod("test")))
                .pointsPassedMax()
                .build())
            .build())
        .build()

You would expect the public grader to fail and the private grader to pass because the private grader, being the parent of the public grader, should overwrite the failing ExampleTest class of the public grader with its version of the class (which doesn't fail). But the actual behavior is that both graders fail. Renaming the ExampleTest class of the private grader leads to the expected behavior.

It seems like this bug was introduced with version 0.9.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions