6 Assignment Submission (GitHub Classroom)
To submit an assignment on GitHub Classroom, follow these steps:
- In the
questions
directory, you will find Python files with questions and instructions. Complete the exercises in the Python files. - Test your Python code to ensure it works as expected.
- Open the Python file in Visual Studio Code.
- Run the Python file by clicking the
Run Python File in Terminal
button at the top right of the editor. - Verify that the output is correct.
- If there are tests in the folder
tests
, runpytest
(see example) in the terminal to check if your code passes the tests.
- Submit your Python code to GitHub.
- Commit your changes to the repository.
- Push your changes to the repository.
6.1 Submission Guidelines on VS Code
Once you have completed the exercises, commit the files to your GitHub repository. Follow these steps to commit your changes:
- Open the Source Control View:
- Click on the Source Control icon in the Activity Bar on the side of the window (it looks like a branch with a dot at the end).
- Alternatively, you can use the keyboard shortcut
Ctrl+Shift+G
(orCmd+Shift+G
on macOS).
- Review your changes in the Source Control view:
- Click on a file to see the changes made to that file. The changes you made will be highlighted in green (lines added) and red (lines removed).
- If you want to discard any changes, you can click the
Discard
icon (arrow pointing left) next to the file. - If you want to stage all changes, you can click the
+
icon next to the file. To βstageβ means to prepare the changes for committing (submitting) to your repository.
- Commit your changes in the Source Control view (after you have staged your changes):
- Enter a commit message in the text field at the top of the view. This message should briefly describe the changes you made so that you can remember them later.
- Click the checkmark icon at the top of the view to commit your changes (this step does not submit your changes to GitHub).
- Push (submit) your changes to GitHub:
- Click on
More Actions
(the three dots at the top of the view). - Click on
Push
to submit your changes to GitHub. - You may be prompted to sign in to GitHub if you have not done so already.
- Click on
- Verify that your changes have been submitted:
- Go to your GitHub repository in your web browser.
- Click on the
commits
link to see the commit history. - Verify that your commit is listed in the history.