Skip to content

Patch internal solution entrypoint files #211

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

Merged
merged 1 commit into from
May 19, 2021

Conversation

mikeymike
Copy link
Member

When patching a student's given solution, we also need to patch our internal solution.

This ensures that the comparison is like for like and the output solution would match what a student would have to provide.

@mikeymike mikeymike requested a review from AydinHassan May 19, 2021 20:43
$this->codePatcher->patch($event->getExercise(), $this->originalCode)
);
foreach (array_filter($files) as $fileName) {
$this->originalCode[$fileName] = (string) file_get_contents($fileName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work if the files are the same name? I think it’s using full paths right so shouldn’t matter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comes in as full paths from what I can see, so technically shouldn't matter 👍

@mikeymike
Copy link
Member Author

The CS failure looks a little annoying tbh 😂

@AydinHassan
Copy link
Member

That is annoying, you can probably just ignore it in the config file if we have one

@mikeymike
Copy link
Member Author

That is annoying, you can probably just ignore it in the config file if we have one

I thought so too at first but we don't have the config setup atm, feels too much to add just for this. In all honesty, it just messes with the mock with matcher if I change it to valid code so I could just fixup that

When patching a students given solution, we
also need to patch our internal solution.

This ensures that the comparison is like for like
and the output solution would match what a
student would have to provide
@mikeymike mikeymike force-pushed the feature/patch-internal-solution-files branch from 57af5bd to 822e306 Compare May 19, 2021 21:08
@mikeymike
Copy link
Member Author

Hopefully fixed CS issue 👍

@AydinHassan AydinHassan merged commit 4e0f419 into master May 19, 2021
@AydinHassan AydinHassan deleted the feature/patch-internal-solution-files branch May 19, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants