Javascript Course

A script for educational games (named: Find the Word, it is like Hangman) created with JavaScript, with Pixi JS framework. The quizzes (questions and answers) are stored in external file, in JSON format.
You can easily add quizzes in this Find the Word game, directly in a text file (with data in valid JSON format).


• To Download this script, click: Find the Word Game Script

Demo Game

Instructions

- The questions and answers must be added into a ".json" file, with this format (see also in the "findword.json"):
[
 {"q":"Text of the first question.", "a":"Answer"},
 {"q":"Text of the second question.", "a":"Answer"},
 ....
]

Installing the script

To include this game into a web page:

1) Download the archive with the script (from the link above), and copy the "findword" folder (with al its files) on your server, in the root directory of your website (in 'www', 'public_html' or 'htdocs').
2) Copy the following code and add it in the place you want to display the trivia (see in the code of the findword.html file):
<div id='fw_game'></div>
<script charset='utf-8' src='findword/pixi.js'></script>
<script charset='utf-8' src='findword/findword.js'></script>
<script>
//pass the path to the json file with tests, and the number of groups you want with quizzes
var find_word = new FindWord('/findword/findword.json', 3);
</script>
- The first parameter '/findword/findword.json' is the path to the json files with quizzes; the second argument (here 3) is optional, it is the number of groups you want to divide the tests.

- To edit /change the texts of the game, open the findword.js file and edit data of in the this.txt object.
- The game contains the english and spanish alphabets, if you want to use the spanish alphabet, open the "findword.js" file and replace "en" with "es" in this line of code:
this.abc = abc.en; //get the alphabet (use: abs.es; for spanish)

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which attribute specifies the URL address where to send the form-data?
method action name
<form action="script.php" method="post"> ... </form>
Which CSS property can be used to break lines in the middle of words?
word-wrap line-height font-size
#id {
  width: 100px;
  word-wrap: break-word;
}
Which function sorts the elements of an array into alphabetical order, based on the string values?
pop() sort() shift()
var tutorials = ["php", "html", "css", "flash"];
tutorials.sort();
alert(tutorials[0]);          // css
Indicate the function that returns the value of the last element into an array.
current() next() end()
$code =[10=>"Perl", 20=>"PHP", 21=>"Python", 30=>"JavaScript");
$last = end($code);
echo $last;      // JavaScript
JavaScript Game - Find the Word

Last accessed pages

  1. AnythingZoomer - Zoom part of Image or Text Content (1986)
  2. The Mastery of Love (6812)
  3. CSS Course - Free lessons (21692)
  4. PHP Unzipper - Extract Zip, Rar Archives (31785)
  5. Get data from string with JSON object (2823)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (74)
  2. Read Excel file data in PHP - PhpExcelReader (21)
  3. PHP Unzipper - Extract Zip, Rar Archives (21)
  4. PHP-MySQL free course, online tutorials PHP MySQL code (15)
  5. SSEP - Site Search Engine PHP-Ajax (15)
Chat
Chat or leave a message for the other users
Full screenInchide