Quiz

Developer
Size
2,814 Kb
Views
34,408

How do I make an quiz?

What is a quiz? How do you make a quiz? This script and codes were developed by Matt Edwards on 12 August 2022, Friday.

Quiz Previews

Quiz - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>quiz</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Your Score: <span>0</span></h1> <ul> <li data-worth="1"> <div class="question"> Q. Who wrote Cats? </div> <div class="answer"> A. Andrew Lloyd Webber </div> <div class="buttons"> <a class="check button">Check Answer</a> <a class="right button">Correct?</a> </div> </li> <li data-worth="1"> <div class="question"> Q. Who is having their Last Session in Sydney this year? </div> <div class="answer"> A. Freud </div> <div class="buttons"> <a class="check button">Check Answer</a> <a class="right button">Correct?</a> </div> </li> <li data-worth="2"> <div class="question"> Q. Where is Jersey Boys playing? </div> <div class="answer"> A. Perth </div> <div class="buttons"> <a class="check button">Check Answer</a> <a class="right button">Correct?</a> </div> </li> <li data-worth="3"> <div class="question"> Q. What show was just announced from Brisbane? </div> <div class="answer"> A. Rocky Horror Show </div> <div class="buttons"> <a class="check button">Check Answer</a> <a class="right button">Correct?</a> </div> </li> </ul> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Quiz - Script Codes CSS Codes

@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300);
html { background: white; font-family: 'Open Sans', sans-serif; width: 640px;
}
li { box-sizing: border-box; float: left; list-style: none; padding: 20px; width: 280px; background: #fff; margin: 20px; background: #efefef;
}
.answer { display: none;
}
li.answered { background: #eee;
}
.buttons { padding-top: 20px;
}
.button { padding: 3px 10px; margin: 10px 0 0; display: inline-block; background: tomato; border: 1px solid #555; border-radius: 3px; curser: pointer;
}
.button:hover { background: #fa2600;
}
li.correct { background: lightgreen;
}
.right { display: none;
}
.answered .right { display: inline-block;
}

Quiz - Script Codes JS Codes

$('.check').on('click', function(){ group = $(this).closest('li'); group.find('.answer').toggle(); group.find('.question').toggle(); group.toggleClass('answered');
});
$('.right').on('click',function(){ group = $(this).closest('li'); group.toggleClass('correct'); score = +$('h1 span').html(); worth = +$(group).data('worth'); if($(group).hasClass('correct')){ score = score + worth; $('h1 span').html(score); } else { score = score - worth; $('h1 span').html(score); }
})
Quiz - Script Codes
Quiz - Script Codes
Home Page Home
Developer Matt Edwards
Username mtedwards
Uploaded August 12, 2022
Rating 3
Size 2,814 Kb
Views 34,408
Do you need developer help for Quiz?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Matt Edwards (mtedwards) Script Codes
Create amazing SEO content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!