Fix broken examples: replace jsPsych.timelineVariable with evaluateTimelineVariable in parameter functions - #3614
Conversation
|
Co-authored-by: jodeleeuw <595524+jodeleeuw@users.noreply.github.com>
…imelineVariable in functions Co-authored-by: jodeleeuw <595524+jodeleeuw@users.noreply.github.com>
|
@copilot can you check if there are any other examples in the documentation where |
I've completed a comprehensive search of all documentation ( The good news is that there are no other instances that need to be fixed. The two files I already corrected in commit d11ea3e were the only ones with this issue:
All other uses of |
Summary
This PR fixes two example files that were incorrectly using
jsPsych.timelineVariable()inside parameter functions. According to jsPsych best practices,jsPsych.evaluateTimelineVariable()should be used when referencing timeline variables within functions, as it immediately evaluates the variable's current value, whilejsPsych.timelineVariable()creates a placeholder for delayed evaluation.Changes
examples/jspsych-canvas-keyboard-response.htmljsPsych.timelineVariable()withjsPsych.evaluateTimelineVariable()inside thestimulusfunctionBefore:
After:
examples/timeline-variables.htmljsPsych.timelineVariable('v2', true)withjsPsych.evaluateTimelineVariable('v2')inside thepromptfunctionBefore:
After:
Verification
jspsych-canvas-button-response.htmlFixes #[issue number]
Original prompt
Fixes #3613
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.