Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling of duplicated files in related graders #240

Open
LukasKlenner opened this issue Jun 13, 2023 · 1 comment
Open

Incorrect handling of duplicated files in related graders #240

LukasKlenner opened this issue Jun 13, 2023 · 1 comment
Labels

Comments

@LukasKlenner
Copy link
Contributor

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.

@Rdeisenroth
Copy link
Contributor

Can confirm this still exists in 0.10.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants