Ending a custom controller based off of a flag set by the previous question

33 views
Skip to first unread message

Nicolas Helms

unread,
Mar 25, 2021, 5:26:35 AM3/25/21
to ibexexperiments
Hi all--I was wondering if I could ask a few follow-up questions on a topic that was recently asked about in this thread: https://groups.google.com/u/2/g/ibexexperiments/c/DK6wn8OtWro/m/0VMF4qp8AQAJ

I've currently got a (mostly) copy-and-pasted version of the DashedSentence controller that I'm calling "RepeatSentence", and I've been able to integrate that controller into the experiment I have been working with so far. I also have correctly set a question as described in that thread, to ask the participant if they want to repeat the sentence.

My question is this: can anyone explain a way to exit out of a controller without displaying the dashed sentence, and while safely transitioning into the next item? I've been playing with it a bit, but am unsure on how to do this. I understand how to read the flag from the previous question,  but not how to take that flag and skip the rest of the RepeatedQuestion controller.

Any help would be greatly appreciated! 

Alexandre Cremers

unread,
Mar 25, 2021, 9:04:11 AM3/25/21
to ibexexp...@googlegroups.com
Hi,

I assume you're referring to this follow-up discussion.

The relevant part of the code in the pastebin starts on line 13:

if (this.utils.getValueFromPreviousElement("failed")) {
    this.finishedCallback(null);
} else {
    [...all the code from the original controller...]
}

Using finishedCallback(null) you're effectively exiting the controller without displaying anything nor recording anything in the results file.

Hope this answers your question!
Alexandre
 
 

--
You received this message because you are subscribed to the Google Groups "ibexexperiments" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibexexperimen...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibexexperiments/7b26d177-cb22-4f51-9abb-d74e273cf10bn%40googlegroups.com.

Nicolas Helms

unread,
Mar 25, 2021, 10:44:22 PM3/25/21
to ibexexperiments
This makes a lot of sense, thanks for the clarification! I have one other followup--

I've integrated the code from the pastebin, and it seems to work very well. The only issue I have is that the sentence appears on the screen instead of dashes, and then each word disappears as you hit the space bar. I've taken a look at the code, and compared it to the DashedSentence; I'm not sure what the difference could be, and what could be causing the issue. I utilize the DashedSentenceRepeat just as you mentioned, and I didn't make any changes to the file. 

Do you have any insight as to why this might be the case? Thanks in advance for any help you can offer! 

Alexandre Cremers

unread,
Mar 26, 2021, 1:03:13 AM3/26/21
to ibexexp...@googlegroups.com
You need to set the options for DashedSentenceRepeat in the beginning of your data file so that they match those of DashedSentence. At least I think that's the reason.
A

Nicolas Helms

unread,
Mar 29, 2021, 5:58:18 PM3/29/21
to ibexexperiments
I believe that I have done this correctly--I just need to add the DashedSentenceRepeat to the beginning of the data file, with the same format/permissions as the DashedSentence. Correct? If that's the case, then are there any other reasons you can think of that might cause this issue?

Thanks in advance! 

Alexandre Cremers

unread,
Mar 30, 2021, 2:21:36 AM3/30/21
to ibexexp...@googlegroups.com
Can you share a link to the experiment and/or the data file?
A

Nicolas Helms

unread,
Mar 30, 2021, 9:24:49 PM3/30/21
to ibexexperiments
Absolutely! Here's a pastebin for the template data file I've been working with. 

https://pastebin.com/vL8q9mdp

Thank you again for taking a look! Your help is so, so appreciated! 

Alexandre Cremers

unread,
Mar 31, 2021, 12:14:49 AM3/31/21
to ibexexp...@googlegroups.com
I don't see anything wrong in the code. Do you have a link to the experiment? If I understand correctly, your problem is that the repeat sentence is never skipped?
A




Nicolas Helms

unread,
Mar 31, 2021, 6:50:31 PM3/31/21
to ibexexperiments
Not exactly. The sentence repeats only when the question asking for it to repeat determines it should, but the sentence that is repeated is displayed in its entirety on the screen when the DashedSentenceRepeat  controller is entere, instead of a series of dashes. When the space bar is pressed, the words in the sentence disappear.

Here's that link: https://spellout.net/ibexexps/mariagold/CI.OE/experiment.html

Alexandre Cremers

unread,
Apr 1, 2021, 2:08:27 AM4/1/21
to ibexexp...@googlegroups.com
Ok. For me it's even weirder. The sentence displays in full, but then everytime I press space a word disappears. Are you sure you didn't make additional changes to the DashedSentenceRepeat.js file?

Nicolas Helms

unread,
Apr 7, 2021, 7:20:29 PM4/7/21
to ibexexperiments
None to my knowledge. I copy-and-pasted it directly into a new file from the pastebin. 

Alexandre Cremers

unread,
Apr 8, 2021, 2:01:44 AM4/8/21
to ibexexp...@googlegroups.com
I think I got it. The problem is that you're missing DashedSentenceRepeat.css in the css folder, so the ispan containing the words are visible by default. Just make a copy of DashedSentence.css, rename it to DashedSentenceRepeat.css, and it should work.
A


Nicolas Helms

unread,
Apr 15, 2021, 5:17:12 PM4/15/21
to ibexexperiments
Great news--that was exactly the fix I was looking for. Thanks for taking a look! It didn't even cross my mind that it might be due to the CSS file. Thanks again!
Reply all
Reply to author
Forward
0 new messages