Giter Site home page Giter Site logo

cyf-quiz's Introduction

Installation

  1. Follow the instructions to fork & clone the GitHub repo
  2. Install the dependencies by running npm install
  3. Launch server using npm start
  4. It should automatically open http://localhost:3000/

Exercises

You don't have to do all these exercises, just get started on them and see how many you manage.

  1. Clicking on an answer should trigger the callback function.

  2. The container component should use state to record the answers (whether they are true or false)

  3. The app should fetch questions from the open trivia database API

  4. Follow this link to the Trivia API. Play around with the number of questions, category and difficulty. Click Generate API URL, use this URL in your fetch function and see how your app changes.

  5. Create a score component that shows how many questions you got right.

  6. (optional) Try changing the setting to 'Multiple Choice' rather than true or false. We are now re-using the <button> element in src/components/Question.js a lot, so we should extract it to be it's own separate component

  7. Each question should give an indication whether it was answered correctly or incorrectly - dynamically add a className to the button component after it is clicked. Then you can for example change the background-color of the component in the CSS file.

  8. (optional) Create a button at the bottom of the page that says New Questions. When clicking it should fetch more questions.

  9. Use PropTypes for all of the props in your Question component

cyf-quiz's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.