{"id":28155,"date":"2017-02-12T03:01:26","date_gmt":"2017-02-11T17:01:26","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=28155"},"modified":"2017-02-13T19:31:03","modified_gmt":"2017-02-13T09:31:03","slug":"country-quiz-game-suite-google-geo-chart-post-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/country-quiz-game-suite-google-geo-chart-post-tutorial\/","title":{"rendered":"Country Quiz Game Suite Google Geo Chart Post Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Country Quiz Game Suite Google Geo Chart Post Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz_geo_chart_post.JPG\" title=\"Country Quiz Game Suite Google Geo Chart Post Tutorial\"   \/><\/a><p class=\"wp-caption-text\">Country Quiz Game Suite Google Geo Chart Post Tutorial<\/p><\/div>\n<p>If you read yesterday&#8217;s <a title='Country Quiz Game Suite Google Geo Chart Tutorial' href='#cqgsggct'>Country Quiz Game Suite Google Geo Chart Tutorial<\/a> as shown below, why, right there and then, didn&#8217;t we apply these changes (to the &#8220;Capital&#8221; web application) onto the whole suite of Country Quizzes, those being &#8230;<\/p>\n<ul>\n<li>Capital<\/li>\n<li>Flag<\/li>\n<li>Currency<\/li>\n<\/ul>\n<p>?   Well, there&#8217;s another matter to attend to.  What do you think would happen if you quizzed away for, say, ten minutes?  We think our additional Google Chart Geo Chart bit would &#8220;fall over&#8221; &#8230; that&#8217;s what programmer&#8217;s say when there is a weakness (and\/or a bug) to do with &#8220;not catering for&#8221; untoward scenarios.  The reason it would &#8220;fall over&#8221;, we believe, is that, eventually, the number of countries you string along adding to the length of the URL you push into that Google Chart Geo Chart&#8217;s HTML iframe element would push it over the length limit for (form method=) &#8220;GET&#8221; URLs, and then this, albeit optional, functionality would become unstable.   Even though the functionality is optional, if you keep ignoring such issues at the sidelines of your plans, you are likely to get lazy and produce results that disappoint your more adventurous users.<\/p>\n<p>So here is what we are going to do.  You see how we said <i>&#8216;(form method=) &#8220;GET&#8221; URLs&#8217;<\/i> above?<\/p>\n<ol>\n<li>we don&#8217;t have an HTML form <font size=1> &#8230; but you could &#8230; <\/font> and to simulate the stringing together of a URL and placing it, Javascript DOM-wise, into the <i>src<\/i> property of the HTML iframe, is to have an HTML form with input elements whose <b><i>name<\/i><\/b> properties point at the ?\/&#038;<b>[name]<\/b>=[value] and <b><i>value<\/i><\/b> properties <font size=1>&#8230; doh &#8230;<\/font> point at ?\/&#038;[name]=<b>[value]<\/b> and have a method=&#8221;GET&#8221; action=http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/geo_chart.php target=[nameOfRelevantIframe] &#8230; or &#8230;<\/li>\n<li>do everything the same as above except that <i>method=&#8221;POST&#8221;<\/i> and in this way there are much less stringent data length restrictions &#8230; <font size=1>you&#8217;ll be quizzing until dinner time &#8230; hey, why aren&#8217;t you making dinner?!<\/font><\/li>\n<\/ol>\n<p>We&#8217;re going to go from the stringing a URL together to passing that &#8220;stringed together URL&#8221; as a parameter into a pretty generic Javascript function as per &#8230;<\/p>\n<p><code><br \/>\nfunction checkforpost(insg, owhere) {<br \/>\n  var outs=insg, fbits='&lt;form style=display:none; target=\\\"myipost\\\" method=\\\"POST\\\" action=\\\"http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/geo_chart.php\\\"&gt;&lt;input type=submit id=myspost value=Submit&gt;&lt;\/input&gt;&lt;input name=wellinever value=y type=hidden&gt;&lt;\/input&gt;&lt;\/form&gt;';<br \/>\n  if (insg.length &gt; 950) {<br \/>\n    var outarr=insg.split('#')[0].split('?');<br \/>\n    if (outarr.length &gt; 1) {<br \/>\n       var outarrtwo=outarr[1].split('&'), oath;<br \/>\n       for (var im=0; im&lt;outarrtwo.length; im++) {<br \/>\n         oath=outarrtwo[im].split('=');<br \/>\n         fbits=fbits.replace('&lt;\/form&gt;','&lt;input type=hidden name=' + oath[0] + ' value=\\\"' + (oath[1]) + '\\\"&gt;&lt;\/input&gt;&lt;\/form&gt;');<br \/>\n       }<br \/>\n    }<br \/>\n    if (owhere == null) {<br \/>\n      owhere=document.getElementById('mydpost');<br \/>\n      if (owhere == null) {<br \/>\n        if (document.getElementById('mydpost')) {<br \/>\n          document.getElementById('mydpost').innerHTML=fbits;<br \/>\n          setTimeout(andlater,1500);<br \/>\n          outs=\\\"#\\\";<br \/>\n        } else {<br \/>\n          document.body.innerHTML+='&lt;div id=mydpost&gt;' + fbits + '&lt;\/div&gt;';<br \/>\n          setTimeout(andlater,1500);<br \/>\n          outs=\\\"#\\\";<br \/>\n        }<br \/>\n      }  else {<br \/>\n        owhere.innerHTML=fbits;<br \/>\n        setTimeout(andlater,1500);<br \/>\n        outs=\\\"#\\\";<br \/>\n      }<br \/>\n    } else {<br \/>\n      owhere.innerHTML=fbits;<br \/>\n      setTimeout(andlater,1500);<br \/>\n      outs=\\\"#\\\";<br \/>\n    }<br \/>\n  }<br \/>\n  return outs;<br \/>\n}<br \/>\nfunction andlater() {<br \/>\n document.getElementById('myspost').click();<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; to cater for lots of quizzing.<\/p>\n<p>And so that leaves us with our  changed <a target=_blank title='' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.php---GETME\">country_capital_quiz.php<\/a> (with this <a target=_blank title='Click picture' href='http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.php'>live run<\/a> link), featuring these <a target=_blank title='' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.php---GETME'>changes<\/a>.<\/p>\n<hr>\n<p id='cqgsggct'>Previous relevant <a target=_blank title='Country Quiz Game Suite Google Geo Chart Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/country-quiz-game-suite-google-geo-chart-tutorial\/'>Country Quiz Game Suite Google Geo Chart 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_capital_quiz.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Country Quiz Game Suite Google Geo Chart Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz_geo_chart.JPG\" title=\"Country Quiz Game Suite Google Geo Chart Tutorial\"   \/><\/a><p class=\"wp-caption-text\">Country Quiz Game Suite Google Geo Chart Tutorial<\/p><\/div>\n<p>We think there are several interesting thing about Charts &#8230;<\/p>\n<ul>\n<li>they are a way to visualise mathematical ideas, which is not always easy<\/li>\n<li>they interface really well with spreadsheets<\/li>\n<li>in the case of Google Charts, especially with their Geo Chart and Map Chart, there is a great link to geography<\/li>\n<li>they can simplify complex data<\/li>\n<li>they can put trends into an easily digestible graphical form<\/li>\n<li>they can show the distribution of data<\/li>\n<\/ul>\n<p> &#8230; and we want to use that third point above today to make use of the brilliant Google Chart Geo Chart to add context to our Flags and Currency and Capital Country Quiz game we created when we last presented <a title='Country Quiz Game Suite YouTube Tutorial' href='#cqgsyt'>Country Quiz Game Suite Google Geo Chart Tutorial<\/a>, as shown below.<\/p>\n<p>The point here is that many of us struggle to locate all the countries of the world you can think of, but isn&#8217;t it of interest for us all to get better at this, if the dream of the Internet as the &#8220;Superhighway&#8221; of Knowledge and Information can improve as a force for good.   Can we all get back that idea from those earlier times, and get back to tackling problems in an International framework, where every good idea has a chance to be expressed, and heard?<\/p>\n<p>Anyway, that last change to Geo Chart interfacing got us to this point where we can highlight one or several countries (or regions), and not display that (default) legend, as we set up when we presented <a title='Country Quiz Game Suite YouTube Tutorial' href='#cqgsyt'>Country Quiz Game Suite Google Geo Chart Tutorial<\/a>.  We&#8217;ll buy into that today with our changed <a target=_blank title='' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.php--GETME\">country_capital_quiz.php<\/a> (with this <a target=_blank title='Click picture' href='http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.php'>live run<\/a> link), featuring these <a target=_blank title='' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.php--GETME'>changes<\/a>.<\/p>\n<hr>\n<p id='cqgsyt'>Previous relevant <a target=_blank title='Country Quiz Game Suite YouTube Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/country-quiz-game-suite-youtube-tutorial\/'>Country Quiz Game Suite Google Geo Chart 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_capital_quiz.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Country Quiz Game Suite YouTube Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_quiz.jpg\" title=\"Country Quiz Game Suite YouTube Tutorial\"   \/><\/a><p class=\"wp-caption-text\">Country Quiz Game Suite YouTube Tutorial<\/p><\/div>\n<p>Today we are adding optional functionality to our previous web application from <a title='Country Quiz Game Suite Tutorial' href='#cqgst'>Country Quiz Game Suite Tutorial<\/a> as shown below, and so it seems apt that we add one word for the title of today&#8217;s tutorial called &#8220;Country Quiz Game Suite YouTube Tutorial&#8221;, and that added word is <a target=_blank title='YouTube landing page' href='http:\/\/youtube.com'>&#8220;YouTube&#8221;<\/a>, the biggest repository of videos in the online world.<\/p>\n<p>So we are trying to spice up the &#8220;dry&#8221; look of the &#8220;Country Quiz Game Suite&#8221; of web applications by adding optional lookups of YouTube so that the user can choose to watch a video about the last question that was asked about in the quiz.  Is there a reason to use a &#8220;YouTube&#8221; search for this, rather than a search engine search?  For us, yes, and this can be put down to the wonders of the <a target=_blank title='YouTube API for Iframe embedded videos' href='https:\/\/developers.google.com\/youtube\/iframe_api_reference'>YouTube API<\/a> designed for embedding in HTML <a target=_blank title='HTML iframe element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_iframe.asp'>iframe<\/a> elements, which you can read a thread of blog posts about from <a target=_blank title='Karaoke via YouTube API in Iframe Email Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/karaoke-via-youtube-api-in-iframe-email-tutorial\/'>Karaoke via YouTube API in Iframe Email Tutorial<\/a> down.  This ability is a huge <a target=_blank title='UX information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/User_experience'>UX<\/a> positive for use of these web applications, on mobile platforms in particular, because the YouTube video &#8220;interface&#8221; parts of the webpage can be placed on the webpage the user is currently using, rather than having to open any new windows, and have the user be in danger of &#8220;losing the plot&#8221;.<\/p>\n<p>Added to that advantage is the way the user can do research and development on topics that may interest them.  To us, the most important point here.<\/p>\n<p>So far we&#8217;ve talked about <i>what<\/i> the changes involve, and now we&#8217;ll turn our attention to <i>how<\/i> these changes were achieved.  In broad brush terms &#8230;<\/p>\n<ul>\n<li>we introduce new external Javascript you could call <a target=_blank title=\"country_quiz.js\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_quiz.js_GETME\">country_quiz.js<\/a> called by the parent &#8230;\n<ul>\n<li>Country Flag Quiz &#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> (changed just to do with calling that external Javascript 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>) and with this <a target=_blank title='Click picture' href='http:\/\/www.rjmprogramming.com.au\/PHP\/country_flag_quiz.php'>live run<\/a><\/li>\n<li>Country Currency Quiz &#8230; <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> (changed just to do with calling that external Javascript as per <a target=_blank title='country_currency_quiz.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/country_currency_quiz.php-GETME'>this link<\/a>) and with this <a target=_blank title='Click picture' href='http:\/\/www.rjmprogramming.com.au\/PHP\/country_currency_quiz.php'>live run<\/a><\/li>\n<li>Country Capital Quiz &#8230; <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> (changed just to do with calling that external Javascript as per <a target=_blank title='country_capital_quiz.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.php--GETME'>this link<\/a>) and with this <a target=_blank title='Click picture' href='http:\/\/www.rjmprogramming.com.au\/PHP\/country_capital_quiz.php'>live run<\/a><\/li>\n<\/ul>\n<p>&#8230; using a call like &#8230;\n<\/li>\n<li><code>&lt;script type='text\/javascript' src='country_quiz.js' defer='defer'&gt;&lt;\/script&gt;<\/code><\/li>\n<li>the <i>defer<\/i> HTML <a target=_blank title='HTML script tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_script.asp'>script<\/a> tag attribute used to delay its loading to the end of loading, and also placed so that &#8230;<\/li>\n<li>the call of the external Javascript is placed after local Javascript <a target=_blank title='HTML script tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_script.asp'>script<\/a> tag client logic, because &#8230;<\/li>\n<li>we <i>&#8220;overload&#8221;<\/i> the local Javascript &#8220;function <i>check()<\/i>&#8221; with a version from the external Javascript <a target=_blank title=\"country_quiz.js\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_quiz.js_GETME\">country_quiz.js<\/a>, and we&#8217;ve discussed this Javascript style of overloading, before, when we presented <a target=_blank title='Javascript Function Overload Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/javascript-function-overload-primer-tutorial\/'>Javascript Function Overload Primer Tutorial<\/a> (where we overloaded the &#8220;encodeURIComponent&#8221; method) &#8230; and in that &#8230;<\/li>\n<li>external Javascript <a target=_blank title=\"country_quiz.js\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_quiz.js_GETME\">country_quiz.js<\/a> &#8220;function <i>check()<\/i>&#8221; potentially loads YouTube API functionality to an HTML iframe element which was first created via &#8230;<\/li>\n<li>a one off <a target=_blank title='Javascript setTimeout() method information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_settimeout.asp'>setTimeout<\/a> piece of logic is called by the external Javascript <a target=_blank title=\"country_quiz.js\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_quiz.js_GETME\">country_quiz.js<\/a> to &#8230;\n<ul>\n<li>append the HTML for that YouTube API HTML iframe &#8220;container&#8221; element to <i>document.body<\/i><\/li>\n<li>append to the first HTML h3 element an HTML input type=checkbox, initially checked, toggling the use of that option YouTube API (to HTML iframe element) functionality<\/li>\n<\/ul>\n<p>&#8230; this <a target=_blank title='Javascript setTimeout() method information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_settimeout.asp'>setTimeout<\/a> methodology remaining as independent from any potential logic clashes with parent HTML Javascript <i>onload<\/i> event logic<\/li>\n<\/ul>\n<ul>\n<p>Nothing changes about the <i>peer to peer<\/i> nature of this &#8220;Country Quiz Game Suite&#8221; of web applications, so we encourage you to try any\/all of them &#8230; let&#8217;s try &#8230; <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/country_flag_quiz.php\">flags<\/a>.<\/p>\n<hr>\n<p id='cqgst'>Previous relevant <a target=_blank title='Country Quiz Game Suite Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/Country Quiz Game Suite Tutorial\/'>Country Quiz Game Suite 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_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<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='#d26490' onclick='var dv=document.getElementById(\"d26490\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/youtube\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d26490' 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='#d28116' onclick='var dv=document.getElementById(\"d28116\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/google-chart\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d28116' 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='#d28155' onclick='var dv=document.getElementById(\"d28155\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/post\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d28155' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you read yesterday&#8217;s Country Quiz Game Suite Google Geo Chart Tutorial as shown below, why, right there and then, didn&#8217;t we apply these changes (to the &#8220;Capital&#8221; web application) onto the whole suite of Country Quizzes, those being &#8230; &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/country-quiz-game-suite-google-geo-chart-post-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[2105,2081,354,452,476,477,1619,481,513,518,576,587,652,932,970,997,1022,1319,1345],"class_list":["post-28155","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-context","tag-country","tag-dom","tag-form","tag-game","tag-games-2","tag-geo-chart","tag-geographicals","tag-google","tag-google-chart","tag-html","tag-iframe","tag-javascript","tag-php","tag-post","tag-programming","tag-quiz","tag-tutorial","tag-url"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/28155"}],"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=28155"}],"version-history":[{"count":10,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/28155\/revisions"}],"predecessor-version":[{"id":28204,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/28155\/revisions\/28204"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=28155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=28155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=28155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}