![]() Make sure to mark one of answers as the correct one.Ĥ. If you use inline mode you can add tests, questions and answers without leaving the same page.ģ. Login as an admin and proceed to the tests table. #Quiz and test templates for pages how to#Images folder - a few extra images we are going to need How to create a new testġ. If you need to modify your quiz visual appearance this is the file to edit. Templates\quiz.htm - custom quiz template file. You can find them in the source directory under your project directory. We are going to use a few additional files. For instance, here is the section that displays the quiz results: The template file is a regular HTML file stuffed with the template variables. Triggered by $_REQUEST=1 condition.Īs we said, this project also uses a custom HTML template - quiz.htm which provides a completely different look and feel than all standard PHPRunner pages. This template requires three display modes: As a first step we override default template file as we want to use our own (quiz.htm). This event is responsible for the visual representation of our quiz. calculate score and save it in the database insert one record per answer in response_details table. insert a record into responses table and get a responseid. If IP address not found we create a new user. we use IP address lookup to find if such a user already exists. Most of application logic is stored in two events of Responses table Add page: BeforeProcess and BeforeDisplay. Users do not have to register in order to take the quiz. Guest access is enabled and guests users are allowed to access Add page of Responses table. There is one admin user (username: password: admin1) with access to all tables and data. Quiz template utilizes a simple security model. Message - varchar(1000) Application setup Add your messages to this table and specify score range which triggers the message to be displayed. On quiz results page you may want to show user a custom message like "Good job!" or "Needs more work". You may want to add more fields to this table, especially if you want users to register before taking the quiz. This table stores users info like email and IP address. Stores response details for each question user answered (some question can be left unanswered). There might be more than one response per user to the same test. correct field indicates if this is a correct answer. ![]() ![]() Each question can have as many answers as you want. The number of questions per test is unlimited. asnswer_explained (optional) contains detailed answer to this question. testid points to the parent test in tests table. It can help you better understand the inner workings of this template and provide the guidance you need in designing your own.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |