Skip to content

Mouse tracking on external html pages #3276

Answered by Shaobin-Jiang
L0i0n0a asked this question in Q&A
Discussion options

You must be logged in to vote

If you mean the external-html plugin and the mouse-tracking extension, yes, they can work together.

let jsPsych = initJsPsych({extensions: [{type: jsPsychExtensionMouseTracking, params: {minimum_sample_time: 50}}]});

let trial = {
    type: jsPsychExternalHtml,
    url: './test.html',
    cont_btn: 'start',
    execute_script: true,
    force_refresh: true,
    extensions: [{type: jsPsychExtensionMouseTracking, params: {targets: ['#jspsych-content']}}],
    on_finish: function (data) {
        console.log(data);
    }
};

jsPsych.run([trial]);

I use the code from the documentation (see here) in my test.html.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@L0i0n0a
Comment options

Answer selected by L0i0n0a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants