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

瀏覽次數:33 次
跳到第一則未讀訊息

Nicolas Helms

未讀,
2021年3月25日 清晨5:26:352021/3/25
收件者: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

未讀,
2021年3月25日 上午9:04:112021/3/25
收件者: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

未讀,
2021年3月25日 晚上10:44:222021/3/25
收件者: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

未讀,
2021年3月26日 凌晨1:03:132021/3/26
收件者: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

未讀,
2021年3月29日 下午5:58:182021/3/29
收件者: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

未讀,
2021年3月30日 凌晨2:21:362021/3/30
收件者:ibexexp...@googlegroups.com
Can you share a link to the experiment and/or the data file?
A

Nicolas Helms

未讀,
2021年3月30日 晚上9:24:492021/3/30
收件者: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

未讀,
2021年3月31日 凌晨12:14:492021/3/31
收件者: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

未讀,
2021年3月31日 下午6:50:312021/3/31
收件者: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

未讀,
2021年4月1日 凌晨2:08:272021/4/1
收件者: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

未讀,
2021年4月7日 晚上7:20:292021/4/7
收件者:ibexexperiments
None to my knowledge. I copy-and-pasted it directly into a new file from the pastebin. 

Alexandre Cremers

未讀,
2021年4月8日 凌晨2:01:442021/4/8
收件者: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

未讀,
2021年4月15日 下午5:17:122021/4/15
收件者: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!
回覆所有人
回覆作者
轉寄
0 則新訊息