/*************************************************************
* setup.js.php
*
* Sets up the experiment and each of the tests
* within it.
*
* Author: Willy Xiao
* Last Modified: August 2, 2013
*
*
* © Copyright 2013 Intelligent and Interactive Systems
* Group, Harvard University.
* For questions about this file and permission to use
* the code, contact us at info@labinthewild.org
*************************************************************/
var motorLogger = new MotorLogger(); // from motorLogger2.js
/* FixedSet is Sternberg's invariable set
followed by multiple probes.*/
var fixedSet = new FixedSet(0); // being loaded as the 0th element in globals.tests
// global variables
var globals = {
// all of the tests that are presented to the user
tests : [fixedSet],
// updated later after demographics
participant_id : 0
};
// variable used to determine whether using a touch device later in the code
var withTouch = false;
// variable used to determine where the common resources are
var commonResourcesLoc = "../common/";
function setup () {
// force orientation
fixOrientation("landscape");
// first do a browser detect
var browserDetectResults = browserDetect();
withTouch = browserDetectResults.is_mobile;
if (!browserDetectResults.pass) {
$("#error").html(getBrowserErrorHTML(browserDetectResults));
showFailPage();
}
// set up html
$("#header").html(" ");
$("#share_this").detach().appendTo("#header");
$("#share_this").show();
$("#header").append("
Prepare for the next trial...
" + "You're about to take a test on LabintheWild. Your contribution to our research allows us to learn more about cognitive differences around the world. The results from your test will also tell you something about yourself!
" + "Please read the following information carefully before proceeding.
" + "Why we are doing this research: We are trying to understand how short term memory works. More specifically, the goal of this study is to replicate the experiments done by an American psychologist Robert Sternberg in 1966.
" + "What you will have to do: You will be shown several sets of symbols, and we will ask you to memorize and later recall those symbols. Your participation in this study is completely voluntary, and you may refuse to participate or withdraw from the study without penalty or loss of benefits to which you may otherwise be entitled.
" + "What you will get out of it: We will give you feedback on how your results compare to those of other participants. The final results from this experiment will be posted on our blog page. The experiment is not designed to benefit you, but you may enjoy it and enjoy comparing your results with those of other participants.
" + "Privacy and Data Collection: We will not ask you for your name. Any data that we collect will be securely stored on our servers.
" + "Duration: Approximately 10 minutes.
" + "Contact information: If you have questions about this research, you may contact Professor Katharina Reinecke, Paul G. Allen Center for Computer Science & Engineering, Box 352350, Seattle, WA 98195, " + " reinecke@cs.washington.edu." + "
If you have questions about your rights as a research participant, or wish to obtain information, ask questions or discuss any concerns about this study with someone other than the researcher(s), please contact the University of Washington Human Subjects Division at 206-543-0098 (for international calls include the US Calling Code: +1-206-543-0098)." + "
"; $$$("splash").innerHTML = "Welcome! You're about to take a test on Lab in the Wild.
The \"Memory Speed Test\" is a classic test designed to measure how quickly we can retrieve information from short-term memory and how this timing changes depending on how many things we are trying to keep in mind at the same time.
At the end of the test, we will show you how your performance compares to others.
The test typically takes less than 10 minutes to complete.
This study requires a keyboard! Tablets (such as iPads) will not work unless you have an external physical keyboard. It may also not work properly on older versions of Internet Explorer. We apologize for not being able to support all browsers.
Whenever you are ready, click the little blue arrow below to go to the next page.
"; $$$("ajax_working").innerHTML = getAJAXWorkingHTML(); $$$("error").innerHTML = getFatalErrorHTML(); // setup from each test and their preloaded items var preloadArr = getCommonImageLinksArray().concat(["img/probe.png", "img/set.png", "img/yes.png", "img/no.png", "img/mouse_center.png"]); var preloadHelpers = []; var len = globals.tests.length; // setup and preload all items from each of the tests for (var test_num = 0; test_num < len; test_num++) { globals.tests[test_num].setup(); // setup each test (look at testInterface.txt for explanation) preloadArr.push(globals.tests[test_num].preload_arr); } var preload_helper = function() { $("#probes").append("