{"id":63858,"date":"2024-06-11T03:01:43","date_gmt":"2024-06-10T17:01:43","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=63858"},"modified":"2024-06-09T14:30:11","modified_gmt":"2024-06-09T04:30:11","slug":"australian-geographical-quiz-scrolling-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/australian-geographical-quiz-scrolling-tutorial\/","title":{"rendered":"Australian Geographical Quiz Scrolling Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.htm\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Australian Geographical Quiz Scrolling Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap_scroll.jpg\" title=\"Australian Geographical Quiz Scrolling Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Australian Geographical Quiz Scrolling Tutorial<\/p><\/div>\n<p>We were a little gobsmacked revisiting the 2017 era <a title='Australian Geographical Quiz Context Tutorial' href='#agqct'>Australian Geographical Quiz Context Tutorial<\/a> quiz web application (and thanks to <a target=_blank title='Australian Geographic' href='\/\/www.australiangeographic.com.au\/'>Australian Geographic<\/a> website here) that looking through the code &#8230; arrrgggghhh &#8230; the string &#8230;<\/p>\n<blockquote><p>\n.scroll\n<\/p><\/blockquote>\n<p> &#8230; was missing.  Why should it be there?   Well, on a re-run through of how the <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.htm\">Australian Geographical Quiz<\/a> web application worked, we were asked to click on &#8230;<\/p>\n<blockquote><p>\nWilsons Promontory\n<\/p><\/blockquote>\n<p> &#8230; which did not send us into a tizzy by itself.  Oh no!  We never panic?!  Even without the apostrophe in Wilsons we handled that &#8230; no worries &#8230; we realize that could have been because two (or more) guys or gals or both called Wilson were standing together at just the right time and place (or sent there by <a target=_blank title='?' href='https:\/\/www.youtube.com\/watch?v=tyJFxqKnGek'>Karen<\/a>) when a &#8220;promontory&#8221; needed naming &#8230; no problems.   No, what caused our &#8220;too fragile&#8221; web application diffs was the way we had to scroll down to that esteemed <a target=_blank title=\"Wilsons Promontory\" href='https:\/\/www.google.com\/maps\/search\/Wilsons+Promontory\/@-38.9568298,146.0001179,10z\/data=!3m1!4b1?entry=ttu'>Victorian coastal location<\/a> in our <font size=1>(temporarily, mind you)<\/font> less esteemious web application.  We got funny places mentioned as our nearest &#8220;place of click&#8221;, and it was then the &#8220;true horror&#8221; happened (ie. with our code scouring reveal) &#8230; no &#8220;false horror&#8221; around here &#8230; no &#8230; it was &#8220;true&#8221; all right &#8230; we&#8217;re here to tell you!  <strike title=\"Come on! This time you've gone too far!\">Any obs!<\/strike> Okay?!<\/p>\n<blockquote><p>\nThe fix, you ask?!\n<\/p><\/blockquote>\n<p>Glad you asked!  <font color=blue>Take a look<\/font> at (where we <font color=purple>also catered for mobile platforms<\/font> better too) &#8230;<\/p>\n<p><code><br \/>\nfunction icheck(evt) {<br \/>\n  if (realclick) {<br \/>\n       var x,y;<br \/>\n       <font color=purple>if (evt.touches) {<br \/>\n       if (evt.touches[0].pageX) {<br \/>\n       x = (eval(evt.touches[0].pageX + document.body.scrollLeft * 1) * 1);<br \/>\n       y = (eval(evt.touches[0].pageY + document.body.scrollTop * 1) * 1);<br \/>\n       } else {<br \/>\n       x = (eval(evt.touches[0].clientX + document.body.scrollLeft * 1) * 1);<br \/>\n       y = (eval(evt.touches[0].clientY + document.body.scrollTop * 1) * 1);<br \/>\n       }<br \/>\n       } else <\/font>if (evt.clientX || evt.clientY) {<br \/>\n       x = <font color=blue>(eval(<\/font>evt.clientX<font color=blue> + document.body.scrollLeft * 1) * 1)<\/font>;<br \/>\n       y = <font color=blue>(eval(<\/font>evt.clientY<font color=blue> + document.body.scrollTop * 1) * 1)<\/font>;<br \/>\n       } else {<br \/>\n       x = <font color=blue>(eval(<\/font>evt.pageX<font color=blue> + document.body.scrollLeft * 1) * 1)<\/font>;<br \/>\n       y = <font color=blue>(eval(<\/font>evt.pageY<font color=blue> + document.body.scrollTop * 1) * 1)<\/font>;<br \/>\n       }<br \/>\n  var distco=((x - midcoords[placepick][0]) * (x - midcoords[placepick][0])) + ((y - midcoords[placepick][1]) * (y - midcoords[placepick][1]));<br \/>\n  var halfpoint='';<br \/>\n<br \/>\n  var davw=' ... you are very cold ';<br \/>\n  if (distco &lt;= verywarm) {<br \/>\n    halfpoint='0.5';<br \/>\n    davw=\" ... you are very warm (and it's possible there is an overlap, so you score the 0.5 choosing this with OK button) \";<br \/>\n  } else if (distco &lt;= warm) {<br \/>\n    davw=' ... you are warm ';<br \/>\n  } else if (distco &lt;= cool) {<br \/>\n    davw=' ... you are cool ';<br \/>\n  } else if (distco &lt;= cold) {<br \/>\n    davw=' ... you are cold ';<br \/>\n  }<br \/>\n<br \/>\n  var nearestplace='';<br \/>\n  var nearestdistco=-1;<br \/>\n  for (var jwhich=0; jwhich&lt;midcoords.length; jwhich++) {<br \/>\n    distco=((midcoords[jwhich][0] - x) * (midcoords[jwhich][0] - x)) + ((midcoords[jwhich][1] - y) * (midcoords[jwhich][1] - y));<br \/>\n    if (jwhich == 0) {<br \/>\n       nearestplace=places[jwhich].replace(\/_\/g,' ');<br \/>\n       nearestdistco=distco;<br \/>\n    } else if (distco &lt; nearestdistco) {<br \/>\n       nearestplace=places[jwhich].replace(\/_\/g,' ');<br \/>\n       nearestdistco=distco;<br \/>\n    }<br \/>\n  }<br \/>\n     goes++;<br \/>\n     if (nearestplace == placechosen.replace(\/_\/g,' ')) {<br \/>\n     score+=factor;<br \/>\n     setTimeout(resetit, 200);<br \/>\n     setTimeout(pickone,1000);<br \/>\n     } else {<br \/>\n     var ans=prompt('You clicked nearest to ' + nearestplace + ' (0 for YouTube search, -0 for Australian Geographic search, +0 Both, 0.0 for Context in Map Legend) but we wanted you to identify ' + placechosen.replace(\/_\/g,' ') + ' (1 for YouTube search, -1 for Australian Geographic search, +1 Both, 1.1 for Context in Map Legend)' + davw + ' ... try again ... or ... Choose to Cancel', halfpoint);<br \/>\n     if (ans == null) {<br \/>\n      \/\/alert(92);<br \/>\n      setTimeout(pickone,2000);<br \/>\n     } else if (ans == '0.0') {<br \/>\n      if (lgo != null) lgo.close();<br \/>\n      lgo=window.open(pathto + 'legend_via_map.htm?url=' + encodeURIComponent(document.URL.split('?')[0].split('#')[0]) + '&tarea=&submit=Create+Legend+for+HTML+Map+Data&whereami=where-am-i&whatami=what-am-i&secret=secret#' + nearestplace.replace(\/ \/g,'_'), '_blank');<br \/>\n     } else if (ans == '1.1') {<br \/>\n      if (lgo != null) lgo.close();<br \/>\n      lgo=window.open(pathto + 'legend_via_map.htm?url=' + encodeURIComponent(document.URL.split('?')[0].split('#')[0]) + '&tarea=&submit=Create+Legend+for+HTML+Map+Data&whereami=where-am-i&whatami=what-am-i&secret=secret#' + placechosen.replace(\/ \/g,'_'), '_blank');<br \/>\n     } else if (ans == '-0') {<br \/>\n      if (ago != null) ago.close();<br \/>\n      ago=window.open('http:\/\/www.australiangeographic.com.au\/search\/search?query=' + nearestplace.replace(\/ \/g,'%20').replace(\/_\/g,'%20'),'_blank','top=15,left=15,width=300,height=300');<br \/>\n     } else if (ans == '-1') {<br \/>\n      if (ago != null) ago.close();<br \/>\n      ago=window.open('http:\/\/www.australiangeographic.com.au\/search\/search?query=' + placechosen.replace(\/ \/g,'%20').replace(\/_\/g,'%20'),'_blank','top=15,left=15,width=300,height=300');<br \/>\n     } else if (ans.replace('+','') == '0') {<br \/>\n      if (yto == null) {<br \/>\n        if (document.title.indexOf('Country ') != 0) document.title='Country ' + document.title;<br \/>\n        document.getElementById('youtube').innerHTML='&lt;a ontouchstart=\" realclick=false; setTimeout(resetit,1000); \" onclick=\" realclick=false; setTimeout(resetit,1000);\" title=\"Back to top\" href=\"#iag\"&gt;Back to top&lt;\/a&gt;&lt;iframe style=width:900px;height:700px; id=iyto src=\"' + pathto + 'karaoke_youtube_api.htm?emoji=on&nokaraoke=y&youtubeid=%20%20%20%20%20%20%20' + nearestplace.replace(\/ \/g,'%20').replace(\/_\/g,'%20') + '\"&gt;&lt;\/iframe&gt;';<br \/>\n        yto=document.getElementById('iyto');<br \/>\n      } else {<br \/>\n        yto.src=pathto + 'karaoke_youtube_api.htm?emoji=on&nokaraoke=y&youtubeid=%20%20%20%20%20%20%20' + nearestplace.replace(\/ \/g,'%20').replace(\/_\/g,'%20');<br \/>\n      }<br \/>\n      if (ans == '+0') {<br \/>\n      if (ago != null) ago.close();<br \/>\n      ago=window.open('http:\/\/www.australiangeographic.com.au\/search\/search?query=' + nearestplace.replace(\/ \/g,'%20').replace(\/_\/g,'%20'),'_blank','top=15,left=15,width=300,height=300');<br \/>\n      }<br \/>\n      location.href='#iyto';<br \/>\n     } else if (ans.replace('+','') == '1') {<br \/>\n      if (yto == null) {<br \/>\n        if (document.title.indexOf('Country ') != 0) document.title='Country ' + document.title;<br \/>\n        document.getElementById('youtube').innerHTML='&lt;a ontouchstart=\" realclick=false; setTimeout(resetit,1000); \" onclick=\" realclick=false; setTimeout(resetit,1000);\" title=\"Back to top\" href=\"#iag\"&gt;Back to top&lt;\/a&gt;&lt;iframe style=width:900px;height:700px; id=iyto src=\"' + pathto + 'karaoke_youtube_api.htm?emoji=on&nokaraoke=y&youtubeid=%20%20%20%20%20%20%20' + placechosen.replace(\/ \/g,'%20').replace(\/_\/g,'%20') + '\"&gt;&lt;\/iframe&gt;';<br \/>\n        yto=document.getElementById('iyto');<br \/>\n      } else {<br \/>\n        yto.src=pathto + 'karaoke_youtube_api.htm?emoji=on&nokaraoke=y&youtubeid=%20%20%20%20%20%20%20' + placechosen.replace(\/ \/g,'%20').replace(\/_\/g,'%20');<br \/>\n      }<br \/>\n      if (ans == '+1') {<br \/>\n      if (ago != null) ago.close();<br \/>\n      ago=window.open('http:\/\/www.australiangeographic.com.au\/search\/search?query=' + placechosen.replace(\/ \/g,'%20').replace(\/_\/g,'%20'),'_blank','top=15,left=15,width=300,height=300');<br \/>\n      }<br \/>\n      location.href='#iyto';<br \/>\n     } else if (ans == '0.5') {<br \/>\n      score+=0.5;<br \/>\n      setTimeout(pickone,2000);<br \/>\n     }<br \/>\n     setTimeout(resetit, 200);<br \/>\n     }<br \/>\n     document.getElementById('score').innerHTML='Score: ' + score + '\/' + goes;<br \/>\n  }<br \/>\n  return '';<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; in <a target=_blank title='agmap.htm' href='\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.html--GETME'>agmap.htm<\/a>, changed in <a target=_blank title='agmap.htm' href='\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=HTTP:\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.html--GETME'>this way<\/a> using the <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.htm\">Australian Geographical Quiz<\/a> web application.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/australian-geographical-quiz-scrolling-tutorial\/'>Australian Geographical Quiz Scrolling Tutorial<\/a>.<\/p-->\n<hr>\n<p id='agqct'>Previous relevant <a target=_blank title='Australian Geographical Quiz Context Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/australian-geographical-quiz-context-tutorial\/'>Australian Geographical Quiz Context Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.htm\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Australian Geographical Quiz Context Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap_more.jpg\" title=\"Australian Geographical Quiz Context Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Australian Geographical Quiz Context Tutorial<\/p><\/div>\n<p>We are continuing on with our Australian Geographic quiz today, building on our <a title='Australian Geographical Quiz Primer Tutorial' href='#agqpt'>Australian Geographical Quiz Primer Tutorial<\/a> start yesterday, with some added functionality to assist with &#8220;finding out more&#8221;.  Which is natural for us when we come upon information we have never heard of before.  What the &#8220;net&#8221; has most helped us out with in this respect is its potential as a reference source with &#8230;<\/p>\n<ul>\n<li>Search Engine websites<\/li>\n<li>Encyclopaedic websites such as Wikipedia<\/li>\n<li>Research websites<\/li>\n<li>Education websites<\/li>\n<li>Video repositories<\/li>\n<\/ul>\n<p> &#8230; and today we are going to (allow an) interface to the search functionality of the <a target=_blank title='Australian Geographic' href='\/\/www.australiangeographic.com.au\/'>Australian Geographic<\/a> website, in addition to the biggest online Video repository, <a target=_blank title='YouTube' href='\/\/www.youtube.com'>YouTube<\/a>, and use their great <a target=_blank title='YouTube API for Iframe embedded videos' href='https:\/\/developers.google.com\/youtube\/iframe_api_reference'>API<\/a> to embed YouTube videos within HTML iframe elements on your webpage.  Perusing YouTube you may have noticed that for many years now at YouTube Share button options, there have been ways to have YouTube help you to &#8220;cut&#8221; the video embedding HTML code necessary to display a video.  That is the basis behind the API, but the API also facilitates &#8230;<\/p>\n<ul>\n<li>Sequencing videos<\/li>\n<li>Stop and start and pause<\/li>\n<li>Durations<\/li>\n<li>Titles<\/li>\n<li>Volume<\/li>\n<li>Resizing<\/li>\n<\/ul>\n<p> &#8230; and we&#8217;d like to direct you to <a target=_blank title='YouTube API Iframe Synchronicity Resizing Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/youtube-api-iframe-synchronicity-resizing-tutorial\/'>YouTube API Iframe Synchronicity Resizing Tutorial<\/a> for further reading here.<\/p>\n<p>Now, as far as &#8220;context&#8221; goes, coming back to our blog posting title today, sometimes a map can be a bit of an overwhelmingly big thing to take in as the one data source, so we&#8217;ve also added as an &#8220;interfacing&#8221; additional functionality option, the chance for the user to latch onto the work we did with map legends and talked about at <a target=_blank title='Legend for and from HTML Map Element Web Server Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/legend-for-and-from-html-map-element-web-server-tutorial\/'>Legend for and from HTML Map Element Web Server Tutorial<\/a> and other related blog postings.  Legends turn the map &#8220;big&#8221; picture into a whole lot of place specific small pictures, with the advantage today, at least with the &#8220;Difficult&#8221; mode of play, the Australian states are colour coded, so in the legend you can display it will &#8220;lob&#8221; you onto your specific place of interest, and the background colouring will give you some hints as to where this is in the context of the &#8220;bigger picture&#8221; map also displayed for you to the left of the map legend.<\/p>\n<p>To understand this more in &#8220;context&#8221; &#8230; <font size=1>chortle, chortle<\/font> &#8230; why not try the Australian Geography quiz yourself at this <a target=_blank title='Australian Geography Quiz' href='\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.htm'>live run<\/a> link?  Or perhaps peruse the HTML and Javascript code you could call <a target=_blank title='agmap.htm' href='\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.html-GETME'>agmap.htm<\/a> changed in <a target=_blank title='agmap.htm' href='\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=HTTP:\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.html-GETME'>this way<\/a> for today&#8217;s added functionalities?  Also changing that little bit for the concept of processing incoming <i>document.URL<\/i> URLs containing a specially constructed &#8220;Australian Geography Quiz&#8221; &#8220;branded&#8221; hashtag (#) appendage as the means to highlight a &#8220;lobbed to&#8221; legend placename was the HTML code you could call <a target=_blank href='\/\/www.rjmprogramming.com.au\/HTMLCSS\/legend_via_map.html--------GETME' title='legend_via_map.htm'>legend_via_map.htm<\/a> changing in <a target=_blank title='legend_via_map.htm' href='\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=HTTP:\/\/www.rjmprogramming.com.au\/HTMLCSS\/legend_via_map.html--------GETME'>this way<\/a> to achieve that interfacing logic.<\/p>\n<hr \/>\n<p id='agqpt'>Previous relevant <a target=_blank title='Australian Geographical Quiz Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/australian-geographical-quiz-primer-tutorial\/'>Australian Geographical Quiz Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Australian Geographical Quiz Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.gif\" title=\"Australian Geographical Quiz Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Australian Geographical Quiz Primer Tutorial<\/p><\/div>\n<p>We have some similar ideas going on today, with our new web application quiz\/game, to those of <a title='ESL Vocabulary Getting Warmer Image Tutorial' href='#evgwit'>ESL Vocabulary Getting Warmer Image Tutorial<\/a> as shown below, as can be summarised by &#8230;<\/p>\n<ul>\n<li>use of the one underlying background image &#8230; coupled with &#8230;<\/li>\n<li>use of HTML map element on top of that &#8230; created via &#8230;<\/li>\n<li>the brilliant, the stupendous <a target=_blank title='Mobilefish Image map Creator functionality ... thanks' href='\/\/www.mobilefish.com\/services\/image_map\/image_map.php'>Mobilefish<\/a> website helper &#8230; thanks &#8230; to arrive at a &#8230;<\/li>\n<li>&#8220;getting warmer&#8221; type of quiz related, today, to Australian Geography<\/li>\n<\/ul>\n<p> &#8230; the underlying map image for which we&#8217;ve based on one from the stupendous, the brilliant <a target=_blank title='Australian Geographic' href='\/\/www.australiangeographic.com.au\/'>Australian Geographic<\/a> magazine and website, so thanks.<\/p>\n<p>A thing different in today&#8217;s work, apart from the inherent different look and array manipulations you look and act differently with, over time, with the code, is that we have two images &#8230;<\/p>\n<ol>\n<li>original image photographed with an iPad &#8230; for an &#8220;Easier&#8221; gameplay level of difficulty &#8230; as well as a &#8230;<\/li>\n<li>&#8220;confused up&#8221;\/&#8221;messed up&#8221; &#8230; call it what you will &#8230; image version put through a session on Gimp to &#8230;\n<ul>\n<li>Free Select Cut &#8230; and &#8230;<\/li>\n<li>Free Select Gaussian Blur<\/li>\n<\/ul>\n<p> &#8230; in order to arrive at an image for a &#8220;Difficult&#8221; gameplay level of difficulty (where there is less on the map image to help the user<\/li>\n<\/ol>\n<p> &#8230; presented to the player of the web application &#8220;Australian Geography&#8221; game in an HTML select &#8220;dropdown&#8221; choice.<\/p>\n<p>The other bit extra we&#8217;ve done today, because the HTML map element has not been designed to cover the whole rectangle of the image, is to harness the <i>document.body<\/i> <i>onclick<\/i> event (fired off via the HTML <i>&lt;body onload=&#8217;atstart();&#8217; <strong>ontouchstart=&#8217;icheck(event);&#8217; onclick=&#8217;icheck(event);&#8217;<\/strong>&gt;<\/i>) to check for (web application game) clicks (or touches) that are not &#8230;<\/p>\n<ul>\n<li>HTML select element based clicks &#8230; nor &#8230;<\/li>\n<li>other HTML map element HTML area element clicks<\/li>\n<\/ul>\n<p> &#8230; and if so, record that click event&#8217;s mouse (x,y) co-ordinates and report on this in a similar way to the &#8220;HTML map element HTML area element clicks&#8221;, except that we have no link to a <i>name<\/i> for their click (whereas we can glean a name off the HTML area element <i>alt<\/i> property for those HTML map element HTML area element clicks), and so we inform the user of the &#8220;nearest&#8221; place they clicked (or touched) near &#8230; as per (Javascript DOM code) &#8230;<\/p>\n<p> <code><br \/>\nfunction icheck(evt) {<br \/>\n  if (realclick) {<br \/>\n       var x,y;<br \/>\n       if (evt.clientX || evt.clientY) {<br \/>\n       x = evt.clientX;<br \/>\n       y = evt.clientY;<br \/>\n       } else {<br \/>\n       x = evt.pageX;<br \/>\n       y = evt.pageY;<br \/>\n       }<br \/>\n  var distco=((x - midcoords[placepick][0]) * (x - midcoords[placepick][0])) + ((y - midcoords[placepick][1]) * (y - midcoords[placepick][1]));<br \/>\n  var halfpoint='';<br \/>\n<strong><\/strong><br \/>\n  var davw=' ... you are very cold ';<br \/>\n  if (distco &lt;= verywarm) {<br \/>\n    halfpoint='0.5';<br \/>\n    davw=' ... you are very warm (and its possible there is an overlap, so you score the 0.5 choosing this with OK button) ';<br \/>\n  } else if (distco &lt;= warm) {<br \/>\n    davw=' ... you are warm ';<br \/>\n  } else if (distco &lt;= cool) {<br \/>\n    davw=' ... you are cool ';<br \/>\n  } else if (distco &lt;= cold) {<br \/>\n    davw=' ... you are cold ';<br \/>\n  }<br \/>\n<strong><\/strong><br \/>\n  var nearestplace='';<br \/>\n  var nearestdistco=-1;<br \/>\n  for (var jwhich=0; jwhich&lt;midcoords.length; jwhich++) {<br \/>\n    distco=((midcoords[jwhich][0] - x) * (midcoords[jwhich][0] - x)) + ((midcoords[jwhich][1] - y) * (midcoords[jwhich][1] - y));<br \/>\n    if (jwhich == 0) {<br \/>\n       nearestplace=places[jwhich].replace(\/_\/g,' ');<br \/>\n       nearestdistco=distco;<br \/>\n    } else if (distco &lt; nearestdistco) {<br \/>\n       nearestplace=places[jwhich].replace(\/_\/g,' ');<br \/>\n       nearestdistco=distco;<br \/>\n    }<br \/>\n  }<br \/>\n     goes++;<br \/>\n     var ans=prompt('You clicked nearest to ' + nearestplace + ' but we wanted you to identify ' + placechosen.replace(\/_\/g,' ') + davw + ' ... try again ... or ... Choose to Cancel', halfpoint);<br \/>\n     if (ans == null) {<br \/>\n      \/\/alert(92);<br \/>\n      setTimeout(pickone,2000);<br \/>\n     } else if (ans == '0.5') {<br \/>\n      score+=0.5;<br \/>\n      setTimeout(pickone,2000);<br \/>\n     }<br \/>\n     setTimeout(resetit, 200);<br \/>\n     document.getElementById('score').innerHTML='Score: ' + score + '\/' + goes;<br \/>\n  }<br \/>\n  return '';<br \/>\n}<br \/>\n <\/code><\/p>\n<p>The Javascript <i>realclick<\/i> global variable above is set to <i>false<\/i> by those other HTML select element and\/or HTML map element area element click (or touch) events, and then a <i>&#8220;setTimeout(resetit,1000);&#8221;<\/i> (for example) would put <i>realclick<\/i> global variable back to its usual <i>true<\/i> value.<\/p>\n<p>Why not try the Australian Geography quiz yourself at this <a target=_blank title='Australian Geography Quiz' href='\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.html'>live run<\/a> link?  Or peruse the HTML and Javascript code you could call <a target=_blank title='agmap.html' href='\/\/www.rjmprogramming.com.au\/HTMLCSS\/agmap.html_GETME'>agmap.html<\/a> perhaps?  By the way, this quiz is designed not to ask about the more populous regions or places of Australia, but more your outback or national park or adventure thought places.<\/p>\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='#d18180' onclick='var dv=document.getElementById(\"d18180\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/map\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d18180' 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='#d63858' onclick='var dv=document.getElementById(\"d63858\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/scroll\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d63858' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We were a little gobsmacked revisiting the 2017 era Australian Geographical Quiz Context Tutorial quiz web application (and thanks to Australian Geographic website here) that looking through the code &#8230; arrrgggghhh &#8230; the string &#8230; .scroll &#8230; was missing. Why &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/australian-geographical-quiz-scrolling-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,14,37],"tags":[88,99,2102,2105,1942,1538,476,477,481,482,491,576,587,590,652,1992,745,800,812,861,997,1917,1107,4142,4143,1319,1369,1493],"class_list":["post-63858","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-api","tag-area","tag-australian-geographic","tag-context","tag-document-body","tag-embed","tag-game","tag-games-2","tag-geographicals","tag-geography","tag-gimp","tag-html","tag-iframe","tag-image","tag-javascript","tag-legend","tag-map","tag-mobilefish","tag-mouse","tag-onclick","tag-programming","tag-scroll","tag-scrolling","tag-scrollleft","tag-scrolltop","tag-tutorial","tag-video","tag-youtube"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/63858"}],"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=63858"}],"version-history":[{"count":11,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/63858\/revisions"}],"predecessor-version":[{"id":63869,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/63858\/revisions\/63869"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=63858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=63858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=63858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}