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).
[ {"q":"Text of the first question.", "a":"Answer"}, {"q":"Text of the second question.", "a":"Answer"}, .... ]
<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.
this.txt
object.this.abc = abc.en; //get the alphabet (use: abs.es; for spanish)
<ul> <li>http://coursesweb.net/html/</li> <li>http://coursesweb.net/css/</li> </ul>
.some_class { display: list-item; }
var obj = { "courses": ["php", "javascript", "ajax"] }; var jsonstr = JSON.stringify(obj); alert(jsonstr); // {"courses":["php","javascript","ajax"]}
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>'; $dochtml = new DOMDocument(); $dochtml->loadHTML($strhtml); $elm = $dochtml->getElementById("dv1"); echo $elm->nodeValue; // CoursesWeb.net