<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tortoise IT &#187; Teaching</title>
	<atom:link href="http://www.sean-barton.co.uk/tag/teaching/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sean-barton.co.uk</link>
	<description>by Sean Barton, a freelance PHP website developer in Crewe, Cheshire</description>
	<lastBuildDate>Tue, 31 Jan 2012 17:34:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Live Countdown Timer using Javascript</title>
		<link>http://www.sean-barton.co.uk/2009/10/live-countdown-timer-using-javascript/</link>
		<comments>http://www.sean-barton.co.uk/2009/10/live-countdown-timer-using-javascript/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 10:52:40 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Teaching]]></category>
		<category><![CDATA[Time Savers]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[timer]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>

		<guid isPermaLink="false">http://www.sean-barton.co.uk/?p=350</guid>
		<description><![CDATA[Been done? Yes of course it has! However you don&#8217;t learn anything unless you get stuck in and have a go yourself and that is exactly what I did during an empty half hour period I had the other day (slow lecture). Whilst at university I am doing a lot of timed tasks (ten minutes etc.. as opposed to days) and the timers used are always a mobile phone timer or horrible Powerpoint countdown presentation. I wanted to write something which is simple to build on to create a JS version to ultimately integrate into online resources and lessons (Eg: &#8230; <a class="continue_reading" href="http://www.sean-barton.co.uk/2009/10/live-countdown-timer-using-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Been done? Yes of course it has! However you don&#8217;t learn anything unless you get stuck in and have a go yourself and that is exactly what I did during an empty half hour period I had the other day (slow lecture). Whilst at university I am doing a lot of timed tasks (ten minutes etc.. as opposed to days) and the timers used are always a mobile phone timer or horrible Powerpoint countdown presentation. I wanted to write something which is simple to build on to create a JS version to ultimately integrate into online resources and lessons (Eg: this task will take you ten minutes. Click here to turn on the timer&#8230;).</p>
<p>The  code at the bottom of this post is the raw HTML file I wrote. I obviously made it into a WordPress plugin as well. see below example.</p>
<p><strong>Example</strong></p>
<p>Yes, it&#8217;s basic but it works well for demonstrative purposes.</p>
<div id="countdown_body_wrapper">
                <form id="countdown_form" onsubmit="return do_countdown();">
                    Countdown from: <input style="width: 50px;" id="value" />
                    <select id="countdown_unit">
                        <option value="1">Seconds</option>
                        <option value="60">Minutes</option>
                        <option value="3600">Hours</option>
                    </select>
                    <input type="submit" value="Go" />
                </form>
                <div id="countdown_div"></div>
            </div>
<p><strong>Usage</strong></p>
<p>write sb_countdown in square brackets in a post or page and you will get the above example. If you want to edit the text or style it then just open the plugin file and right near the top is a few defines to get you going. I didn&#8217;t spend a lot of time on it so didn&#8217;t create an admin page. I may well do in the future though.</p>
<p><strong>The Download</strong></p>
<a class="downloadlink" href="http://www.sean-barton.co.uk/wp-content/plugins/download-monitor/download.php?id=15" title="Version 1 downloaded 540 times" >SB JS Countdown Timer (1.42 kB)</a>
<p><strong>Raw HTML Version</strong></p>
<pre>&lt;html&gt;
 &lt;head&gt;
 &lt;title&gt;Countdown Timer&lt;/title&gt;

 &lt;style&gt;
 body {
 font-family: tahoma;
 }

 #countdown_div {
 font-weight: bold;
 font-size: 56px;
 }

 #body_wrapper {
 padding: 10px;
 margin: 20px;
 }
 &lt;/style&gt;

 &lt;script&gt;
 function do_countdown() {
 var start_num = document.getElementById("value").value;
 var unit_var = document.getElementById("countdown_unit").value;

 start_num = start_num * parseInt(unit_var);

 var countdown_output = document.getElementById('countdown_div');

 if (start_num &gt; 0) {
 countdown_output.innerHTML = format_as_time(start_num);
 var t=setTimeout("update_clock(\"countdown_div\", "+start_num+")", 1000);
 }

 return false;
 }

 function update_clock(countdown_div, new_value) {
 var countdown_output = document.getElementById(countdown_div);
 var new_value = new_value - 1;

 if (new_value &gt; 0) {
 new_formatted_value = format_as_time(new_value);
 countdown_output.innerHTML = new_formatted_value;

 var t=setTimeout("update_clock(\"countdown_div\", "+new_value+")", 1000);
 } else {
 countdown_output.innerHTML = "And... Stop!";
 }
 }

 function format_as_time(seconds) {
 var minutes = parseInt(seconds/60);
 var seconds = seconds - (minutes*60);

 if (minutes &lt; 10) {
 minutes = "0"+minutes;
 }

 if (seconds &lt; 10) {
 seconds = "0"+seconds;
 }

 var return_var = minutes+':'+seconds;

 return return_var;
 }
 &lt;/script&gt;
 &lt;/head&gt;

 &lt;body&gt;
 &lt;div id="body_wrapper"&gt;
 &lt;form id="countdown_form" onsubmit="return do_countdown();"&gt;
 Countdown from: &lt;input style="width: 50px;" id="value" /&gt;
 &lt;select id="countdown_unit"&gt;
 &lt;option value="1"&gt;Seconds&lt;/option&gt;
 &lt;option value="60"&gt;Minutes&lt;/option&gt;
 &lt;option value="3600"&gt;Hours&lt;/option&gt;
 &lt;/select&gt;
 &lt;input type="submit" value="Go" /&gt;
 &lt;/form&gt;
 &lt;div id="countdown_div"&gt;&amp;nbsp;&lt;/div&gt;
 &lt;/div&gt;
 &lt;/body&gt;

&lt;/html&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sean-barton.co.uk/2009/10/live-countdown-timer-using-javascript/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Learning Event Generator</title>
		<link>http://www.sean-barton.co.uk/2009/09/learning-event-generator/</link>
		<comments>http://www.sean-barton.co.uk/2009/09/learning-event-generator/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 18:32:05 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Personal Blog]]></category>
		<category><![CDATA[Teaching]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[lesson planning]]></category>

		<guid isPermaLink="false">http://www.sean-barton.co.uk/?p=343</guid>
		<description><![CDATA[The learning event generator is something which I was shown on the first day of my PGCE. It was demonstrated and was intriguing to say the least! It would be an interesting way to allow the children we teach to decide their own activities. I have been in a coding mood today so thought that I would bash together a tiny little PHP script to emulate the same thing. Yes it&#8217;s basic but works from two text files which are defined in the first few lines of the file itself. It&#8217;s not the most elegant bit of code I have &#8230; <a class="continue_reading" href="http://www.sean-barton.co.uk/2009/09/learning-event-generator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The learning event generator is something which I was shown on the first day of my PGCE. It was demonstrated and was intriguing to say the least! It would be an interesting way to allow the children we teach to decide their own activities.</p>
<p>I have been in a coding mood today so thought that I would bash together a tiny little PHP script to emulate the same thing. Yes it&#8217;s basic but works from two text files which are defined in the first few lines of the file itself. It&#8217;s not the most elegant bit of code I have ever written but if you know anything about PHP or have a web server then why not have a fiddle and see what you can make it do?</p>
<p>Consider this&#8230; it doesn&#8217;t have to be learning events. Why not use it as a kind of &#8216;What shall we do tomorrow?&#8217; kind of thing. eg: &#8216;Do a 5 mile run with a friend dressed as a horse&#8217; or &#8216;Do go out and get a bit merry&#8217;.</p>
<p><strong>The Code</strong></p>
<pre>&lt;?php

$cwd = getcwd();
$outcome_source = $cwd . '/' . 'activities.txt';
$method_source = $cwd . '/' . 'methods.txt';

$outcomes = file($outcome_source);
$methods = file($method_source);

$outcome = trim($outcomes[array_rand($outcomes)]);
$method = trim($methods[array_rand($methods)]);

echo 'Do ' . $outcome . ' as a ' . $method . '.';

?&gt;</pre>
<p><strong>The Download</strong></p>
<p>The file is available as a download here: <a class="downloadlink" href="http://www.sean-barton.co.uk/wp-content/plugins/download-monitor/download.php?id=14" title="Version 1 downloaded 398 times" >Learning Event Generator (1.23 kB)</a></p>
<p><strong>References</strong></p>
<p>The original idea is available on the following <a title="Learning Event Generator Homepage" href="http://www.newtools.org/showtxt.php?docid=724" target="_blank">website</a> and is credited to John Davitt</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sean-barton.co.uk/2009/09/learning-event-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 8/31 queries in 0.069 seconds using disk
Object Caching 378/406 objects using disk

Served from: www.sean-barton.co.uk @ 2012-02-05 13:28:37 -->
