Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow functions for individual elements in data parameter #562

Closed
jodeleeuw opened this issue Sep 4, 2018 · 1 comment
Closed

Allow functions for individual elements in data parameter #562

jodeleeuw opened this issue Sep 4, 2018 · 1 comment
Milestone

Comments

@jodeleeuw
Copy link
Member

Allow things like:

var trial = {
  // ...
  data: {
     round: function() { return round_index; },
     type: 'foo'
  }
}
@jodeleeuw jodeleeuw added this to the 6.1 milestone Sep 4, 2018
@jodeleeuw jodeleeuw modified the milestones: 6.1, 6.0.5 Oct 3, 2018
@wolfgangwalther
Copy link
Contributor

And while at it maybe a helper function that could replace code like this:

var trial = {
  data: {
    a: jsPsych.timelineVariable('a'),
    b: jsPsych.timelineVariable('b'),
    c: jsPsych.timelineVariable('c'),
    d: 'static'
  }
}

with this:

var trial = {
  data: jsPsych.HelpMeGetAllTimelineVariables({
    d: 'static'
  })
}

This helper would then merge the object given as argument with all available timelineVariables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants