Psych_Josh
|
|
Group: Forum Members
Posts: 85,
Visits: 397
|
Hi Dave,
Thanks for the info - I ended up using the simple calculation of:
/ontrialend = [values.scorecorrected = values.score + ((values.clock_number-1) * 7) + 6], though I did take your suggestion and find it to be very helpful.
Many thanks again, Josh
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
I'd also add the following, perhaps it's helpful: (1) If you are unsure about the math you want to / need to do, work it out with paper and pencil first. (You've probably already done this, at least that's how I read your previous comments on the topic "[...] Trying this with some of the videos has confirmed this; i.e., values.difference (i.e., values.score (the computed position of the clock-hand) - values.response (the reported time of the participant)) is consistently out by 28 (give or take +1 or -1 for human error), when using the video "libet28.avi"".) (2) Before implementing that math into the "full" script, make a small demo that does *just* the math. Take https://www.millisecond.com/forums/FindPost18581.aspx and extend it to deal with the correction factors associated with the various clock item start positions. (3) Once you have (2) working as you want / need, implement the changes in the full script.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
/ontrialend = [if (list.clock == 2) ...
does not access any list-property and will thus never evaluate to true and the logic will never be executed.
It would have to read something along the lines of
/ontrialend = [if (list.clock.currentvalue == 2) ...
Why don't you simply store the "correction factor" associated with each itemnumber in a <list> tied to the itemnumber <list>. Pull that correction from the list after you've selected the itemnumber /onblockbegin and store it in a value. Subtract that value from the score, etc. at the appropriate point in time.
|
|
|
Psych_Josh
|
|
Group: Forum Members
Posts: 85,
Visits: 397
|
Hi Dave,
Thanks for the info. In an attempt to adjust the calculations, I think I might be committing an error, as I acquire variously wrong results.
I have tried both I have tried both:
/ontrialend = [if (list.clock == 2) {values.score = values.score - 7} else if (list.clock == 3) {values.score = values.score - 14} else if (list.clock == 4) {values.score = values.score - 21} else if (list.clock == 5) {values.score = values.score - 28} else if (list.clock == 6) {values.score = values.score - 35} else if (list.clock == 7) {values.score = values.score - 48} else if (list.clock == 8) {values.score = values.score - 54} else if (list.clock) = 1 {true}]
within:
<trial audio_p_aa> /ontrialbegin = [values.audiotrial_starttime = block.rotate_p_block_aa.elapsedtime] /ontrialbegin = [trial.audio_p_aa.insertstimulustime(sound.possounds, values.delay = 258)] /ontrialend = [values.sound_starttime = values.audiotrial_starttime + sound.possounds.stimulusonset] /ontrialend = [trial.audio_p_aa.resetstimulusframes(0)] /ontrialend = [values.onset = values.sound_starttime - values.response_time] /ontrialend = [values.sound = sound.possounds.currentitem] /ontrialend = [values.score = (mod(values.sound_starttime,2500) - values.responsetrial_starttime)/41.6667] /ontrialend = [values.valence = "Positive"] /ontrialend = [values.elapsed_time = block.rotate_p_block_aa.elapsedtime; values.actual_time = values.sound_starttime + values.keep_rotating_for] /validresponse = (0) /trialduration = values.delay + values.keep_rotating_for + 1000 /recorddata = false </trial>
, as well as:
/ontrialbegin = [if (list.clock == 2) {values.difference = values.difference + 7} else if (list.clock == 3) {values.difference = values.difference + 14} else if (list.clock == 4) {values.difference = values.difference + 21} else if (list.clock == 5) {values.difference = values.difference + 28} else if (list.clock == 6) {values.difference = values.difference + 35} else if (list.clock == 7) {values.difference = values.difference + 48} else if (list.clock == 8) {values.difference = values.difference + 54} else if (list.clock) = 1 {true}]
within:
<openended action> /stimulusframes = [1 = action] /position = (50, 50) /buttonlabel = "Click here to advance" /linelength = 50 /charlimit = 30 /numlines = 1 /size = (500, 50) /recorddata = true /required = true /ontrialend = [values.response = openended.action.response] /ontrialend = [values.question = "Action"] /ontrialend = [values.difference = expressions.score] </openended>
These take their information from:
<video clock> /items = ("libet0.avi", "libet7.avi", "libet14.avi", "libet21.avi", "libet28.avi", "libet35.avi", "libet48.avi", "libet54.avi") /select = values.clockitem /playthrough = false /loop = true /erase = false /size = (20%, 20%) </video>
<list clock> /items = (1,2,3,4,5,6,7,8) /replace = false /selectionmode = random </list>
I don't profess to be anywhere near proficient at conditional logic, but I don't receive an error message when coding either into the script. Essentially, they are not modifying value.score nor values.difference in any way that I can observe, and certainly not towards acquiring the correct results. If you have the time (and the energy left for this script, as I know mine is significantly waning), please tell me where I've gone wrong.
Many thanks, Josh
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
Typo on my part -- I meant
<video clock> ... </video>
as should be clear from the context.
As for the math: The math doesn't change. You know which video item was selected / shown (look at and log values.clockitem) and thus where the respective clock started. Adjust your various calculations accordingly.
|
|
|
Psych_Josh
|
|
Group: Forum Members
Posts: 85,
Visits: 397
|
Hi Dave,
Thanks - pardon if the solution was simpler than I was anticipating.
I've tried the <clock clock> solution, but I'm receiving an error saying that the setting has invalid text (i.e., / items...; thus presenting the standard digital clock Inquisit uses).
As for the math, I was only concerned that if the video starts from a different position (i.e., 7), then the recorded time of the sound occurrence will be askew by 7. Trying this with some of the videos has confirmed this; i.e., values.difference (i.e., values.score (the computed position of the clock-hand) - values.response (the reported time of the participant)) is consistently out by 28 (give or take +1 or -1 for human error), when using the video "libet28.avi".
Many thanks, Josh
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
You incorporate them into the script just like any other stimulus with multiple items. Set up a single <video> element, with the eight AVIs as its items. Select one of the itemnumbers 1-8 /onblockbegin via a <list>.
<values> ... / clockitem = 1 ... </values>
<clock clock> / items = ("libet.avi", "libet7.avi", ...) ... / select = values.clockitem ... </clock>
<list clockitemnumbers> / items = (1,2,3,4,5,6,7,8) </list>
<block rotate_p_block_aa> / onblockbegin = [values.clockitem = list.clockitemnumbers.nextvalue] /bgstim = (clock) /trials = [1 = response_p_aa; 2 = audio_p_aa] /branch = [block.estimate_block_action_a] </block>
Beyond that, I'm not sure what you mean with "obviously ensure that the data recorded is accurate, given that originally it was simply a method of measuring the elapsed time of the trial and corresponding that to a position on the clock."
We've discussed the math involved at length in this thread and I would assume that all of that still applies.
|
|
|
Psych_Josh
|
|
Group: Forum Members
Posts: 85,
Visits: 397
|
Hi Dave,
The study has run smoothly, however one extension I'd like to add is the use of multiple clocks to achieve multiple starting points of the clock-hand. Essentially, I have created 7 extra videos where the clock starts elsewhere on the clock, and rotates as usual. These are all fine, except I was wondering how to implement these into the script, and obviously ensure that the data recorded is accurate, given that originally it was simply a method of measuring the elapsed time of the trial and corresponding that to a position on the clock.
For example, I have:
<video clock1> /items = ("libet.avi") /playthrough = false /loop = true /erase = false /size = (20%, 20%) </video>
<video clock2> /items = ("libet7.avi") /playthrough = false /loop = true /erase = false /size = (20%, 20%) </video>
<video clock3> /items = ("libet14.avi") /playthrough = false /loop = true /erase = false /size = (20%, 20%) </video>
<video clock4> /items = ("libet21.avi") /playthrough = false /loop = true /erase = false /size = (20%, 20%) </video>
<video clock5> /items = ("libet28.avi") /playthrough = false /loop = true /erase = false /size = (20%, 20%) </video>
<video clock6> /items = ("libet35.avi") /playthrough = false /loop = true /erase = false /size = (20%, 20%) </video>
<video clock7> /items = ("libet48.avi") /playthrough = false /loop = true /erase = false /size = (20%, 20%) </video>
<video clock8> /items = ("libet54.avi") /playthrough = false /loop = true /erase = false /size = (20%, 20%) </video>
The number within the file name represents the time/starting position of the clock-hand (bar the first clock).
The block thus looks presently like this:
<block rotate_p_block_aa> /bgstim = (clock1) /trials = [1 = response_p_aa; 2 = audio_p_aa] /branch = [block.estimate_block_action_a] </block>
<trial response_p_aa> /ontrialbegin = [values.responsetrial_starttime = block.rotate_p_block_aa.elapsedtime] /correctresponse = (57) /ontrialend = [values.response_time = block.rotate_p_block_aa.elapsedtime] /recorddata = false </trial>
<trial audio_p_aa> /ontrialbegin = [values.audiotrial_starttime = block.rotate_p_block_aa.elapsedtime] /ontrialbegin = [trial.audio_p_aa.insertstimulustime(sound.possounds, values.delay = 258)] /ontrialend = [values.sound_starttime = values.audiotrial_starttime + sound.possounds.stimulusonset] /ontrialend = [trial.audio_p_aa.resetstimulusframes(0)] /ontrialend = [values.onset = values.sound_starttime - values.response_time] /ontrialend = [values.sound = sound.possounds.currentitem] /ontrialend = [values.score = (mod(values.response_time,2500) - values.responsetrial_starttime)/41.6667] /ontrialend = [values.valence = "Positive"] /ontrialend = [values.elapsed_time = block.rotate_p_block_aa.elapsedtime; values.actual_time = values.sound_starttime + values.keep_rotating_for] /validresponse = (0) /trialduration = values.delay + values.keep_rotating_for + 1000 /recorddata = false </trial>
Please let me know if you need anymore information.
Many thanks, Josh
|
|
|
Psych_Josh
|
|
Group: Forum Members
Posts: 85,
Visits: 397
|
Hi Dave,
Thanks for the info. You have been an enormous help through this study-creation - pardon the many questions due to my novice programming skills.
Many thanks again, Josh
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
Thanks. That's probably a codec problem then. VLC comes with its own set of binary codecs -- it does not use the codecs that are available system-wide, which are the ones other applications -- including Inquisit -- rely on.
|
|
|