Code Monkey home page Code Monkey logo

coding-quiz's Introduction

jengamez.github.io

Unit 02: CSS and Bootstrap Homework: Resonsive Portfolio

Description

This is a 60 second timed quiz on coding. I began with the simplest task, making the questions. I went through many different ways to syntax the questions, choices and answers. In the end, I decided to use the index.

I created a function for start time. Within this a setInterval () that will repeatly call a function at 1000 milliseconds. The clearInterval () is called to stop the timer when seconds equal zero.

I made an Event listener called the startTime () to begin the timer. Next the hideStartArea () is called to hide the

,

, and elements. Then the displayQuestion () is called to display the first question.

When the user clicks on one of the choices, a series of actions happens. The srcElement event references which choice was clicked on, and given the variable clickID. An answer variable was created so I can see in the console log which choice was selected. correctID variable was created to compare to the correctAnswer. If they match, then the score increments.

In the dislayQuestion () I made the h1 the question. So that the questions wouldn't show up on the page over and over, I cleared the wrapper's contents using the innerHTML property with empty quotes. The question element was appended to the parent wrapper element. I made a div for the choices element, so that I could append the buttonEl div to it. I made a for loop to loop through the questions and choices.

License

This project is licensed under the MIT License.

coding-quiz's People

Contributors

jengamez avatar

Watchers

James Cloos avatar  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.