ivinapontes / react-quiz

CYF React module quiz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React quiz

Set up

  1. Fork the CodeYourFuture repo by clicking the button in the top right
  2. You will be taken to https://github.com/YOUR_GITHUB_USERNAME/react-quiz
  3. Click the "Clone or download" button and copy the URL
  4. Run git clone URL_YOU_COPIED in the terminal
  5. Run cd react-quiz to move into the folder you just created
  6. Run npm install to install dependencies.

If you are having trouble with your computer running the application, then you can use this CodeSandbox instead. Remember to click the "Fork" button before you start.

Answering questions

Complete the exercises in the src folder. There is a separate file (named QuestionX-NAME.js) for each question.

To see the app in your browser, run npm start and it should open it in your browser once it is running. If you need to stop running, then hit Ctrl-C.

There are also some tests provided for you. See the Using the tests section below.

You should work on individually on your own computer. Referring to course material or anything else on the Internet is ok. Remember to read the questions and error messages carefully!

The completed app will look something like this in your browser:

Completed app

Using the tests

We have provided some unit tests (see src/__tests__/Quiz.test.js) to help you along. To run the tests (after you've npm installed), run npm test. This will put you in "watch mode".

Hit a to run all of the tests.

Currently only the test for Question 1 is running - delete the .skip before each other question's tests as you get to it, i.e. change:

describe.skip("Question 2 - LionsExhibit", () => {

to:

describe("Question 2 - LionsExhibit", () => {

Each question may have multiple tests - try to get them all to pass before moving on.

When time's up

If you have been using the CodeSandbox version, then post the link to your forked CodeSandbox in Slack.

About

CYF React module quiz


Languages

Language:JavaScript 96.0%Language:HTML 4.0%