{"id":26434,"date":"2016-11-19T03:01:33","date_gmt":"2016-11-18T17:01:33","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=26434"},"modified":"2016-11-19T07:11:54","modified_gmt":"2016-11-18T21:11:54","slug":"country-quiz-game-suite-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/country-quiz-game-suite-tutorial\/","title":{"rendered":"Country Quiz Game Suite Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_currency_quiz.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Country Quiz Game Suite Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_currency_quiz.jpg\" title=\"Country Quiz Game Suite Tutorial\"   \/><\/a><p class=\"wp-caption-text\">Country Quiz Game Suite Tutorial<\/p><\/div>\n<p>Think we may have done a (web application software) set before, but honestly cannot locate it, but in any case we are here today to tell you about one of the joys of server side programming, in our case PHP.<\/p>\n<p>That joy, for us, is when you get into a pattern of completely <i>peer to peer<\/i> software components, in our case PHP serverside web applications.  What do we mean by <i>peer to peer<\/i> in the way we feel about the thought?  It means that several, usually small, completely independent web applications can &#8230;<\/p>\n<ul>\n<li>as such, be easily unit tested within themselves &#8230; but &#8230;<\/li>\n<li>they each have a similar, and really easy, approach to, just right at the end of coding &#8230; ie. when they are all individually coded &#8230; link them to be pointable at each other &#8220;<i>peer to peer<\/i>&#8221; &#8230; guess the difference here, unlike our penchant for &#8220;parent\/child&#8221; (which we are also very fond of), each web application component is independent and of &#8220;equal&#8221; status in our tiny little woooorrrrrrlllld!<\/li>\n<\/ul>\n<p> &#8230; and this really appeals to us.  Sometimes such an arrangement can be thought of as a <a target=_blank title='Suite of program information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Software_suite'>&#8220;suite&#8221;<\/a> of web applications (or programs).<\/p>\n<p>So what is that really simple mechanism of linking &#8230;<\/p>\n<ul>\n<li>Country Flag Quiz &#8230; from yesterday (with <a title='Country Flag Quiz Game Primer Tutorial' href='#cfqgpt'>Country Flag Quiz Game Primer Tutorial<\/a> as shown below) &#8230; <a target=_blank title='country_flag_quiz.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/country_flag_quiz.php-GETME'>country_flag_quiz.php<\/a> (and the only one to &#8220;change&#8221;, as such, as per <a target=_blank title='country_flag_quiz.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/country_flag_quiz.php-GETME'>this link<\/a> &#8230; as described further below) <a target=_blank title='country_flag_quiz.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/country_flag_quiz.php'>live run<\/a> &#8230; to both of &#8230;<\/li>\n<li>Country Currency Quiz &#8230; new <a target=_blank title='country_currency_quiz.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/country_currency_quiz.php_GETME'>country_currency_quiz.php<\/a> <a target=_blank title='country_currency_quiz.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/country_currency_quiz.php'>live run<\/a> &#8230; and &#8230;<\/li>\n<li>Country Capital Quiz &#8230; new <a target=_blank title='country_capital_quiz.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.php_GETME'>country_capital_quiz.php<\/a> <a target=_blank title='country_capital_quiz.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.php'>live run<\/a> &#8230; but not like this <a target=_blank title='?' href='http:\/\/ericpetersautos.com\/2014\/10\/27\/shall\/'>&#8220;capital&#8221;<\/a> &#8230; chortle, chortle &#8230;<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.jpg\" title='Country Capital Quiz' alt='Country Capital Quiz'><\/img>\n<\/li>\n<\/ul>\n<p>?  We just have a rearranged HTML <a target=_blank title='HTML select tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_select.asp'>select<\/a> (dropdown) element as below (exemplified below for the &#8220;Country Capital Quiz&#8221;) &#8230;<\/p>\n<p><code><br \/>\n&lt;select onchange=' location.href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_\" + this.value.toLowerCase() + \"_quiz.php\"; '&gt;&lt;option value=Capital&gt;Capital&lt;\/option&gt;&lt;option value=Currency&gt;Currency&lt;\/option&gt;&lt;option value=Flag&gt;Flag&lt;\/option&gt;&lt;\/select&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; but just arrange for the &#8220;home&#8221; top HTML option element to point at the quiz theme of interest for that piece of web application PHP software.<\/p>\n<p>And the placement of such a dropdown?  Well, we often annoy our HTML h1 elements with such dropdowns, but we&#8217;ve been a little more <a target=_blank title='UX information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/User_experience'>UX<\/a>y today, by replacing an otherwise less dynamic (HTML (table) th element) heading (single word), with something dynamic, and perhaps useful, to some quizzer users out there in &#8220;net&#8221; land!<\/p>\n<p>And this is what we like to think of as &#8220;clobbering&#8221; <font size=1>(but we encourage you to think of a less aggressive word perhaps)<\/font> something not very dynamic with something dynamic, but optionally so, in that it is up to the user whether they make use of the added functionality, or not, is another way &#8220;<a target=_blank title='?' href='https:\/\/www.youtube.com\/watch?v=TWbNQiS-TU8'><strike>some of us<\/strike><\/a> we like to roll&#8221;.<\/p>\n<p>Now, perhaps you are thinking it rather cheeky to say that this is so <i>peer to peer<\/i> with the quiz concepts being so different, and yes, that is so, but what does bring things together is the generosity of the &#8220;net&#8221; and its data resources to find out information, so, we&#8217;d like to thank &#8230;<\/p>\n<ul>\n<li>Country Flag Quiz &#8230; thanks to <a target=_blank title='Thanks' href='https:\/\/tiki.org\/'>Tiki Wiki<\/a> CMS &#8230; effectively giving up a country list to work with &#8230; and &#8230;<\/li>\n<li>Country Currency Quiz &#8230; thanks to <a target=_blank title='Thanks' href='http:\/\/www.nationsonline.org\/oneworld\/currencies.htm'>this link<\/a> links countries to currencies (and (3 letter) country codes and (3 letter) currency codes) &#8230; and &#8230;<\/li>\n<li>Country Capital Quiz &#8230; thanks to <a target=_blank title='Thanks' href='https:\/\/www.countries-ofthe-world.com\/capitals-of-the-world.html'>this link<\/a> links countries to capitals<\/li>\n<\/ul>\n<p>If you don&#8217;t have an interest in a server side language like PHP to <i>glean<\/i> such information, please consider <a target=_blank title='Ajax information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Ajax_%28programming%29'>Ajax<\/a> programming techniques to be able to (just) stick with HTML and Javascript and CSS (client side) coding.  But if you do &#8230; your PHP homework for today is to read about the <a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a> method.<\/p>\n<hr>\n<p id='cfqgpt'>Previous relevant <a target=_blank title='Country Flag Quiz Game Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/country-flag-quiz-game-primer-tutorial\/'>Country Flag Quiz Game Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_flag_quiz.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Country Flag Quiz Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_flag_quiz.jpg\" title=\"Country Flag Quiz Game Primer Tutorial\"   \/><\/a><p class=\"wp-caption-text\">Country Flag Quiz Game Primer Tutorial<\/p><\/div>\n<p>Often, the simpler you make the working of a web application, the more appealing it is.  Not always, but often.  Lots of us like to test our knowledge with a quiz, and lots of us have our specialty subjects.  So, today&#8217;s &#8220;Country Flag Quiz&#8221; web application, that we also talk about at WordPress 4.1.1&#8217;s <a target=_blank title='Country Flag Quiz Game Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/country-flag-quiz-game-primer-tutorial\/'>Country Flag Quiz Game Primer Tutorial<\/a>, will be right up the alley of some people.  Got to say that it felt like a huge challenge to get a decent score in this game, speaking personally, and found myself resorting to &#8230; <font size=1>but we digress<\/font> &#8230; to come up with a pass mark for the game.<\/p>\n<p>Today&#8217;s game we wrote in PHP (that you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_flag_quiz.php_GETME\">country_flag_quiz.php<\/a> and which you can try with today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_flag_quiz.php\" title=\"Click picture\">live run<\/a> link) and used its <a target=_blank title='Supercalifragilisticexpialidocious information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Supercalifragilisticexpialidocious'>Supercalifragilisticexpialidocious<\/a> <a target=_blank title='PHP glob method information' href='http:\/\/php.net\/manual\/en\/function.glob.php'><i>glob<\/i><\/a> method &#8230; we&#8217;ve spoken about (quite a bit) <a target=_blank title='PHP glob mentions here' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/glob'>here<\/a>.<\/p>\n<p>We need to thank the excellent <a target=_blank title='Tiki Wiki home page' href='https:\/\/tiki.org\/'>Tiki Wiki<\/a> <a target=_blank title='Content Management System information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Content_management_system'>CMS<\/a> product (which you can try for yourself at this <a target=_blank title='Tiki Wiki test CMS website at RJM Programming' href='http:\/\/www.rjmprogramming.com.au\/tikiwiki'>test website<\/a>) for the help with the country flag imagery, as well, today.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d26423' onclick='var dv=document.getElementById(\"d26423\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/quiz\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d26423' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d26434' onclick='var dv=document.getElementById(\"d26434\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/php\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d26434' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Think we may have done a (web application software) set before, but honestly cannot locate it, but in any case we are here today to tell you about one of the joys of server side programming, in our case PHP. &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/country-quiz-game-suite-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,15,33,37],"tags":[216,429,476,1615,932,997,1022,1166,2056,1276,1319],"class_list":["post-26434","post","type-post","status-publish","format-standard","hentry","category-elearning","category-games","category-software","category-tutorials","tag-cms","tag-file_get_contents","tag-game","tag-glob","tag-php","tag-programming","tag-quiz","tag-software-2","tag-suite","tag-tikiwiki-2","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/26434"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=26434"}],"version-history":[{"count":20,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/26434\/revisions"}],"predecessor-version":[{"id":26458,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/26434\/revisions\/26458"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=26434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=26434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=26434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}