Skip to content

Commit

Permalink
fix to use evaluateTimelineVariable
Browse files Browse the repository at this point in the history
  • Loading branch information
jadeddelta committed Nov 20, 2024
1 parent 6470d40 commit 2f859b8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/overview/building-surveys.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
],
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion examples/extension-record-video.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
4 changes: 2 additions & 2 deletions examples/webgazer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>`
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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",
Expand Down

0 comments on commit 2f859b8

Please sign in to comment.