So, basically a user can only change the “solution” file and not the “test” file, right? Otherwise users could cheat the test runner by deleting all tests. Am I correct in assuming what which file is the “solution” file and which one is the “test” file is determined by the keys files.solution and files.test in the config.json of an exercise? (The documentation doesn’t specifically mention an impact on test runner behavior.)
The reason I’m asking because on the Rust track, the solution file editable by users is usually src/lib.rs, but now I have a use case where I would like to lock down src/lib.rs as a test file and use a different one for the users solution.
Thank you for quickly confirming if my assumption is correct
Add src/lib.rs to .files.editor so that it’s visible to people using the online editor but read only. Put some other file as the solution.
Of course for people working locally, they can edit whatever they want to, and submit any number of files. If they want to cheat, let them: they’re only cheating themselves.
The test runner just uses whatever files are in the user’s submission
Are you sure that users can submit their own tests? I tried wiping a test file and explicitly submitting that, it doesn’t work. The test runner still reports the list of failed test cases.
Either way, I guess you’re right. It’s not a big deal if users can technically cheat. Solving our exercises isn’t a competitive activity.
solution => files that are part of the solution, visible and editable
test => files that are part of the tests, not visible and not editable
This is what it’s meant to be.
In our case, if src/lib.rs must be visible but readonly, make it an editor file.
Are you sure that users can submit their own tests? I tried wiping a test file and explicitly submitting that, it doesn’t work. The test runner still reports the list of failed test cases.
I don’t recall if it now “keeps” the edited tests or if it re-replaces it with the git tests. A decision was made on that a while ago.
If you submit tests with your solution, these are stored
I don’t recall if that is now used in the test runner or no
It should not matter. If the tests are meant to be submitted and changed, it should be a solution file, not a test file