This page will explain the options.- By Larry Battle
Also, the following two quizzes will be used throughout this page.
//quiz1 is an array of ques objects.
var quiz1 = [
{
ques: "Silver", //question
ans: "Ag", // answer
ansInfo : "More info here"
},
{
ques: "Gold",
ans: "Au",
ansInfo : "Gold-Au -> More info here"
}
],
//quiz2 is object with quiz type properties.
quiz2 = {
"fill": quiz1,
"tf":[
{
ques: "The derivative of x.",
ans: "1",
ansSel: [ "x", "not a number", "x^2" ]
},
{
ques: "Absolute Zero is 273.15 Kelvin.",
ans: false,
ansInfo: "Absolute Zero is 0 Kelvin or -273.15 degrees Celicus."
}
]
};
On multipleChoiceOl quiz type, when an answer has been selected, Options.activeClass will be added to the class.
options.title = "quizType: multipleChoiceOl";
options.quizType = "multiList";
$( "#activeClass" ).jQuizMe( quiz1, options );
This is attached to each question in fillInTheBlank quiz type.
options.addToEnd = " has what periodic symbol ?";
$( "#addToEnd" ).jQuizMe( quiz1, options );
Sets all questions to the same quiz types.
options.allQuizType = "multi";
$( "#allQuizType" ).jQuizMe( quiz2, options );
Options.allRandom will create all the quiz types then randomize the positions.
options.allRandom = true;
Prevents the user from moving on before inputting their answer.
options.blockCheck = false;
This will hide the delete button on quit.
options.disableDelete = true;
$( "#disableDelete" ).jQuizMe( quiz1, options );
This will hide the restart button on quit.
options.disableRestart = true;
$( "#disableRestart" ).jQuizMe( quiz1, options );
This will be displayed with the help button is clicked.
options.help = "Use <^a href='http://www.google.com' alt='Google.com'>Google.com to cheat";
On multipleChoiceOl quizType, set's this class on hover.
options.hoverClass = "q-ol-hover";
Provide a text/html intro.
options.intro = "Use google to cheat.";
Set the number of multiple choice options for quizType multi & multiList.
This is ignored when there is an ansSel property.
options.multiLen = 1;
Sets the number of questions asked. Must be between 0 and the amount of total questions.
options.numOfQuizQues = 2;
Randomizes all the questions in each quiz type section.
options.random = true;
Allow a review of the questions after the user quits.
options.review = false;
Show the answers after each question.
options.showAns = false;
If provided, show the answers information after each question.
options.showAnsInfo = false;
This will display all questions in HTML by converting it to Unicode before displaying.
var quizWithHTML = {
multiList:[{
ques: "Which html tag is outdated.",
ans: "<big>",
ansSel: [ null, "<li>", "<td>" ]
}]
};
options.showHTML = true;
$( "#showHTML" ).jQuizMe( quizWithHTML, options );
If answer is wrong, then show the user's wrong answer after each question.
options.showWrongAns = true;
Sends a status update when user switches questions or quits.
settings.statusUpdate arguments to ( quizInfo, $currQuiz )
quizInfo properties are: right, score, total, tried, wrong, hasQuit, quitFunc, nextFunc.
quizInfo.right is an array filled with the index of the right questions.
quizInfo.wrong is an array filled with the index of the wrong questions.
quizInfo.score is the current score.
quizInfo.total is the number of questions that are in the quiz.
quizInfo.hasQuit is a boolean.
quizInfo.quitFunc will allow you to end the quiz if the not done so already.
quizInfo.nextFunc will allow you to switch to the next function.
s$currQuiz is a jquery object containing a reference to the quiz.
options.statusUpdate = function( info, $quiz ){
$( "#score-right" ).html( info.right.length );
$( "#score-wrong" ).html( info.wrong.length );
if( info.hasQuit ){
var response = ( info.score >= 50 ) ? "Good job!" : "You need help." ;
$( $quiz ).find( ".q-statDetails" ).hide();
$( $quiz ).find( ".q-extraStat" ).html( response );
}
};
Options.quizType allows you to set the quiz type.
The quiz types are "trueOrFalse", "multipleChoice", "multiChoiceOl", "flashCard" and "fillInTheBlank".
Shorthand notations are "tf", "multi", "multiList", "cards", "fill".
This is only need if you send in an array and not a object with a defined quiz type.
options.title = "quizType: fill";
options.quizType = "fill";
$( "#quizType0" ).jQuizMe( quiz1, options );
options.title = "quizType: multileChoice";
options.quizType = "multi";
$( "#quizType1" ).jQuizMe( quiz1, options );
options.title = "quizType: multipleChoiceOl";
options.quizType = "multiList";
$( "#quizType2" ).jQuizMe( quiz1, options );
options.title = "quizType: trueOrFalse";
options.quizType = "trueOrFalse";
$( "#quizType3" ).jQuizMe( quiz1, options );
options.title = "quizType: flashCards";
options.quizType = "cards";
$( "#quizType4" ).jQuizMe( quiz1, options );
Title of the quiz.
options.title = "The Quiz Demo.";