Task Breaks Upon User Input


Author
Message
DCole9
DCole9
Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)
Group: Forum Members
Posts: 42, Visits: 220
Hey Inquisiteers,
I'm having an issue where my task will suddenly quit when a user inputs a value.  I had the experiment working but made some (what I thought were) minor changes and now it will not continue to the next trial.  Here is the problem code.. I would very much appreciate any help you could offer.


<trial InitialSelect>

/ontrialbegin = [values.responseRT = 0; values.numtrials += 1; values.numblock += 1]
/ontrialbegin = [values.startcolor = list.startcolor.nextvalue]
/ontrialbegin = [values.numcolor = values.startcolor]
/ontrialbegin = [values.lownumcolor = values.numcolor]
/ontrialbegin = [values.highnumcolor = values.numcolor]
/ontrialbegin = [text.highnumber.textcolor = values.numcolor]
/ontrialbegin = [text.lownumber.textcolor = values.numcolor]

/ontrialbegin = [text.highnumber.item.1 = list.numberlist.nextvalue]
/ontrialbegin = [text.lownumber.item.1 = text.highnumber.item.1]
/ontrialbegin = [values.number = text.highnumber.item.1]

/ontrialbegin = [values.stiminterval = list.stimulusinterval.nextvalue]
/ontrialbegin = [values.randomposition = list.randomposition.nextvalue]
/ontrialbegin = [values.randomdemand = list.randomdemand.nextvalue]


/ontrialbegin = [if ((values.number == "1") || (values.number == "3") || (values.number == "7") || (values.number == "9")) values.odd = 1 else values.odd = 0]
/ontrialbegin = [if ((values.number == "2") || (values.number == "4") || (values.number == "6") || (values.number == "8")) values.even = 1 else values.even = 0]
/ontrialbegin = [if ((values.number == "1") || (values.number == "2") || (values.number == "3") || (values.number == "4")) values.lowerthan = 1 else values.lowerthan = 0]
/ontrialbegin = [if ((values.number == "6") || (values.number == "7") || (values.number == "8") || (values.number == "9")) values.greaterthan = 1 else values.greaterthan = 0]

/ontrialbegin = [values.topchosen = 0; values.bottomchosen = 0; values.choiceRT = 0;
values.topchosenRT = 0; values.bottomchosenRT = 0; values.lowdemandchoiceRT = 0; values.highdemandchoiceRT = 0; values.trialelapsedtime = 0;
values.failed = 0; values.patch1chosencount = 0; values.patch2chosencount = 0; values.lowdemandchosen = 0; values.highdemandchosen = 0
]

/ontrialbegin = [if (values.randomposition == "1") values.patch1y = 40%]
/ontrialbegin = [if (values.randomposition == "1") values.patch2y = 60%]
/ontrialbegin = [if (values.randomposition == "2") values.patch1y = 60%]
/ontrialbegin = [if (values.randomposition == "2") values.patch2y = 40%]


/ontrialbegin = [text.diceroll.item.1 = list.rolldice.nextvalue]
/ontrialbegin = [values.diceoutcome = text.diceroll.item.1]

/ontrialbegin = [if (values.numblock == 1) {trial.initialselect.insertstimulusframe(picture.patch2, 1); trial.initialselect.insertstimulusframe(picture.patch1, 1)}]
/ontrialbegin = [if (values.numblock == 2) {trial.initialselect.insertstimulusframe(picture.patch3, 1); trial.initialselect.insertstimulusframe(picture.patch4, 1)}]
/ontrialbegin = [if (values.numblock == 3) {trial.initialselect.insertstimulusframe(picture.patch5, 1); trial.initialselect.insertstimulusframe(picture.patch6, 1)}]
/ontrialbegin = [if (values.numblock == 4) {trial.initialselect.insertstimulusframe(picture.patch7, 1); trial.initialselect.insertstimulusframe(picture.patch8, 1)}]


/stimulusframes = [1 = choose]
/validresponse = (20, 48)

/timeout = 5000

/ontrialend = [if ((trial.InitialSelect.response == "20") && (values.randomposition == "1")) values.topchosen = 1; values.patch1chosencount = 1; values.patch2chosencount = 0]
/ontrialend = [if ((trial.InitialSelect.response == "20") && (values.randomposition == "1")) values.totaltopchosencount += 1; values.totalpatch1chosencount += 1]
/ontrialend = [if ((trial.InitialSelect.response == "20") && (values.randomposition == "1")) values.topchosenRT = trial.initialselect.elapsedtime; values.responseRT = trial.initialselect.elapsedtime]

/ontrialend = [if ((trial.InitialSelect.response == "48") && (values.randomposition == "1")) values.bottomchosen = 1; values.patch2chosencount = 1; values.patch1chosencount = 0]
/ontrialend = [if ((trial.InitialSelect.response == "48") && (values.randomposition == "1")) values.totalbottomchosencount += 1; values.totalpatch2chosencount += 1]
/ontrialend = [if ((trial.InitialSelect.response == "48") && (values.randomposition == "1")) values.bottomchosenRT = trial.initialselect.elapsedtime; values.responseRT = trial.initialselect.elapsedtime]

/ontrialend = [if ((trial.InitialSelect.response == "48") && (values.randomposition == "2")) values.bottomchosen = 1; values.patch1chosencount = 1; values.patch2chosencount = 0]
/ontrialend = [if ((trial.InitialSelect.response == "48") && (values.randomposition == "2")) values.totalbottomchosencount += 1; values.totalpatch1chosencount += 1]
/ontrialend = [if ((trial.InitialSelect.response == "48") && (values.randomposition == "2")) values.bottomchosenRT = trial.initialselect.elapsedtime; values.responseRT = trial.initialselect.elapsedtime]

/ontrialend = [if ((trial.InitialSelect.response == "20") && (values.randomposition == "2")) values.topchosen = 1; values.patch2chosencount = 1; values.patch1chosencount = 0]
/ontrialend = [if ((trial.InitialSelect.response == "20") && (values.randomposition == "2")) values.totaltopchosencount += 1; values.totalpatch2chosencount += 1]
/ontrialend = [if ((trial.InitialSelect.response == "20") && (values.randomposition == "2")) values.topchosenRT = trial.initialselect.elapsedtime; values.responseRT = trial.initialselect.elapsedtime]

/ontrialend = [values.response = trial.InitialSelect.response]
/ontrialend = [values.choicert = trial.InitialSelect.elapsedtime]
/ontrialend = [if ((values.topchosen == 0) && (values.bottomchosen == 0)) values.totalfailed += 1; values.failed = 1]
/ontrialend = [trial.initialselect.resetstimulusframes()]

/branch = [if (trial.initialselect.elapsedtime < 5000) trial.patchtrial]
/branch = [if (trial.initialselect.elapsedtime > 4999) trial.reselecttrial]

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
I'm fairly sure that question cannot be answered without (a) you detailing the changes you made between the two versions (working vs. non-working) and (b) providing code that's complete enough to actually run instead of an isolated excerpt.

DCole9
DCole9
Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)
Group: Forum Members
Posts: 42, Visits: 220
Hi Dave,
Thanks for the quick response.  I've uploaded the whole experiment.

The only change I have made is adding the lines that insert stimulus frames for different patches on different values of "numblock".
The issue comes when the user gives input for a trial.InitialSelect or trial.ReselectTrial.



Attachments
DemandSelection.iqx (291 views, 43.00 KB)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
Thanks for attaching the script. As far as I can tell, the script behaves and proceeds as it should. Could you please explain in more detail what exactly you mean by "[...] my task will suddenly quit when a user inputs a value [...]", i.e. what are you inputting (which key), what is the behavior you expect upon each input, what does "suddenly quit" mean specifically? The script just ends? Inquisit crashes? Something else?

In this context, I'm not sure how "suddenly quits" jibes with "it will not continue to the next trial". Does "quit" mean the script gets stuck in a specific trial, or does it simply terminate after a single trial? If the latter, I'm not sure how you would be able to tell that the problem occurs in both trial.initialselect and trial.reselecttrial.

It would be great if you could clarify that for me. Thanks!

Finally, to make sure we're on the same page, which Inquisit version are you running this under? If it is not the latest release (4.0.8.0), please update your installation.

DCole9
DCole9
Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)
Group: Forum Members
Posts: 42, Visits: 220
Hey Dave-
I am using Inquisit 4.0.8.

After going through the instructions trials the script brings me to my first trial which is the trial.InitialSelect.  Upon selecting one of the patches (through one of the valid response keys 'b' or 't') the script immediately closes/experiment stops running with no error message and the Inquisit program stays open.  If I wait for a timeout then the experiment continues running until I press a valid response key.
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
Hmm, weird. Not seeing that behavior, the script progresses as expected for me (upon pressing "t" or "b"). No error messages in the output? Any indications in the data file (what does it say in the trials response column, etc.)?

DCole9
DCole9
Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)
Group: Forum Members
Posts: 42, Visits: 220
I can't look at the output file since my trial version has run out and we have only purchased a web license version.  That is odd that you are able to progress to the next trial without issue though... Not sure what could be different between our two setups.
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
I'm not sure either. At any rate, I am unfortunately unable to reproduce the behavior you're experiencing using the script you attached. The only change I made to that script is switching the <picture> elements to <text> elements because I don't have your image files. I'm attaching that script as a reference. I don't see any obvious mistakes in the script and -- more importantly -- there is no reason why the added insertstimulusframe() logic should cause the script to disregard input. A couple of suggestion for moving on:
(1) Try rebooting your machine and see if the issue persists. Perhaps some system library crashed silently in the background or the like.
(2) Try if the attached <text>-only version exhibits the same issue for you.
(3) Try running the script via your web license if possible. The resulting data file might offer additional clues in case the issue also occurs when the script is run via the web on your machine.

Let me know what you find.

Attachments
DemandSelection.txt.iqx (270 views, 43.00 KB)
DCole9
DCole9
Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)
Group: Forum Members
Posts: 42, Visits: 220
Thanks a ton for all the help Dave.  I'll keep you posted.
DCole9
DCole9
Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)
Group: Forum Members
Posts: 42, Visits: 220
The <text> script you provided works... I guess something is off with my pictures or picture elements.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search