Embed “Poll Everywhere” Voting and Results in Your Website
Written by Brian on January 12, 2008 – 1:12 pm -I just read about Poll Everywhere on Teach42. If you’re not familiar with the Poll Everywhere service, it’s a website that allows you to create online polls.
Simple enough, but the cool part is that people can respond via cell phones. As Steve suggests on his blog, this would be a pretty nifty educational tool, if the prohibitive costs can be worked out.
What caught my attention was that Poll Everywhere advertises that you can embed the poll results into a Power Point presentation, but it’s not apparent that you can embed them in a website. Well, you can. And it’s pretty simple.
The Poll results are stored in a .swf (flash) file. This seems to be generated on Poll Everywhere’s server when you create the poll, and I’m assuming it has a static URL. If you plug the URL of the flash file into your webpage, you can get the results to show up.
Here’s the valid HTML code to do so:
<object width="600" height="500" type="application/x-shockwave-flash" data="http://polleverywhere.com/polls/LTg0MDQ2MTA4Mw.swf">
<param value="http://polleverywhere.com/polls/LTg0MDQ2MTA4Mw.swf" name="movie" />
<p>Results of a poll about coffee consumption. You won't see it without Flash enabled.</p>
</object>
The standard width of the movie seems to be about 725. I shrunk it so that it would fit into my template. You can see it {cms_selflink page=’129′ text=’full size in a new window here’ target=’_blank’}. You can adjust the “width” attribute to be what you want, and it should bring up a scroll bar for the flash object.
In order to display your own poll result, replace the URL in “data=” and in “<param value=” with the URL for your own poll.
To find the URL of your own poll, bring it up on Poll Everywhere’s website and view the HTML source of the page. About halfway down the page, you should see this bit of code.
<script type='text/javascript'>
var so = new SWFObject('http://polleverywhere.com/polls/LTg0MDQ2MTA4Mw.swf', 'polleverywhere', '100%', '550px', '9', '#FFFFFF');
so.useExpressInstall('/expressinstall.swf');
so.write('result-flash');
</script>
The URL in there (starting with “http://polleverywhere.com/polls/”) is the URL of your flash file. As far as I can tell, this is always identical to the URL that you use to access the actual poll, but with “.swf” at the end.
For one final added touch, you can add your web-based voting to your own website as well.
The voting mechanism is pretty simple. The site uses javascript to create a form. The form doesn’t actually have any elements but a submit button. All we have to do is re-create one form for each voting option – the action (the URL the form is sent to) determines how the vote is cast.
For each button, you’ll use this snippet of HTML.
<form method="post" action="http://polleverywhere.com/polls/LTg0MDQ2MTA4Mw/results?option_id=1280">
<input type="submit" value="Plenty (3 Cups)">
</form>
All you have to change is the URL in the “action” attribute. To get that URL, go to the web-based voting option on Poll Everywhere’s website. If you hover your mouse over one of the options, you should see a URL in the status bar of your browser. If you right-click and choose “Copy Link Location,” you’ll add the URL to your clipboard.
Now create an identical form for each option and copy and paste the different URL’s into the action. Finally, change the ‘value=”Plenty (3 Cups)”‘ attribute to the text you want to appear on the button.
And that’s all there is to it. You’ve now embedded the flash object into your website, and you’ve re-created the voting buttons.
Posted in Online Resources, Teach Them Well | No Comments »
Find that post enjoyable or informative? Why don't you subscribe to the feed for Teach Them Well. Or, subscribe to the site-wide feed and catch up on all my antics.
No Comments Yet
You can be the first to comment!
