/** (July 2012, Erik Weitnauer)
The html-plugin will load and display an arbitrary number of html pages. To proceed to the next, the
user might either press a button on the page or a specific key. Afterwards, the page get hidden and
the plugin will wait of a specified time before it proceeds.
Parameters:
pages: array of
url: url of the html-page to display (mandatory)
cont_key: keycode of the key to continue (optional)
cont_btn: id of a button (or any element on the page) that can be clicked to continue (optional)
note that the button / element has to be included in the page that is loaded, already
timing: number of ms to wait after hiding the page and before proceeding (optional)
check_fn: called with $this as argument when subject attempts to proceed; only proceeds if this
returns true; (optional)
cont_key: this setting is used for all pages that don't define it themself (optional)
cont_btn: this setting is used for all pages that don't define it themself (optional)
timing: this setting is used for all pages that don't define it themself (optional)
force_refresh: set to true if you want to force the plugin to grab the newest version of the html document
Data:
array of
url: the url of the page
timing: the timing parameter that was given, if any
user_duration: duration the user looked at the page in ms
Example Usage:
jsPsych.init($('#target'),
{experiment_structure: [
{type: "html", pages:[{url: "intro.html", cont_btn: "start"}]}
],
finish: function(data) { }
});
*/
(function( $ ) {
jsPsych.html = (function(){
var plugin = {};
plugin.create = function(params) {
var trials = [];
for(var i=0; i