PennController for IBEX › Forums › Support › Comprehension questions for some test items in the following?
- This topic has 4 replies, 2 voices, and was last updated 3 years, 3 months ago by
jay0845.
-
AuthorPosts
-
October 19, 2021 at 9:16 am #7396
jay0845
ParticipantI am trying to set up the test items in such a way that for only some of the 7-point Likert-scale judgment task test items participants are required to determine whether a follow-up comprehension sentence is true or false without looking at the test item. For now, I have the following code for the test items:
Template("experiment-pg-norming.csv", row => newTrial( "experiment-"+row.TYPE, newText("sentence", row.SENTENCE) .cssContainer({"margin-top":"2em", "margin-bottom":"2em"}) .center() .print() , // 7-point scale newScale(7) .before( newText("left", "<div class='fancy'>(very unnatural)</div>") ) .after( newText("right", "<div class='fancy'>(very natural)</div>") ) .labelsPosition("top") .keys() .log() .once() .color("LightCoral") .center() .print() .wait() , // Wait briefly to display which option was selected newTimer("wait", 300) .start() .wait() )
For example, after they judge the acceptability of the test item “The neighbors like cats more than they do dogs.”, I want them to see a sentence like “The neighbors hate cats.” and to determine whether it is a true or false statement on the basis of the test item. Of course, this is to prevent participants from choosing random acceptability ratings. Any ideas of how to do it?
October 19, 2021 at 11:53 am #7400Jeremy
KeymasterHi,
You can include a column named FOLLOWUP in your file experiment-pg-norming.csv which you leave empty for the items where you don’t want a follow-up question, and which you fill with your follow-up question for the other items. Then you can do this:
Template("experiment-pg-norming.csv", row => newTrial( "experiment-"+row.TYPE, newText("sentence", row.SENTENCE) .cssContainer({"margin-top":"2em", "margin-bottom":"2em"}) .center() .print() , // 7-point scale newScale(7) .before( newText("left", "<div class='fancy'>(very unnatural)</div>") ) .after( newText("right", "<div class='fancy'>(very natural)</div>") ) .labelsPosition("top") .keys() .log() .once() .color("LightCoral") .center() .print() .wait() , // Wait briefly to display which option was selected newTimer("wait", 300) .start() .wait() , clear() , ...(row.FOLLOWUP ? [ newText("follow-up", row.FOLLOWUP) .cssContainer({"margin-top":"2em", "margin-bottom":"2em"}) .center() .print() , newScale("answer-follow-up", "Yes", "No") .button() .print() .wait() ] : [ null ]) ) )
Jeremy
-
This reply was modified 2 years ago by
Jeremy. Reason: added the missing ]
October 19, 2021 at 5:43 pm #7403jay0845
ParticipantThanks a lot, Jeremy, for your help, but now I get the errors for the addition of your code. What does “…(row.FOLLOWUP ? [” line does? Also, there are two opening square brackets and only one closing square bracket. Any further help would be really appreciated.
October 19, 2021 at 5:52 pm #7404Jeremy
KeymasterAdd the missing
]
before:
In javascript you can prefix
...
to an array so that the array’s elements are direct arguments of the function rather than the array being an argument itself(Here it is prefixed to the opening parenthesis of the ternary operator because it returns an array whether the test succeeds of fails)
Jeremy
October 19, 2021 at 7:12 pm #7405jay0845
ParticipantFabulous! It works now, though I should figure out how to make some distance between the two choices “Yes” and “No” and center-align them.
Thank you very much for your help!
-
This reply was modified 2 years ago by
-
AuthorPosts
- You must be logged in to reply to this topic.