Skip to content

Instantly share code, notes, and snippets.

View jewlofthelotus's full-sized avatar

Julie Cameron jewlofthelotus

View GitHub Profile
@jewlofthelotus
jewlofthelotus / gist:5627944
Created May 22, 2013 14:26
How to use getJSON to pull the quiz config object into the SlickQuiz options
$(function () {
$.getJSON('path/to/file.json', function(data) {
$('#slickQuiz').slickQuiz({json: data});
});
});
@jewlofthelotus
jewlofthelotus / gist:5624959
Last active December 17, 2015 14:29
How to place the quiz config JSON directly into the SlickQuiz plugin options.
$(function () {
$('#slickQuiz').slickQuiz({
json: {
"info": {
"name": "Test Your Knowledge!!",
"main": "<p>Think you're smart enough to be on Jeopardy? Find out with this super crazy knowledge quiz!</p>",
"results": "<h5>Learn More</h5><p>Etiam scelerisque, nunc ac egestas consequat, odio nibh euismod nulla, eget auctor orci nibh vel nisi. Aliquam erat volutpat. Mauris vel neque sit amet nunc gravida congue sed sit amet purus.</p>",
"level1": "Jeopardy Ready",
"level2": "Jeopardy Contender",
"level3": "Jeopardy Amateur",
@jewlofthelotus
jewlofthelotus / gist:5591940
Created May 16, 2013 14:00
Adjusting the level calculation for 3 ranking levels.
// Calculates knowledge level based on number of correct answers
calculateLevel: function(correctAnswers) {
var percent = (correctAnswers / questionCount).toFixed(2),
level = 0;
if (plugin.method.inRange(0, 0.330, percent)) {
level = 3;
} else if (plugin.method.inRange(0.331, 0.660, percent)) {
level = 2;
} else if (plugin.method.inRange(0.661, 1.00, percent)) {