August 1, 2019 at 4:51 am #4048
I tried to create a table as following example:
2,1,9,SocStat,yes,high,1,Ich denke, du bist gross.
2,1,10,SocStat,yes,high,1,Ich Du weißt, er ist reich.
2,1,11,SocStat,yes,high,1,Sie fühlt sich gut.
2,1,12,SocStat,yes,high,1,Wir gehen gerne spazieren.
2,1,13,SocStat,yes,high,2,Das Wetter ist schön.
My Items are the last sentences, so I tried the following command:
variable => PennController(
.log( “grammaticallycorrect” , variable.grammaticallycorrect )
I put “.log( “grammaticallycorrect” , variable.grammaticallycorrect )” to see in results wich condition the participant has evaluated.
I think there is something I do not understand, because It does not work. I tried it in a few ways but I just does not work. Moreover I need three slides after every Item.
Do you have any solution? It would be great, if you could help me.
Kind regardsAugust 1, 2019 at 12:40 pm #4049
This code works just fine for me:
PennController.ResetPrefix(null); PennController.AddTable( "matable" , "List,Block,Item,expSet,grammaticallycorrect,SocStat_context,SocStat_contextVers,Sentence\n"+ "2,1,9,SocStat,yes,high,1,Ich denke&\#44; du bist gross.\n"+ "2,1,10,SocStat,yes,high,1,Ich Du weißt&\#44; er ist reich.\n"+ "2,1,11,SocStat,yes,high,1,Sie fühlt sich gut.\n"+ "2,1,12,SocStat,yes,high,1,Wir gehen gerne spazieren.\n"+ "2,1,13,SocStat,yes,high,2,Das Wetter ist schön." ) PennController.Template( "matable" , variable => PennController( newText(variable.Sentence) .print() , newButton("wait").print().wait() ) .log( "grammaticallycorrect" , variable.grammaticallycorrect ) )
Note that I added a button on which to click so that each trial doesn’t end as soon as it starts, and I replaced the commas in your sentence with , so they don’t get misinterpreted as separating cells.
I do see “yes” in my results file for all the trials (since it is the only value for grammaticallycorrect in your table).
Let me know if you have questions
JeremyAugust 1, 2019 at 3:28 pm #4050
Thank you so much, it works!
the list I have sent you has originally 172 items. I created a csv file and uploaded it to chunk_includes.
In your example you added the list directly to PennController, do I understand it right?
MogliAugust 12, 2019 at 11:20 am #4052
Sorry for the late reply. In my example I use the command AddTable as a way to add a table directly from the script. This way, it should work no matter what table you have uploaded to your project otherwise.
You can indeed delete the AddTable bit from the code I posted, and upload a CSV file instead as you mention. Just make sure to use the appropriate name to refer to your table in Template (or you can also just not refer to your table at all there if you updated only one).
JeremyAugust 12, 2019 at 1:14 pm #4057
It works perfectly and is much easier that way. But there is one problem left: If I replace the commas in the cvs-file in the sentences like you did (&\#44;), it gets not interpreted like a comma. Instead it shows: „Ich befürchte&\#44; dass die Strecke wegen des frühen Rennens umgeleitet ist.“
And if I write a normal comma it gets misinterpreted and Ibex shows just the first two words. Do you have a solution for that?
Thank you a lot for your help.
MogliAugust 12, 2019 at 1:22 pm #4058
I only inserted the backslash symbol because otherwise the forums would have printed a real comma in my code examples and that would have defeated my purposes. You can try without the backslash symbol, or with %2C instead.
Alternatively, if you use a spreadsheet editor to modify your CSV file, you can try using normal commas in your sentences, but quote your text cells. In LibreOffice Calc for example, you can check “Edit filter settings” when saving your file and then you will be prompted with an option window where you can check “Quote all text cells.” Maybe that would work.
JeremyAugust 12, 2019 at 1:46 pm #4059
Now it works.
One last question:
I have 3 slides after every Item; Is there a possibility to show one slide after another? That the participant click the first slide, than it disappears and the next one comes up, and than the same for the last?
These are my slides:
newText(“Skala2”, “Wie akzeptabel finden Sie den Satz?”)
newCanvas(“empty canvas6”, 1, 40)
.settings.before( newText(“left1”, “1 <br /> (am unakzeptabelsten)”) )
.settings.after( newText(“right2”, “7 <br /> (am akzeptabelsten)”) )
newCanvas(“empty canvas5”, 1,40)
newCanvas(“empty canvas11”, 1, 40)
newText(“Skala3”, “Würden Sie den Satz selbst schreiben?”)
newCanvas(“empty canvas7”, 1,40)
newScale(“Würden Sie den Satz selbst schreiben?1”, 7)
.settings.before( newText(“left3”, “1 <br /> (nein)”) )
.settings.after( newText(“right3”, “7 <br /> (ja)”) )
)August 12, 2019 at 2:34 pm #4060
You probably want to use the remove command. For example:
newScale("akzeptabilität", 7) .settings.before( newText("left1", "1
(am unakzeptabelsten)") ) .settings.after( newText("right2", "7
(am akzeptabelsten)") ) .settings.slider() .print() .settings.log() .wait() .remove() , getText("Skala2") .remove()August 14, 2019 at 12:07 pm #4064
Thank you again.
I tried a few commands to have something like a time-out, but it does not work. It means if a participant is not fast enough to klick the slide (e.g. longer than 4 sec) I want to skip to the next slide. Is all this together possible?
Furthermore, if I run the experiment, there is always the little PennController window in the corner right, is it possible to avoid this?August 14, 2019 at 1:13 pm #4065
You can turn off the debugger using PennController.DebufOff() in your script (e.g. place it at the very top or at the very bottom). I would recommend keeping it on until you’re ready to publish your experiment though, as it can provide you with very useful messages in case of errors.
It is possible to code a timeout, but it’s not entirely straightforward as it means that the trial has two possible outcomes when, usually, the single outcome is “selection happens.” What you can do is launch a 4s timer and wait for it to end, and tell your slider to end your timer early when selection happens.
Now, I just realized that PennController 1.3 introduced a bug with timer.stop so we’ll need a little trick: we’ll create a button that we never print, and we’ll wait for a click on it and make both the slider and the timer click it:
newButton("validate", "") , newScale("akzeptabilität", 7) .settings.before( newText("left1", "1
(am unakzeptabelsten)") ) .settings.after( newText("right2", "7
(am akzeptabelsten)") ) .settings.slider() .settings.callback( getButton("validate").click() ) // will click the button when the slider is moved .print() .settings.log() , newTimer(4000) .settings.callback( getButton("validate").click() ) // will click the button when the timer ends .start() , getButton("validate") .wait()August 15, 2019 at 4:16 am #4083
unfortunately the slide does not disappear after clicking it or after the timer has expired. Is there a way to solve this?
MogliAugust 15, 2019 at 10:52 am #4086
Did you add the command
waitcommand on the button?
JeremyAugust 15, 2019 at 11:25 am #4096
Now everything is fine. Thank you!
You must be logged in to reply to this topic.