Javascript Course

A script for Trivia created with JavaScript. The quizzes (questions and answers) are stored in external files, in XML or JSON format.
The Trivia Game has two levels:
  • Level 1 - displays a list of answers to each quiz, and the user must click on the correct answer.
  • Level 2 - is a little more difficult. The last letter from the possible answers is deleted. It is displayed a text box in which the user can write the answer.
It has two modes:
  • Consecutive - the quiestions start from the quiz with index number added into a text field, and are displayed in their order till the last quiz.
  • Random - the quizzes are choosed randomly, till the last quiz, without repeat.
Also, the user can choose to play the trivia with a Countdown Timer (15 seconds to answer till the script adds automatically the correct answer).
You can easily add quizzes and multiple categories in this Trivia script, the quizzes of each category are stored in its external file (more informations are in 'readme.html' file in the archive with this script).


• To Download this script, click: Trivia Game Script.

Demo Trivia

Welcome to Trivia Game

- Choose the set of questions from the "Trivia Category".
- Click the Start button to start the quizzes.
-The Reset button resets the Trivia.

Levels:
  • Level 1 - Easy - It is displayed a list of answers to each quiz. Click the correct answer.
  • Level 2 - Difficult - You write the answer into a text field, then click on Send button. The last letter from the possible answers is deleted.
Mode
  • Consecutive - The quiestions start from the quiz with index number added into a text field, and are added in their order till the last quiz.
  • Random - The quizzes are choosed randomly, till the last quiz, without repeat.
- Countdown Timer - If that button is checked, you have 15 seconds to answer till the correct answer is added automatically.
Trivia Category

Mode


From to

Quizzes: 0 of

0 - Correct
0 - Incorrect

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to add lists into <ul> and <ol> elements?
<dt> <dd> <li>
<ul>
 <li>http://coursesweb.net/html/</li>
 <li>http://coursesweb.net/css/</li>
</ul>
Which value of the "display" property creates a block box for the content and ads a bullet marker?
block list-item inline-block
.some_class {
  display: list-item;
}
Which instruction converts a JavaScript object into a JSON string.
JSON.parse() JSON.stringify eval()
var obj = {
 "courses": ["php", "javascript", "ajax"]
};
var jsonstr = JSON.stringify(obj);
alert(jsonstr);    // {"courses":["php","javascript","ajax"]}
Indicate the PHP class used to work with HTML and XML content in PHP.
stdClass PDO DOMDocument
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>';
$dochtml = new DOMDocument();
$dochtml->loadHTML($strhtml);
$elm = $dochtml->getElementById("dv1");
echo $elm->nodeValue;    // CoursesWeb.net
JavaScript Trivia Game

Last accessed pages

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (142523)
  2. Pencil and Pen Tools (2262)
  3. Graphic Symbols (1512)
  4. CSS cursor property - Custom Cursors (6184)
  5. Responses (329)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (526)
  2. The Mastery of Love (65)
  3. CSS cursor property - Custom Cursors (63)
  4. Read Excel file data in PHP - PhpExcelReader (59)
  5. PHP-MySQL free course, online tutorials PHP MySQL code (44)