Scripts to easily view student code in one location and track recent code submissions.
-
Create a GitHub Codespace:
- Sign in to GitHub.
- Click the green "<> Code" button at the top of this repository.
- Switch to the "Codespaces" tab.
- Click "Create codespace on main".
-
Install Live Server Extension:
- Download the "Live Server" extension.
- Refer to this slide for installation help.
-
Make Scripts Executable:
- Run the following command in the terminal to avoid permissions errors:
chmod +x *.sh
- Run the following command in the terminal to avoid permissions errors:
- Add each student's GitHub username to
list.txt, one username per line. - You can find a copyable list in the main grading or project links spreadsheet for your class.
- Run this command to clone all student repositories:
./clone-all.sh
Note: Re-run this command if new students are added to update the repositories.
- To update student code, run:
./pull-all.sh
-
Running
./pull-all.shshows which students have pushed code within the last hour. The terminal output will indicate recent commits.Example:
commits within the last hour are below: dkogler ✅ ✅ ✅ dkogler has committed today! committed at Tue Feb 20 23:19:32 2024 +0000 ✅ ✅ ✅ CooolHandLuke 🚧 🚧 🚧 CooolHandLuke has not committed within the last hour! 🚧 🚧 🚧 HolaAmigo 🚩 🚩 🚩 HolaAmigo does not have a matching github repo. Check with them to ensure they have named their repository correctly. Visit https://github.com/HolaAmigo to see their existing repositories 🚩 🚩 🚩🔥🔥🔥 Tip: Run this command at the end of a project workday to check which students haven't pushed their code. 🔥🔥🔥
- After pulling student code, you can:
- Navigate to any student's folder.
- Use Live Server to load their project.
- Use the browser console to view error messages.
- Edit student code to help them debug issues.
Note: Your changes won't affect the student's repository unless you have "Write" access.
- After making changes, revert student code to its original state by running:
./clean-all.sh
- If you see a permissions error like:
Ensure you have run the
bash: permission denied: ./pull-all.shchmodcommand from the setup section.
-
If a repository is missing, you might see:
Cloning into 'HolaAmigo'... remote: Repository not found. fatal: repository 'https://github.com/HolaAmigo/HolaAmigo.github.io/' not foundThe terminal will provide feedback with a link to the student's GitHub account.
Tip: Ensure students name their repository correctly. Re-run
./clone-all.shafter corrections.
- Create multiple
.txtfiles for different classes, named aslist____.txt(e.g.,list2.txt,list4.txt). - Use the appropriate commands with the class number:
Adjust for any class by creating a unique
./clone-all.sh 2 ./pull-all.sh 2 ./clean-all.sh 2list___.txtfile.
Note: All student repositories will be at the root level of the codespace.
- Avoid running
gitcommands directly in the codespace. - The provided scripts handle all necessary
gitcommands to track and update student work.