script for a word stem completion task.


Author
Message
MattO
MattO
Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)
Group: Forum Members
Posts: 15, Visits: 1

Hi,


Does anyone know how to write a script for a word stem completion task? Basically what I want to do is this - Present a few sentences on screen with the last word of the paragraph missing two letters (which the participant enters the missing letters using the keyboard). For example....


"You are starting a new job. On your first day of work, you experience a number of unwanted thoughts. Regaining control of all unwanted thoughts should be d_ffic_lt."


In this example, the last word should read "difficult". I want to program it so the participant has to use the keyboard to enter the letters "i" and "u" to form the word "difficult". I also want it to provide feedback so that if the participant does not enter the correct letters the program will not move on until the correct letters are entered. Is this possible?


Is it also possible to randomly generate which two letters are missing each time? For example, the next time the script is run it might read "di_fi_ult" rather than "d_ffic_lt", for instance.


Thanks


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: 108K

Yes, that's certainly possible to do. You'll want to use


- the <openended> element to collect responses


- string functions and conditional logic via /ontrialbegin, /ontrialened, <values> and <expressions> to manipulate your stims (i.e., remove certain letters at random)


- the /isvalidresponse and /iscorrectresponse to check the entered response


Hope this helps,


~Dave


MattO
MattO
Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)
Group: Forum Members
Posts: 15, Visits: 1

Thanks for your reply. With the <openended> element however, I'm only familiar with how create one text box per page with the "next" button directly underneath it.  To do what I have in mind would require two small text boxes on the one page that fit within the word in the place of the missing letters. I can't seem to work out how to do this. Is there an easy way for you to explain how this is done? 


Thanks for your help


Matt


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: 108K

Then you'll have to use <surveypage> elements with <textbox>es on them instead of <openended>. You'll have to fiddle around with their /position until they're in the right place. This will be rather painful, so I recommend you consider other options.


Regards,


~Dave


MattO
MattO
Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)
Group: Forum Members
Posts: 15, Visits: 1

Hi Dave,


I was just wondering something in relation to the /isvalidresponse thing. Let's just say I want to make it so that the "next" button wont work unless the subject enters the word "higher" into an open ended response box. How would I do that using either /isvalidresponse or /validresponse?


And what's the difference between /isvalidresponse and /validresponse?


thanks


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: 108K

<openended typehigher>
/ validresponse = ("higher")
</openended>


And what's the difference between /isvalidresponse and /validresponse?


/validresponse handles responses which you know in advance to be valid. /isvalidresponse is able to determine the validity at runtime via conditional logic, e.g.


<openended typehigher>
/ isvalidresponse = [contains(openended.typehigher.response, "higher")]
</openended>


which would look through the input and check whether the word "higher" is somewhere in there (possibly among other words and letters), i.e., typing "it's higher, dude!" would be deemed a valid response.


You'll find this covered in the respective documentation topics.


MattO
MattO
Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)Partner Member (827 reputation)
Group: Forum Members
Posts: 15, Visits: 1

Thanks for your reply. I tried this one,


<openended typehigher>
/ validresponse = ("higher")
</openended>


But for some reason on mine the next button will work when i type anything but "higher". So when i enter "higher" it wont move on. Is there something wrong at my end? or is there something else I need to modify? Also, how do I add multiple responses as valid for the same set. For example, suppose I wanted to make it valid for someone to enter either "higher" or "lower"?


Thanks


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: 108K

Is there something wrong at my end


Sounds like it. Or it might be bug in the public Inquisit 4 beta version, if that's what you're using presently (in which case you should report it to inquisit@millisecond.com).


For example, suppose I wanted to make it valid for someone to enter either "higher" or "lower"?


Then you specify them both in /validresponse.


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search