Skip to content

abhi36/Smart-Quiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Smart Quiz (Formerly JS-Quiz)

===============

A simple quiz template written in js/jquery and is responsively designed.

Use the quiz.html or to save space, you can use the minified version which compresses the non-editable code.

var quiz = [
    {
        "question"      :   "Q1: Who came up with the theory of relativity?",
        "image"         :   "http://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Albert_Einstein_Head.jpg/220px-Albert_Einstein_Head.jpg",
        "choices"       :   [
                                "Sir Isaac Newton",
                                "Nicolaus Copernicus",
                                "Albert Einstein",
                                "Ralph Waldo Emmerson"
                            ],
        "correct"       :   "Albert Einstein",
        "explanation"   :   "Albert Einstein drafted the special theory of relativity in 1905.",
    },
    {
        "question"      :   "Q2: Who is on the two dollar bill?",
        "image"         :   "http://upload.wikimedia.org/wikipedia/commons/thumb/9/94/US_%242_obverse-high.jpg/320px-US_%242_obverse-high.jpg",
        "choices"       :   [
                                "Thomas Jefferson",
                                "Dwight D. Eisenhower",
                                "Benjamin Franklin",
                                "Abraham Lincoln"
                            ],
        "correct"       :   "Thomas Jefferson",
        "explanation"   :   "The two dollar bill is seldom seen in circulation. As a result, some businesses are confused when presented with the note.",
    },
    {
        "question"      :   "Q3: What event began on April 12, 1861?",
        "image"         :   "",
        "choices"       :   [
                                "First manned flight",
                                "California became a state",
                                "American Civil War began",
                                "Declaration of Independence"
                            ],
        "correct"       :   "American Civil War began",
        "explanation"   :   "South Carolina came under attack when Confederate soldiers attacked Fort Sumter. The war lasted until April 9th 1865.",
    },

];

It's important that the correct answer match one of the choices exactly.

Images are optional, but you should keep the empty quotes. Every item must be proceeded by a comma except for the last item in a set.

To add an additional question, copy the entire curly bracket block:

{
    "question"      :   "Q3: What event began on April 12, 1861?",
    "image"         :   "",
    "choices"       :   [
                            "First manned flight",
                            "California became a state",
                            "American Civil War began",
                            "Declaration of Independence"
                        ],
    "correct"       :   "American Civil War began",
    "explanation"   :   "South Carolina came under attack when Confederate soldiers attacked Fort Sumter. The war lasted until April 9th 1865.",
},

There is also a variable at the top to add the quiz title.

Source of the codebase

Simple JS, multiple choice quiz, based off of https://github.com/jrue/JavaScript-Quiz & https://github.com/BobbyBLACK/JavaScript_QUIZ with some modifications to the functionality and bootstrap implementation

To-do

About

A simple quiz template written in js/jquery and is responsively designed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors