Skip to content

Conversation

@jovnc
Copy link
Collaborator

@jovnc jovnc commented Jan 15, 2026

Fixes git-mastery/exercises#240

Currently, we use base-files for answers.txt file, but we don't reset these base files in progress reset. This missing behaviour leads to unexpected results, where students expect progress reset to reset their answers.txt file, but it is not reset, ie. it is not an entirely clean state as students would expect.

This change adds an additional step in progress reset to re-download base files as well to ensure comprehensiveness in progress reset, to ensure that the exercise is reset fully.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds functionality to re-download base files during progress reset operations to ensure that files like answers.txt are properly reset to their original state, addressing issue #240.

Changes:

  • Added import for Path from pathlib module
  • Implemented base files re-download logic within the progress reset flow
  • Added directory creation and binary file type detection for downloaded base files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

with ExercisesRepo() as repo:
formatted_exercise_name = exercise_config.formatted_exercise_name

if len(exercise_config.base_files) > 0:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Even repo_type ignore may have base files we want to restore to original state

@jovnc jovnc requested a review from woojiahao January 17, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

progress reset doesn't work for exercise with Q&A grading

1 participant