In-Class Activity Instructions
Introduction
Pair programming approach will be used when working on the in-class activities. Pair programming is an approach where two students work together at one computer and roles typically switched frequently allowing both students to contribute actively and learn from each other 1.
The two roles in pair programming are usually called driver and navigator. The driver actively writes code while the navigator reviews code as it is typed and focuses on the bigger picture, offering suggestions and identifying potential errors.
Some of the benefits of pair programming are fewer code errors, better code quality, faster learning, and communication growth. Although the pair programming approach will be used when working on the in-class activities, each student will have their own repository.
Procedure
Below are the steps necessary to work on and submit in-class activities:
1️⃣ Clone Repository
[This step needs to be done only once.] Your in-class activities should be added to your portfolio repository you cloned when preparing for class (GDoc). If you have not cloned your portfolio already, do so before proceeding by following the instructions in preparing for class (GDoc).
2️⃣ Open as Project
Your portfolio repository should be opened in RStudio as a project. How? Check the upper-right corner of RStudio, if your portfolio repository name is shown there, your are good to go. Otherwise, open GitHub Desktop –> from dropdown menu located on the top-left corner, select your portfolio repository if not selected –> Repository menu –> select Show in Explorer/Finder → double-click the file ending in Rproj
3️⃣ Add Files to Repository
Only if the in-class activity does not have specific instructions, follow the steps below to add the in-class activity file to your portfolio:
- Download the ICA Template file linked at the bottom of the Table of Content of the in-class activity page
- Move the file to the
src\ica\
folder (Open RStudio –> File pane –> click the gear icon –> select Show Folder in New Window –> move the file to the correct location) - Open the
_quarto.yml
file (Open RStudio –> File pane –> click the R icon in the top-right corner –> open the file) - Add the name of ICA Template file to the
_quarto.yml
file under the In-Class Activities section–notice how the sample files are listed. This step ensures that the activity appears in your portfolio website when published.
4️⃣ Solve, Commit, Push
Open the ICA Template file and work on the activity. After finishing a coherent part, it is recommended to back it up to GitHub. To do so, open GitHub Desktop –> make sure your portfolio repository is currently selected (How? The name of your portfolio show appear on the top-left corner of GitHub Desktop) –> select the files that you would like to commit –> in the message textbox, write a meaningful message starting with a present tense verb, eg, Complete exercise 1 –> click the commit button –> click the push button. When done and ready for grading, commit your last edits with a message that say something like ICA1 ready for grading then push it.
5️⃣ Publish Website
Pushing your code to GitHub will not automatically update your online portfolio website. Before re-publishing your online portfolio website, it is a good idea to preview it locally. To do so, open the Build pane –> click Render Book and wait for your portfolio website to show. Inspect the generated website and if satisfied, follows do these steps: open RStudio –> open Terminal pane (if the terminal is hidden, click Tools –> Terminal –> New Terminal) –> type quarto publish gh-pages --no-browser
–> a message will appear, type Yes (or simply hit Enter) to confirm. If the File Deleted dialog pops up, click Yes. Wait till the operation finished. A URL to your published portfolio website will appear if the publishing was successful. Click the URL to visit your published portfolio website–you may need to refresh the page several times in order to see the new changes.
For more information, see Pair Programming: Best Practices and Tools article by DEV↩︎