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’s basic but works from two text files which are defined in the first few lines of the file itself. It’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?
Consider this… it doesn’t have to be learning events. Why not use it as a kind of ‘What shall we do tomorrow?’ kind of thing. eg: ‘Do a 5 mile run with a friend dressed as a horse’ or ‘Do go out and get a bit merry’.
The Code
<?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 . '.'; ?>
The Download
The file is available as a download here: Learning Event Generator (1.23 kB)
References
The original idea is available on the following website and is credited to John Davitt
