XPLab_2019

Course site for "Experimental Psychology Lab" 2019


Project maintained by michael-franke Hosted on GitHub Pages — Theme by mattgraham

In-class exercises May 16th 2019

In today’s class you are going to adapt your Mental Rotation task in a number of steps, working towards a realization of the whole experiment.

Update your current experiment to _babe 0.1.0

"dependencies": {
  "babe-project": "~0.1.0"
}

Add a lag to your key-press main task

Add a practice session

Practice is exactly like the main task, but we will use a hook to control for correctness.

const check_response = function(data, next) {
    data.response_checked = false;
    $("body").on("keydown", function(e) {
        if (data.response_checked == false) {
            const keyPressed = String.fromCharCode(
                e.which
            ).toLowerCase();
            if (keyPressed == data.key1 || keyPressed == data.key2) {
                if (data[keyPressed] === data.correct) {
                    alert('Your answer is correct! Yey!');
                } else {
                    alert('Sorry, this answer is incorrect :( The correct answer was ' + data.correct);
                }
                data.response_checked = true;
                next();
            }
        }})
}

Add wrapping views & instructions

Include all items

Check the experiment