Lesson 03: How Computers Work (Slides)
Please review the following resources before lecture:
- Exploring How Computers Work (Video)
- What does what in your computer? Computer parts Explained (Video)
- Review important reminders below.
- Create new quiz questions.
- Do pre-work for lesson 04.
- Make sure to sync your fork before creating a branch in order to pull in the latest changes.
- Sync your branch often to avoid merge conflicts and execute
git pull
to bring the latest changes to your machine. - If your branch is too far behind or you run into too many issues, feel free to delete and re-create your repository. Make sure to review the article linked at the bottom of the lesson_00 README for instructions on how to create your fork and branch properly.
- Remember, you should not reuse a branch you've used to submit a pull request. If you need to make changes, create a new branch and work from there after you've updated your fork to the latest.
Now's your chance to quiz the instructor! In this assignment, you will modify the quiz project to include three quiz questions based on the content you've learned in this course so far. Feel free to choose any topic for your questions.
- Navigate to the quiz directory and install the required dependencies.
cd lesson_03/quiz
npm install --prefix ../../lib/javascript/codedifferently-instructional
npm install
npm start
- You will create a quiz file in the quizzes folder. You should model yours after the example provided in anthony_mays_quiz.ts. Note that the name of the file you create should match the name of the class in the file.
- Make sure to provide a unique provider name for your questions provider. You'll need this name to provide answers in step 5.
getProviderName(): string {
return '<your unique name goes here>';
}
- Make at least three questions for your quiz and leave them unanswered.
- To provide answers, you will need to update the quiz.yaml file in the test directory. You can copy the example in the file to get started, but you must provide your own answers. To generate an encrypted answer, use bcrypt.online.
- Lastly, you'll need to modify the quizzes.module.ts file to include your quiz.
- Before attempting to submit your quiz, make sure to run the linter on the code and run the tests to ensure that you've updated things correctly. The commands must be run from the quiz sub-folder just like the previous assignment:
npm run check
- Once everything passes, submit a PR.
**Note: If you want to check that you've encoded your answers correctly, you can update you quiz with the real answers and then run the tests using the command below.
PROVIDER_NAME=<Your provider name here> npm run test
Since everyone needs to modify the same files for this assignment, you will most certainly encounter merge conflicts. To resolve this, here are the steps:
- Sync the main branch of your fork and ensure that it is up-to-date.
- Use
git checkout main
andgit pull
to get the latest updates pulled down to your computer. - Checkout your feature branch (e.g.
git checkout feature/lesson_03
). - Run
git rebase main
on your feature branch to pull in the latest changes and deal with merge conflicts. - Use the Source Control view in VS Code to identify files with conflicts. Click to open them and use the Merge Editor to resolve conflicts.
- Stage and commit the changed files.
- Repeat steps 5-6 until the rebase is complete.
An alternative approach is to open the PR and manually edit the conflicting files to work out any issues. This may be easier for some of you, but it can also be tricky to do if you don't know what you're doing.
Check out this YouTube video for a quick explaination of what's going on.