mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 03:00:54 +00:00
fix to use evaluateTimelineVariable
This commit is contained in:
parent
6470d4092c
commit
2f859b8887
@ -387,7 +387,7 @@ Rather than repeating a question format within the same trial, perhaps you want
|
||||
elements: [
|
||||
{
|
||||
type: "text",
|
||||
title: `Enter a word related to ${jsPsych.timelineVariable('word').toUpperCase()}:`,
|
||||
title: `Enter a word related to ${jsPsych.evaluteTimelineVariable('word').toUpperCase()}:`,
|
||||
autocomplete: "off"
|
||||
}
|
||||
],
|
||||
@ -416,7 +416,7 @@ Rather than repeating a question format within the same trial, perhaps you want
|
||||
// Create question using timeline variables
|
||||
const page = survey.addNewPage('page1');
|
||||
const question = page.addNewQuestion('text');
|
||||
question.title = `Enter a word related to ${jsPsych.timelineVariable('word').toUpperCase()}`;
|
||||
question.title = `Enter a word related to ${jsPsych.evaluateTimelineVariable('word').toUpperCase()}`;
|
||||
question.autocomplete = "off";
|
||||
// Set survey-level parameters
|
||||
survey.showQuestionNumbers = false;
|
||||
|
@ -32,7 +32,7 @@
|
||||
type: jsPsychHtmlKeyboardResponse,
|
||||
stimulus: ()=>{
|
||||
let html = `<div style="width:100vw; height:100vh; position: relative;">
|
||||
<div style="width:15px; height:15px; border-radius:15px; background-color: #000; position:absolute; top: ${jsPsych.timelineVariable('y')}%; left: ${jsPsych.timelineVariable('x')}%;"></div>
|
||||
<div style="width:15px; height:15px; border-radius:15px; background-color: #000; position:absolute; top: ${jsPsych.evaluateTimelineVariable('y')}%; left: ${jsPsych.evaluateTimelineVariable('x')}%;"></div>
|
||||
</div>`;
|
||||
return html;
|
||||
},
|
||||
|
@ -109,8 +109,8 @@
|
||||
stimulus: function () {
|
||||
return(
|
||||
`<div style="position: relative; width: 400px; height: 400px;">
|
||||
<div style="position: absolute; top:${jsPsych.timelineVariable('top', true)}%; left: ${jsPsych.timelineVariable('left', true)}%">
|
||||
<span id="arrow-target" style="font-size: 40px; transform: translate(-50%, -50%);">${jsPsych.timelineVariable('direction', true) == 'left' ? '⬅' : '➡'}</span>
|
||||
<div style="position: absolute; top:${jsPsych.evaluateTimelineVariable('top', true)}%; left: ${jsPsych.evaluateTimelineVariable('left', true)}%">
|
||||
<span id="arrow-target" style="font-size: 40px; transform: translate(-50%, -50%);">${jsPsych.evaluateTimelineVariable('direction', true) == 'left' ? '⬅' : '➡'}</span>
|
||||
</div>
|
||||
</div>`
|
||||
)
|
||||
|
@ -100,7 +100,7 @@
|
||||
type: jsPsychHtmlKeyboardResponse,
|
||||
stimulus: function () {
|
||||
var html = `
|
||||
<div style="display:flex;width:70%;margin:auto;justify-content:space-around;"><span>${jsPsych.timelineVariable('word1')}</span><span>${jsPsych.timelineVariable('word2')}</span></div>`;
|
||||
<div style="display:flex;width:70%;margin:auto;justify-content:space-around;"><span>${jsPsych.evaluateTimelineVariable('word1')}</span><span>${jsPsych.evaluateTimelineVariable('word2')}</span></div>`;
|
||||
return html;
|
||||
},
|
||||
choices: ['f', 'j'],
|
||||
@ -112,7 +112,7 @@
|
||||
survey_json: function () {
|
||||
const last_response = jsPsych.data.getLastTrialData().values()[0].response;
|
||||
const response_type = (last_response === 'j') ? "RELATED" : "NOT RELATED";
|
||||
const question_text = `You said that the words "${jsPsych.timelineVariable('word1')}" and "${jsPsych.timelineVariable('word2')}" are ${response_type}. Please explain your answer.`;
|
||||
const question_text = `You said that the words "${jsPsych.evaluateTimelineVariable('word1')}" and "${jsPsych.evaluateTimelineVariable('word2')}" are ${response_type}. Please explain your answer.`;
|
||||
const survey_json = {
|
||||
showQuestionNumbers: false,
|
||||
completeText: "Next",
|
||||
|
Loading…
Reference in New Issue
Block a user