PennController for IBEX › Forums › Support › logging spreadsheet info
Tagged: .log(); results file
- This topic has 11 replies, 2 voices, and was last updated 3 years, 8 months ago by snederve.
September 18, 2019 at 2:29 pm #4170
My entire experiment works, loading items from a spreadsheet. I’m running latin-square in groups and that, too, works fine. I have divided up the groups in ABCD, but not all As are manipulated for the same variable. That is to say, the ABCD is used for even distribution, but I use another column “Class” to further specify the variable manipulation for my items.
I used .log( “Class” , row.Class ) right after the closing parenthesis of PennController – the tutorial said that this command would record the value for the the column ‘Class’ for each row. This doesn’t happen. If I put the command after the closing parenthesis of PennController, I don’t get it recorded in my results, and if I put it in any other place (including right before closing PennC parenthesis) my experiment doesn’t load.
Here’s my opening code for the PennController:
PennController.Template( “CSV_ITEMS_Diff.csv”, // No need to setGroup: columns named “Group” are automatically detected as such
item => PennController(“Class”,
newText( “sentence” , item.Sentence )
–some code in between that make the spreadsheet items appear– end of PennController code —>
So wherever I put my .log( “Class” , row.Class ) command, the results file fails to record it. Am I doing something wrong?
SanderSeptember 18, 2019 at 3:13 pm #4171
It looks like you named your pointer item and not row (expression to the immediate left of =>) so you should use item.Class
JeremySeptember 18, 2019 at 3:23 pm #4172
Thanks. It still doesn’t seem to work. My results file will only give a column in which it states “Class”, but not the value of Class for each item.
Is there any way to log the values within the column, rather than just the column header? Thanks.
SanderSeptember 18, 2019 at 3:33 pm #4173
Did you make sure that the colum name in your table’s header row matches the case of row.Class (i.e. are you sure you column’s name is exactly Class)?
Here is a very short illustration:
PennController.AddTable( "dummyTable" , `Class,Word,Group Upper,Hello,A Lower,hello,B Lower,world,A Upper,World,B` ); PennController.Template( "dummyTable" , item => PennController( newButton(item.Word).print().wait() ).log( "Class" , item.Class ) )September 18, 2019 at 3:40 pm #4174
In my CSV file, the headers are as follows:
Label Class Group Sentence Sagen Claim Question
Rating VF-1 A bla bla bla bla
Rating V2-1 B bla bla bla bla
Rating EVF-1 C bla bla bla bla
Rating EV2-1 D bla bla bla bla
So I want the VF-1, V2-1, EVF-1, EV2-1, recorded for each item, but I feel like you already got that…
SanderSeptember 18, 2019 at 3:54 pm #4175
Do you have a link to your experiment?
If I adapt your example table to my example code above, the content of the “Class” cell gets recorded:
PennController.ResetPrefix(null); PennController.AddTable("dummyTable", `Label,Class,Group,Sentence,Sagen,Claim,Question Rating,VF-1,A,bla,bla,bla,bla Rating,V2-1,B,bla,bla,bla,bla Rating,EVF-1,C,bla,bla,bla,bla Rating,EV2-1,D,bla,bla,bla,bla`); PennController.Template( "dummyTable" , item => PennController( newButton( item.Sentence ).print().wait() ).log( "Class" , item.Class ) )September 18, 2019 at 4:03 pm #4176
This is the link to my experiment:
Here’s a link to the zipped folder in which the entire experiment (including CSV) is stored: https://vault.sfu.ca/index.php/s/lRydTawHYdU5oAH
It’s not with the ABCD groups, but just list A – but I figure that once it is fixed in one list, I can apply that to the others.
Thanks!September 18, 2019 at 4:04 pm #4177
Another link to the zipped folder. I first accidentally used password protection.September 18, 2019 at 4:10 pm #4178
Thanks—I’ll give it a closer look later, but just double-checking first: did you try calling .log("Class", item.Class) on the closing parenthesis of PennController() too since you changed to item? Looking at your current script, it is called on the closing parenthesis of PennController.Template(), which it shouldn’tSeptember 18, 2019 at 4:57 pm #4179
It’s always something small I suppose. I didn’t putt the command behind the right parenthesis. Thanks for pointing that out, it now works!
Thanks a lot!
-SSeptember 19, 2019 at 12:23 pm #4182
Glad we got it to work eventually!
Just a quick question though: do you remember if you had the debugger turned off when you were trying to log with row instead of item? I’m asking because you should get a related error message in the debugger’s Error tab in those cases, and I can’t seem to reproduce an absence-of-error-message bug (which I’d like to fix if it indeed occurs).
Also, FYI, the next release of PennController will trigger specific error messages when you attempt to use a command on Template() that should be used on PennController().September 19, 2019 at 12:26 pm #4183
Oh yes, I had the debugger turned off — good call: should keep it on while work is in progress.
Good info to know about the next release, I’ll hopefully keep using PennController for the next few years 🙂
- You must be logged in to reply to this topic.