PennController for IBEX › Forums › Support › Optional question after DashedSentence
Tagged: DashedSentence, Question, randomization, self-paced reading
- This topic has 2 replies, 2 voices, and was last updated 4 years, 10 months ago by adamliter.
-
AuthorPosts
-
January 10, 2020 at 7:02 pm #4667adamliterParticipant
I’m having trouble figuring out a good way to include a question after some self-paced reading trials.
I have something like the following. Some of the rows in the CSV file also have a value for the column
Question
. Some are blank, however. I only want to include the question when there is one.PennController.Template("Stimuli.csv", row => ["spr", "DashedSentence", {s: row.Sentence, display: "in place"}, ] );
I initially tried something like this:
PennController.Template("Stimuli.csv", row => ["spr", "DashedSentence", {s: row.Sentence, display: "in place"}, ...(row.Question !== "" ? ["qst", "Question", {q: row.Question, as: ["დიახ", "არა"], hasCorrect: row.Answer}] : []) ] );
However, this isn’t working. I think part of the issue may be that I have a new sequence,
qst
. I had been trying to randomize the trials withPennController.Sequence("consent", randomize("spr"), "send")
, but this doesn’t account for the question. Any suggestions for how to include a question only when there is one in the CSV file while keeping the question paired with the relevant sentence when they are randomized would be really appreciated!January 11, 2020 at 3:22 pm #4670JeremyKeymasterHi Adam,
You were almost there: the problem indeed comes from your inserting a second label inside a single Ibex-item array, which is an illegal syntax. Your code works perfectly well if you get rid of
"qst",
before"Question"
—if your sentences and questions are paired, they represent a single item and so you shouldn’t need a second label.You say that using
spr
only wouldn’t account for the questions: what exactly are you trying to do? If you don’t want the Question controllers (when they exist) to be paired with a respective DashedSentence controller, you should simply called Template twice on your table, first to generate the DashedSentence items, and then to generate the Question ones.Jeremy
January 12, 2020 at 2:28 am #4671adamliterParticipantHi Jeremy,
Thanks for your quick response as always. Yes, just deleting the
"qst"
label gives me the result that I was trying to achieve. I really appreciate your help. Thank you! -
AuthorPosts
- You must be logged in to reply to this topic.