Overview
K&L Quiz is a client side script that makes the creation of feature-rich quizzes simple, and adding them to your web page fast and easy. Online web seminars, promotion for a product, and entertainment, are among the applications for an online quiz. Your quiz can be professional, easy, and accurate, with minimal investment of time and resources.
With K&L Quiz, your online quiz is fully customizable. Add pictures and design the layout to your own specifications. Present questions in sequential order, or randomly. You can assign values to multiple choice answers, allowing for more than one correct answer, and instruct your subject to choose the "best" answer. You can choose a quiz flow model that suits your application, display results, and/or explanations to your answers. Test your quiz functionality within the user-friendly interface, before going directly to the web site.
Features
The K&L Quiz script is written in accordance with the current coding standards as defined by World Wide Web Consortium. This ensures that the script has cross-browser and forward compatibility.
The script is written in a way that separates its functionality from data, and from presentation. This makes script installation and configuration easy and provides for flexibility in presentation and interface. All the textual strings of quiz interface are placed in a separate quiz configuration object providing maximum level of customization for web masters and allowing such features as multilingual support.
The quiz can contain any number of questions. Presentation order of questions can be either sequential or random. Each question can consist of text, image or both. When both text and image are used, the location of text relative to the image can be one of the following: above, below, left, or right. When the location of the image is specified to the side of the text and the question element is not wide enough to accommodate both image and text, the text is placed below the image.
Each question can contain any number of answer choices. There can be any number of correct answers for every question. Presentation order of answer choices can be either sequential or random. Each answer can contain an explanation, which is revealed when the question is graded.
When a question has multiple correct answers, the choices are presented as checkboxes. When a question has a single correct answer, the choice presentation can be specified as either radio button or checkbox. Each answer is associated with a grading value that is used in determining the quiz score. Grading value assigns different weight to different questions, allowing more difficult questions to count more. Positive grading value signifies correct answers.
The quiz offers two flow options. In the first quiz flow flow option, the the quesions are graded and answer explations are displayed right after the question has been answered. In the second flow option, all the question have to be answered before the answers are graded and results are displayed; after which all the answers to quiz questions are reviewed.
Another optional feature of K&L quiz allows user to continue answer questions that were wrong at the end of the quiz.
You can download the MS PowerPoint file that depicts the possible flow options for the K&L Quiz.
The script offers two grading choices:
- Strict grading counts the answer correct only if all correct and no incorrect choices were selected. The score is calculated as the average of grading values of all correct answers
- Sum grading adds the grading values of all selected choices. A positive grade signifies a correct answer.
After the grading, the correct and incorrect answers can optionally be identified.
The script keeps track of the following statistics:
- Current question
- Total questions
- Number of correct answers
- Percent of correct answers
- Quiz score
These statistics can optionally be displayed in the quiz statistics area as defined by configuration string.
Quiz results can be specified as any number of score range - explanation pairs. Optionally, these results can be shown when the quiz is completed.
The K&L Quiz Script has the capability to report quiz results, and other supplied information, to a server side script. This feature can be used to log the results of the quiz for further analysis and review. This reporting is done in the background and is transparent to the user. The report can be submitted after the quiz was graded and at the end of the quiz (which is usable with quizes that are set up to continue with wrong questions after the quiz was graded). Please consult the quiz configuration file and sample server side scripts for detailed information on using this feature.
The quiz script is accompanied by an editor page. The editor page accepts quiz data via a form, automatically generating a javascript file.
Incorporating K&L Quiz into a Web Page
K&L Quiz script is located in a klquiz.js file; K&L quiz configuration object is located in klquizcfg.js file. These files should be included in the head section of an HTML document:
<script type="text/javascript" src="ScriptsFolder/klquiz.js"></script> <script type="text/javascript" src="ScriptsFolder/klquizcfg.js"></script>If other files are used for alternative quiz configurations, they should be included in the head section of HTML document as well. Please consult the klquizcfg.js file for detailed explanation of the quiz configuration object.
K&L Quiz data is a javascript object that is generated by the K&L Quiz Builder page. Each quiz data object is given a unique name and is stored in a separate file with a chosen name. Any number of quiz data objects can be used with a K&L quiz script on a single HTML page by including data files in the head section:
<script type="text/javascript" src="QuizDataFolder/dataSet1.js"></script> <script type="text/javascript" src="QuizDataFolder/dataSet2.js"></script>
The K&L Quiz is initialized by creating the instance of the klQuiz object when processing HTML document body onload event and passing the quiz configuration object to the initialization function:
<body onload="klq = new klQuiz(klQuizConfig);">Quiz configuration objects can be passed to the the klQuiz object at a later time using loadCfg() method:
klq.loadCfg(klQuizConfig2);
When the new instance of the klQuiz object is created, five HTML block elements with unique IDs have to be present within the document for successful quiz initialization:
- HTML block element that will display the quiz name
- HTML block element that will display quiz questions
- HTML block element that will display quiz answer choices
- HTML block element that will display quiz control buttons
- HTML block element that will display quiz statistics string
The IDs of these HTML elements have to be specified in qiuz configuration object.
Following is a fragment of HTML code that creates all required elements to run the K&L quiz with IDs found in the supplied configuration file:
<div id="klQuizName">Quiz Name</div> <div id="klQuizQuestion"></div> <div id="klQuizAnswers"></div> <div id="klQuizControls"></div> <div id="klQuizStats"></div>
The style of all HTML elements associated with the K&L Quiz can be customized using Cascading Style Sheets selectors. Consult the klquiz.css file for information about quiz element styling.
Once the klQuiz object is successfully initialized, the quiz data can be set by using the setData(data_variable_name) method, with the quiz data variable name as its argument. In a simple case when there is only one data set, this can be done within the body onload event right after the klQuiz object instantiation:
<body onload="klq = new klQuiz(klQuizConfig); klq.setData(quizData);">
When new data is set using the setData(data_variable_name) method, the quiz is reset. The klQuiz object also exposes the reset() method that can be used to reset the quiz without reloading quiz data.