├── .canvas ├── .github └── workflows │ └── canvas-sync-ruby-update.yml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── package-lock.json ├── package.json └── test └── indexTest.js /.canvas: -------------------------------------------------------------------------------- 1 | --- 2 | :lessons: 3 | - :id: 224860 4 | :course_id: 6602 5 | :canvas_url: https://learning.flatironschool.com/courses/6602/assignments/224860 6 | :type: assignment 7 | - :id: 225009 8 | :course_id: 4430 9 | :canvas_url: https://learning.flatironschool.com/courses/4430/assignments/225009 10 | :type: assignment 11 | -------------------------------------------------------------------------------- /.github/workflows/canvas-sync-ruby-update.yml: -------------------------------------------------------------------------------- 1 | name: Sync with Canvas Ruby v2.7 2 | 3 | on: 4 | push: 5 | branches: [master, main] 6 | paths: 7 | - 'README.md' 8 | 9 | jobs: 10 | sync: 11 | name: Sync with Canvas 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | 18 | - name: Set up Ruby 19 | uses: ruby/setup-ruby@v1 20 | with: 21 | ruby-version: 2.7 22 | 23 | - name: Install github-to-canvas 24 | run: gem install github-to-canvas 25 | 26 | # Secret stored in learn-co-curriculum Settings/Secrets 27 | - name: Sync from .canvas file 28 | run: github-to-canvas -a -lr 29 | env: 30 | CANVAS_API_KEY: ${{ secrets.CANVAS_API_KEY }} 31 | CANVAS_API_PATH: ${{ secrets.CANVAS_API_PATH }} 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/node 2 | 3 | .DS_Store 4 | 5 | ### Node ### 6 | # Logs 7 | logs 8 | *.log 9 | npm-debug.log* 10 | 11 | # Runtime data 12 | pids 13 | *.pid 14 | *.seed 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directories 23 | node_modules 24 | jspm_packages 25 | 26 | # Optional npm cache directory 27 | .npm 28 | 29 | # Optional REPL history 30 | .node_repl_history 31 | 32 | # Learn-specific .results.json 33 | .results.json -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Learn.co Curriculum 2 | 3 | We're really excited that you're about to contribute to the 4 | [open curriculum](https://learn.co/content-license) on 5 | [Learn.co](https://learn.co). If this is your first time contributing, please 6 | continue reading to learn how to make the most meaningful and useful impact 7 | possible. 8 | 9 | ## Raising an Issue to Encourage a Contribution 10 | 11 | If you notice a problem with the curriculum that you believe needs improvement 12 | but you're unable to make the change yourself, you should raise a Github issue 13 | containing a clear description of the problem. Include relevant snippets of the 14 | content and/or screenshots if applicable. Curriculum owners regularly review 15 | issue lists and your issue will be prioritized and addressed as appropriate. 16 | 17 | ## Submitting a Pull Request to Suggest an Improvement 18 | 19 | If you see an opportunity for improvement and can make the change yourself go 20 | ahead and use a typical git workflow to make it happen: 21 | 22 | * Fork this curriculum repository 23 | * Make the change on your fork, with descriptive commits in the standard format 24 | * Open a Pull Request against this repo 25 | 26 | A curriculum owner will review your change and approve or comment on it in due 27 | course. 28 | 29 | # Why Contribute? 30 | 31 | Curriculum on Learn is publicly and freely available under Learn's 32 | [Educational Content License](https://learn.co/content-license). By embracing an 33 | open-source contribution model, our goal is for the curriculum on Learn to 34 | become, in time, the best educational content the world has ever seen. 35 | 36 | We need help from the community of Learners to maintain and improve the 37 | educational content. Everything from fixing typos, to correcting out-dated 38 | information, to improving exposition, to adding better examples, to fixing 39 | tests—all contributions to making the curriculum more effective are welcome. 40 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # Learn.co Educational Content License 2 | 3 | Copyright (c) 2015 Flatiron School, Inc 4 | 5 | The Flatiron School, Inc. owns this Educational Content. However, the Flatiron 6 | School supports the development and availability of educational materials in the 7 | public domain. Therefore, the Flatiron School grants Users of the Flatiron 8 | Educational Content set forth in this repository certain rights to reuse, build 9 | upon and share such Educational Content subject to the terms of the Educational 10 | Content License set forth [here](http://learn.co/content-license) 11 | (http://learn.co/content-license). You must read carefully the terms and 12 | conditions contained in the Educational Content License as such terms govern 13 | access to and use of the Educational Content. 14 | 15 | Flatiron School is willing to allow you access to and use of the Educational 16 | Content only on the condition that you accept all of the terms and conditions 17 | contained in the Educational Content License set forth 18 | [here](http://learn.co/content-license) (http://learn.co/content-license). By 19 | accessing and/or using the Educational Content, you are agreeing to all of the 20 | terms and conditions contained in the Educational Content License. If you do 21 | not agree to any or all of the terms of the Educational Content License, you are 22 | prohibited from accessing, reviewing or using in any way the Educational 23 | Content. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Complete Your First Software Engineering Assignment 2 | 3 | ## Learning Goals 4 | 5 | - Understand the steps needed to complete an assignment 6 | - Submit assignments in Canvas through CodeGrade 7 | 8 | ## Introduction 9 | 10 | During this course, you will work on various assignments as you learn to code. 11 | All assignments will be interactive pieces of curriculum that require some work. 12 | Some assignments may ask you to follow a set of instructions, while others will 13 | ask you to figure out your own solution to pass specific tests. This lesson is 14 | your first assignment! 15 | 16 | All assignments are hosted on GitHub. In order to work on them, however, you 17 | will need to complete work on your local machine. Once you're done, you will 18 | submit your assignment to Canvas using a platform called CodeGrade. 19 | 20 | The general process is: 21 | 22 | - Click the GitHub logo button (the 'OctoCat') in Canvas; we will show you 23 | exactly which button this is soon. 24 | - Create a personal copy (a 'fork') of the assignment into your GitHub account. 25 | - Download your personal copy to your computer (referred to as 'cloning'). 26 | - Complete the required work. 27 | - Push your completed code back up to your GitHub repo. 28 | - Submit your completed work in Canvas through the CodeGrade window. 29 | 30 | In this assignment, you'll learn the workflow that you will be using to complete 31 | your assignments and submit them using CodeGrade. 32 | 33 | ## Completing and Submitting Assignments 34 | 35 | 36 | 37 | ### A Quick Note on Organizing Work on Your Machine 38 | 39 | Throughout this course, you will be downloading many assignments, so it is 40 | important to keep your code organized. If you haven't yet, we recommend that you 41 | go through the steps in 42 | [the previous lesson](https://github.com/learn-co-curriculum/phase-0-organizing-work-on-your-computer) 43 | to set up a directory where you can keep all of your work for this course. 44 | 45 | > **Note:** The process we'll go through in this lesson will create sub-folders 46 | > automatically. Whenever you are starting a new assignment, navigate back to 47 | > your main `se-prep` folder (`cd ~/Development/code/se-prep`) before cloning 48 | > the assignment to ensure these sub-folders don't get created _within each 49 | > other_. 50 | 51 | ### Accessing GitHub and Forking 52 | 53 | All the lessons in this course have a corresponding repository (repo) in GitHub. 54 | On this page in Canvas, you should see two icons in the **upper right** corner. 55 | The first is the GitHub logo, also known as OctoCat. 56 | 57 | ![Screenshot pointing to OctoCat icon](https://curriculum-content.s3.amazonaws.com/phase-0/completing-assignments/octocat-icon.png) 58 | 59 | Clicking the OctoCat icon will open the lesson's GitHub repo. The second icon is 60 | a flag, which you can use to submit an _issue_ for the lesson (e.g., if you find 61 | a typo or other error). 62 | 63 | To fork an assignment, click the **OctoCat** button to open its GitHub repo. In 64 | the top right corner of the repo, you should see a button that says **Fork**. 65 | 66 | ![Screenshot point out 'Fork' button](https://curriculum-content.s3.amazonaws.com/phase-0/completing-assignments/fork-button.png) 67 | 68 | Click on that, and you should get a screen that looks something like this: 69 | 70 | ![Screenshot of the 'Create a new fork' form](https://curriculum-content.s3.amazonaws.com/phase-0/completing-assignments/fork-page.png) 71 | 72 | In the **Owner** dropdown, select your GitHub username, then click the **Create 73 | fork** button. 74 | 75 | Forking is a process which creates an exact copy of a collection of code and 76 | files. Once you've created a fork on your own GitHub account, you will be able 77 | to edit the files in the repository and write your own code solution without 78 | interfering with the original copy. 79 | 80 | Once your fork is ready, the next step is to download (**clone**) your new 81 | repository to your local machine. 82 | 83 | ### Cloning to Your Local Machine 84 | 85 | To download the repository for this lesson, first make sure you're in your 86 | personal fork on GitHub. You can check this by looking in the top left of the 87 | GitHub repository, where it shows the name. 88 | 89 | ![Screenshot showing example of forked repo](https://curriculum-content.s3.amazonaws.com/phase-0/completing-assignments/forked-repo.png) 90 | 91 | If you see your GitHub username before the name of the repo, 92 | phase-0-completing-assignments-codegrade, as well as a subtitle saying "forked 93 | from ...", then you are in the right place. 94 | 95 | Once you're in your forked version of the repo, click the **Code** button. A 96 | pop-up will appear which shows several options for cloning: **HTTPS**, **SSH**, 97 | and **GitHub CLI**. **Before doing anything else**, be sure to switch to 98 | **SSH**. With **SSH** selected, you should see what looks sort of like an email 99 | in the box below, starting with `git@github.com:`. You should see your GitHub 100 | name after the `:`. 101 | 102 | From here, click the copy button. 103 | 104 | ![clone-repo](https://curriculum-content.s3.amazonaws.com/phase-0/completing-assignments/clone-repo.gif) 105 | 106 | Now, open your terminal and navigate to where you'd like to download the 107 | assignment (e.g. `cd ~/Development/code/se-prep`). Type `git clone` and a space, 108 | then paste in the copied SSH link from GitHub. It should look something like 109 | this: 110 | 111 | ```console 112 | $ git clone git@github.com:your-github-username/phase-0-completing-assignments-codegrade.git 113 | ``` 114 | 115 | Press enter, and you should see a flurry of terminal activity. 116 | 117 | Once the terminal gives you control to type again, a new folder with the GitHub 118 | name of the assignment will have been created. Change directory into this folder 119 | to access the assignment files. 120 | 121 | ```console 122 | $ cd phase-0-completing-assignments-codegrade 123 | ``` 124 | 125 | Now type `code .` (assuming you're using Visual Studio Code as your text editor) 126 | to open up a text editor window with access to all of the assignment's files. 127 | These instructions are now also available on your local machine in `README.md`. 128 | 129 | > Note: the first time you open a directory in Visual Studio Code, you'll see a 130 | > message asking "Do you trust the authors of the files in this folders?" This 131 | > is a [security feature][workspace-trust] of Visual Studio Code. It's safe to 132 | > choose "Yes", and we recommend selecting the "Trust the authors of all the 133 | > files in the parent folder" option to prevent this warning from coming up 134 | > every time you open a lesson. Just be sure to download your code from trusted 135 | > sources! 136 | 137 | [workspace-trust]: https://code.visualstudio.com/docs/editor/workspace-trust 138 | 139 | ### Working on an Assignment 140 | 141 | Most assignments will have tests that check your work and provide immediate 142 | feedback in the terminal. We'll walk through some examples in upcoming lessons. 143 | 144 | This assignment has two tests. The first checks to see if you've correctly 145 | cloned this assignment to your local machine. If you've followed the steps 146 | above, you've completed everything you need to do to pass the first test. Now, 147 | we need to run the tests and find out what the second one is. 148 | 149 | First, run `npm install` in the terminal to install the tools necessary to run 150 | the tests. You should again see a flurry of text as dependencies are installed. 151 | 152 | > **Note**: You may get a warnings or a message from the terminal saying there 153 | > are vulnerabilities, **these are okay to ignore** - they are normal! You 154 | > **should not** run the audit command the terminal provides you with as it will 155 | > change the versions of the node dependencies for a lesson, which we do _not_ 156 | > want to do. 157 | 158 | Once the installations are complete, run `npm test` in the terminal. You should 159 | see the results of your tests. By cloning this assignment down, you've already 160 | passed one test! 161 | 162 | ```console 163 | This assignment 164 | ✓ has been correctly cloned to your local environment 165 | 1) has a file named myfile.md 166 | 167 | 1) This assignment 168 | has a file named myfile.md: 169 | AssertionError: No file named 'myfile.md' found. Create one in the root of the assignment's directory: value: expected './myfile.md' to exist 170 | 171 | 1 passing (5ms) 172 | 1 failing 173 | ``` 174 | 175 | > **Note:** If you got a "command not found" error, or a different error aside 176 | > from the AssertionError shown above, go back to the Node.js installation 177 | > lesson for your OS. Go through the steps provided there to make sure Node was 178 | > installed correctly. If you're still receiving different errors, we recommend 179 | > going back through all local environment setup instructions again to ensure 180 | > everything is set up properly. 181 | 182 | Although you passed one test, there is still one test not passing. The terminal 183 | gave us a detailed "AssertionError" saying why we did not pass the test: 184 | 185 | ```console 186 | 1) This assignment 187 | has a file named myfile.md: 188 | AssertionError: No file named 'myfile.md' found. Create one in the root of the assignment's directory: value: expected './myfile.md' to exist 189 | ``` 190 | 191 | We can use this error to figure out what we need to do to pass it. In this case, 192 | we just need to create a file called `myfile.md` inside the assignment 193 | directory. Let's create it with the CLI commands we just learned. 194 | 195 | In the terminal, make sure you're in the root of the assignment directory 196 | (`phase-0-completing-assignments-codegrade`). You can check this with `pwd`. If 197 | you're in the correct directory, the output should look like: 198 | 199 | ```console 200 | $ pwd 201 | /Users//Development/code/se-prep/phase-0-completing-assignments-codegrade 202 | ``` 203 | 204 | If you're not already in the root, `cd` into it. 205 | 206 | ```console 207 | $ cd phase-0-completing-assignments-codegrade 208 | ``` 209 | 210 | Then use the `touch` command to create `myfile.md`. 211 | 212 | ```console 213 | $ touch myfile.md 214 | ``` 215 | 216 | To make sure it was created successfully in the correct area, use the `ls` 217 | command. The output should look like: 218 | 219 | ```console 220 | $ ls 221 | CONTRIBUTING.md README.md node_modules package.json 222 | LICENSE.md myfile.md package-lock.json test 223 | ``` 224 | 225 | When you run `npm test` in the terminal again, both tests should now be passing! 226 | 227 | ```console 228 | This assignment 229 | ✓ has been correctly cloned to your local environment 230 | ✓ has a file named myfile.md 231 | 232 | 233 | 2 passing (4ms) 234 | ``` 235 | 236 | This is the general workflow you will follow when working on assignments with 237 | tests: 238 | 239 | 1. **Fork** the assignment repo to your GitHub account, then **clone** it down 240 | to your machine. 241 | 2. Install the tools needed for the test by running `npm install` (or `npm i`) 242 | in the terminal. 243 | 3. Run `npm test` initially to see what tests you need to pass. 244 | 4. Work on the assignment with those tests in mind. 245 | 5. As you work, run `npm test` in the terminal as many times as you'd like to 246 | test your code. 247 | 6. Once all your tests are passing, it's time to submit your assignment - or is 248 | it? 249 | 250 | ### Pushing your Changes to GitHub 251 | 252 | If you go to your **forked** version of the assignment on GitHub, you'll see 253 | that the `myfile.md` file you created is not there. Notice in the screenshot 254 | below, for example, `myfile.md` exists in the local VS Code editor, but not 255 | anywhere in the forked GitHub repo. 256 | 257 | ![Screenshot showing myfile.md in VS Code, but not in GitHub](https://curriculum-content.s3.amazonaws.com/phase-0/completing-assignments/myfile.png) 258 | 259 | This is because you only made the change on your _local clone_. Changes that you 260 | make on a locally cloned repository are not automatically synced to the repo up 261 | on GitHub. You have to manually sync the changes. This is a good thing; it gives 262 | you more control over what changes get "pushed" up to the GitHub repo and when. 263 | 264 | The process requires three terminal commands: 265 | 266 | 1. `git add` 267 | 1. `git commit` 268 | 1. `git push` 269 | 270 | We will learn about these commands in far more detail in two lessons near the 271 | end of the SE Prep course: [Git Basics][basics] and [Pushing Code with 272 | Git][pushing-with-git]. For now, we'll just cover the surface basics that will 273 | allow you to turn in your assignments. If you have questions about these git 274 | commands, however, you are free to refer to those later lessons. 275 | 276 | [basics]: 277 | https://github.com/learn-co-curriculum/phase-0-git-version-control-basics 278 | [pushing-with-git]: 279 | https://github.com/learn-co-curriculum/phase-0-git-pushing-code 280 | 281 | These commands should be run in the terminal within the directory with changes 282 | to push. For example with this assignment, you should be running the following 283 | commands within the `phase-0-completing-assignments-codegrade` directory. 284 | 285 | #### Track changes with `git add` 286 | 287 | This command lets us tell git what changes and files we want to sync within a 288 | repo. You can specify certain files to track, or you can track all files at once 289 | that have changes to sync. 290 | 291 | To track specific files, you just need to add the file names as arguments. For 292 | example: 293 | 294 | ```bash 295 | git add file1.md file2.md 296 | ``` 297 | 298 | To track all files at once, you can use a period as an argument instead `.`: 299 | 300 | ```bash 301 | git add . 302 | ``` 303 | 304 | Let's go ahead and track our change by using the `git add .` shortcut. 305 | 306 | #### Save changes with `git commit` 307 | 308 | Once you've tracked all the changes you want to save with `git add`, the next 309 | step is to save all those changes at once. This is done with `git commit`. To 310 | make a commit, the command is: 311 | 312 | ```bash 313 | git commit -m "short message briefly explaining the changes saved in this commit" 314 | ``` 315 | 316 | Any time you commit something, you should include a message with it to explain 317 | what changes are actually in the commit. These messages should be one line and 318 | short. The `-m` flag says we want to add one and should be followed by the 319 | message in quotes. 320 | 321 | Let's commit our tracked change. In the terminal, run: 322 | 323 | ```bash 324 | git commit -m "creates myfile.md" 325 | ``` 326 | 327 | #### Push changes with `git push` 328 | 329 | We've now tracked and saved our changes - but they're _still_ not up on the 330 | GitHub repo. That's because we haven't told Git where we want these saved 331 | changes to go. We need to do so with `git push`. The full command is: 332 | 333 | ```bash 334 | git push 335 | ``` 336 | 337 | We will learn what a **remote** and **branch** are in greater detail later on. 338 | 339 | For now, consider the remote as the repository that is on GitHub — in this case, 340 | the copy of the assignment that you forked into your GitHub account earlier. 341 | 342 | It would be tedious if we had to copy and paste the entire repository link every 343 | time we want to push a change, however. Instead, these remotes use aliases that 344 | point to the URL. When cloning a repository down to your machine, an alias gets 345 | automatically created for you called `origin`, which is the remote we will push 346 | to. 347 | 348 | You can see this yourself by running the command `git remote -v` in the 349 | terminal. This will list the remotes your repository has. This is also a good 350 | way to verify that you are pushing your changes to **your fork** of the 351 | assignment 352 | 353 | Then consider a branch as the version of the code you want to push the changes 354 | to. In most cases, this branch will be called `main` or `master` for older 355 | repositories. You can check what branch your repository uses by using the 356 | command `git branch`, which will list all the branches your repository has. For 357 | this assignment, it should be `main`. 358 | 359 | Putting that all together, we can now completely fill out the `git push` command 360 | and push our changes up: 361 | 362 | ```bash 363 | git push origin main 364 | ``` 365 | 366 | Now, finally, when you load your forked version of the assignment on GitHub, you 367 | should see the `myfile.md` file! With all your work now available on GitHub, you 368 | can submit the assignment. 369 | 370 | **Note:** It is a good habit to get into to go to your repo on GitHub after you 371 | push to verify that it completed successfully. 372 | 373 | ### Submitting an Assignment on CodeGrade 374 | 375 | **Note**: Before continuing with the steps below, make sure that you're logged 376 | in to your GitHub account. 377 | 378 | To submit your work for grading, head back to the assignment on Canvas and 379 | scroll down to the bottom of the page. There, you should see a button that says 380 | "Load Complete Your First Software Engineering Assignment in a new window". 381 | 382 | ![Load Complete Your First Software Engineering Assignment in a new window button](https://curriculum-content.s3.amazonaws.com/phase-0/completing-assignments/open-codegrade-btn.png) 383 | 384 | Click on that button, and a new window of the CodeGrade interface should open 385 | up. As you haven't submitted an assignment for this lab yet, click on the 386 | "Create submission" button. On the next page that opens, click on the "GitHub" 387 | button. A GitHub screen will open asking you to authorize CodeGrade. (Note: you 388 | should only have to do this step the first time you create a submission.) Once 389 | CodeGrade is authorized, as long as you're logged in to GitHub, CodeGrade should 390 | be connected to your account. 391 | 392 | ![Gif showing the CodeGrade interface, creating a submission, and connecting to GitHub](https://imgur.com/aXVrPtW.gif) 393 | 394 | Once your GitHub account is connected, you should see a list of your repos in 395 | the CodeGrade window. Find the repo that matches the assignment you're 396 | submitting, in this case `phase-0-completing-assignments-codegrade`, and click 397 | the blue "Connect" button. 398 | 399 | When CodeGrade finishes connecting the repo, it should show you a success 400 | message with a link to view your submission. Click on that link. 401 | 402 | ![Gif showing how to connect a GitHub repo on CodeGrade](https://imgur.com/8hLcb3O.gif) 403 | 404 | On this new page, there are three different tabs: Code, Feedback Overview, and 405 | AutoTest. 406 | 407 | The _Code_ tab is as it sounds, all the code you submitted. The _Feedback 408 | Overview_ is where you can see feedback on your work from instructors if they've 409 | provided any. 410 | 411 | The _AutoTest_ tab is what we'll focus on in this lesson. This tab is what runs 412 | the test that automatically grades your work. It will take some time, and you 413 | can see the progress in the small box on the right side of the Setup section. 414 | When it's done, it will say "Done" and your score will update in the Automatic 415 | Tests section. 416 | 417 | ![Gif showing the AutoTest running and completing](https://imgur.com/G5pzKwr.gif) 418 | 419 | If you don't pass, don't fret, you can still fix it! You can click on the 420 | test(s) within the Automatic Tests section to see which ones failed. Then, you 421 | can fix those errors within your local version of the repo, and go through the 422 | process of using `git add`, `git commit`, and `git push` to push your changes. 423 | CodeGrade will then automatically re-run the test when it detects changes have 424 | been made to the GitHub repo. 425 | 426 | To see the results after you've already made the initial submission, navigate 427 | back to CodeGrade through the button on Canvas. Instead of on "Create 428 | submission", click on the "Latest submission" button to get taken back to the 429 | AutoTest page. 430 | 431 | ![Gif showing how to navigate back to AutoTest via the Latest submission button](https://imgur.com/iDeIorX.gif) 432 | 433 | Once your tests are all passing in CodeGrade, you are good to go. You can close 434 | the CodeGrade window and move on to the next lesson. 435 | 436 | Whew, that was a lot. While it will take some time in the beginning, the more 437 | assignments you complete and submit, the easier the process should become. If 438 | you ever forget a step, that's OK. Come back to this lesson as many times as you 439 | need until it becomes second nature. 440 | 441 | ## Troubleshooting 442 | 443 | Errors and mistakes can happen, and this section will cover some common ones. If 444 | your problem is not listed here, please check with an instructor or technical 445 | coach for guidance. 446 | 447 | ### I got an error when I tried to clone a lab down to my Mac 448 | 449 | If you are a Mac user and you see the following message: 450 | 451 | ```console 452 | xcrun: error: invalid active developer path 453 | ``` 454 | 455 | You need to install the Xcode Command Line Tools. Run the following command to 456 | install them: 457 | 458 | ```console 459 | $ xcode-select --install 460 | ``` 461 | 462 | And follow the prompts. Then try running the `git clone` command again. See 463 | [this Stack Overflow post](https://stackoverflow.com/a/52522566) for more 464 | details. Note that you may need to re-install `xcode-select` any time you update 465 | your Mac OS version. 466 | 467 | ### I wasn't able to connect CodeGrade to my GitHub account 468 | 469 | First, check to make sure you're logged in to your GitHub account. Then start 470 | again from the assignment's Canvas page and repeat the steps in the "Submitting 471 | an Assignment on CodeGrade" section above. 472 | 473 | If it still does not work, try again, but instead of clicking the "GitHub" 474 | button, click the "Or manually connect your Git repository" link underneath. 475 | CodeGrade will walk you through the manual setup; be sure to read and follow 476 | their instructions carefully. 477 | 478 | ### The tests are failing in CodeGrade 479 | 480 | 1. Make sure that you've connected the correct repo to CodeGrade. You can do 481 | that by clicking on the "Code" tab in CodeGrade and verifying that the title 482 | of the lab in the README.md file matches the title in Canvas. If you've 483 | connected the wrong repo, follow the instructions in the next section. 484 | 485 | 2. Re-run the tests in your local environment to verify that they are passing. 486 | 487 | 3. Make sure that your completed code was pushed up to GitHub. To do that, 488 | navigate to your repo on GitHub and check that the latest commit is showing. 489 | If the code was not pushed to GitHub, follow the instructions in the "Pushing 490 | your Changes to GitHub" section above. Once your code is pushed up, the tests 491 | will automatically rerun in CodeGrade and the results will be updated in the 492 | AutoTest tab. To see this, navigate back to CodeGrade by clicking the button 493 | on the assignment page in Canvas, then click on the "Latest submission" 494 | button. You may also want to verify that the assignment is showing as 495 | completed in Canvas. 496 | 497 | ### I accidentally connected the wrong repository! How do I remove it and connect the correct one? 498 | 499 | To reconnect your CodeGrade assignment to a different repo, you will simply go 500 | through the submission process again and select the correct repo. When you do 501 | that, you will see a message warning you that you have already connected to the 502 | repo and asking if you want to disconnect the current repo and select a new one: 503 | 504 | ![disconnect repo button](https://curriculum-content.s3.amazonaws.com/phase-0/completing-assignments-codegrade/disconnect-repo.png) 505 | 506 | Click the "Disconnect and select new repository" button. This will return you to 507 | the list of repos where you can select the new repo to connect. 508 | 509 | > **Note**: When you first go back through the submission process, the incorrect 510 | > repo will still be under the "Latest Submissions". That is OK - it will be 511 | > overridden once you submit a new repo. 512 | 513 | The full process is: 514 | 515 | 1. Return to the lab's Canvas page and, if necessary, refresh the page to reload 516 | the CodeGrade button. 517 | 2. Click the button and, on the CodeGrade page that opens, click "Create 518 | Submission". 519 | 3. Select the new repo to connect. 520 | 4. In the page that opens, click the "Disconnect and select new repository" 521 | button. 522 | 5. Select the correct repo once again. 523 | 524 | ### I refreshed the CodeGrade page and it's asking me to log back in. What are my account details to log in? 525 | 526 | If you don't remember creating a username and password for CodeGrade, that's 527 | because you did not! To access CodeGrade, you must always do so from Canvas. 528 | 529 | To get back to the submission page for a specific assignment, return to the 530 | assignment on Canvas and click on the "Load" button at the bottom of the page 531 | again. If the button is not there due to being clicked once before, refresh the 532 | Canvas page and it should reappear. 533 | 534 | ## Types of Assignments 535 | 536 | For most assignments, you will go through the process we just walked through. In 537 | our curriculum, these assignments are often referred to as **labs** — coding 538 | lessons that include tests. There are a few other types of assignments, though, 539 | that require slightly different submission steps: 540 | 541 | - **Code-alongs:** These also require code, but will guide you through what 542 | needs to be written. There are no tests to pass, but you will still need to go 543 | through forking, cloning, pushing your changes up, and submitting the repo to 544 | CodeGrade to be marked as complete. 545 | - **Portfolio Projects:** For these assignments, you'll be building fully 546 | functional applications. Some guidelines and requirements will be provided, 547 | but it will be up to you to design and create your own app. These will 548 | eventually become the projects you showcase to potential employers! You will 549 | submit your projects in Canvas by submitting a link to your GitHub repo. 550 | - **Blog Submissions:** Blogs are a required part of our Software Engineering 551 | courses. They help to develop your online presence and are a great way to 552 | reinforce the concepts you learn. You'll write your blog posts on a different 553 | platform, but submit links to them in Canvas. 554 | 555 | ## Submitting Projects and Blogs 556 | 557 | For both portfolio projects and blog posts, you'll need to manually submit a 558 | link to your work on Canvas. While viewing the assignment, you should see a 559 | **Submit Assignment** button in the upper-right section of the page. 560 | 561 | ![submit assignment button](https://curriculum-content.s3.amazonaws.com/canvas-welcome/submit-assignment-canvas.png) 562 | 563 | Clicking this button will bring you to the bottom of the page where you can 564 | submit a URL link to your work. 565 | 566 | ![submit assignment form](https://curriculum-content.s3.amazonaws.com/canvas-welcome/submit-assignment-canvas-form.png) 567 | 568 | Upon submission you should see confetti appear, indicating that your submission 569 | has been accepted. 570 | 571 | > **Note:** It is possible to submit lab and code-along assignments manually 572 | > this way. However, the assignment will only be marked as **Submitted**, not 573 | > **Complete**. 574 | 575 | ## Conclusion 576 | 577 | Congratulations, you've completed your first assignment and submitted it to 578 | CodeGrade! You now know how to work on and submit assignments going forward: 579 | 580 | - Click the **OctoCat** button on the Canvas assignment, then the **Fork** 581 | button on the repo page. 582 | - Once the assignment is forked, clone it down to your local machine. 583 | - Run `npm install` to download the tools required to run the tests for the 584 | assignment. 585 | - Run `npm test` to see what tests you have to pass. Run the command as many 586 | times as you like to check your work as you go. 587 | - Complete any required work, then run the `git add`, `git commit`, and 588 | `git push` commands in the terminal to push your work up to GitHub. Before 589 | continuing to the next step, be sure to load your repo on GitHub and verify 590 | that the latest commit is shown. 591 | - Submit your assignment through CodeGrade by selecting your GitHub account, 592 | then connecting the appropriate repo. 593 | 594 | Equipped with this knowledge, you are now ready to tackle greater challenges! 595 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "welcome-completing-assignments", 3 | "version": "1.0.0", 4 | "description": "## Introduction", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "mocha --timeout 5000 -R mocha-multi --reporter-options spec=-,json=.results.json" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/learn-co-curriculum/welcome-completing-assignments.git" 12 | }, 13 | "author": "maxwellbenton ", 14 | "license": "ISC", 15 | "bugs": { 16 | "url": "https://github.com/learn-co-curriculum/welcome-completing-assignments/issues" 17 | }, 18 | "homepage": "https://github.com/learn-co-curriculum/welcome-completing-assignments#readme", 19 | "devDependencies": { 20 | "chai": "^3.5.0", 21 | "expect": "^1.20.2", 22 | "jsdom": "^9.2.0", 23 | "mocha": "^6.1.4", 24 | "mocha-jsdom": "~1.1.0", 25 | "mocha-multi": "^1.1.0" 26 | }, 27 | "dependencies": { 28 | "chai-fs": "^2.0.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /test/indexTest.js: -------------------------------------------------------------------------------- 1 | const jsdom = require("jsdom"); 2 | const path = require("path"); 3 | var chai = require("chai"); 4 | chai.use(require("chai-fs")); 5 | 6 | describe("This assignment", () => { 7 | it("has been correctly cloned to your local environment", () => { 8 | chai.assert.isDirectory( 9 | "./.git", 10 | 'no ".git" folder was found within "welcome-completing-assignment". Use "git init" to create one' 11 | ); 12 | }); 13 | 14 | it("has a file named myfile.md", () => { 15 | chai.assert.isFile( 16 | "./myfile.md", 17 | "No file named 'myfile.md' found. Create one in the root of the assignment's directory" 18 | ); 19 | }); 20 | }); 21 | --------------------------------------------------------------------------------