Description of the problem:
I know Pavlovia is off for now but i would still like to try to fix my current issues so when its on i would be able to publish my experiment
My experiment involves random tasks assignment-each participant will receive 1 assignment .
I added a routine that presents the texbox that the participant edited.
textbox routine:
I would like to add that this worked nicely offline when i used the button component. but since button is not yet available online i changed the settings to a text stimuli and it doesn’t work online.
perhaps this code is not relevant online? i could not find info about is in the crib sheet. is there a better way to condition a routine?
Is the thing that’s not working clicking on the text stimulus? It used to be the case that clicking on a text stimulus in an online experiment wasn’t possible; you’d need to create a box or something (possibly invisible) in the same position as the text to use as the thing being clicked on. Whether this is still the case or not I don’t know, but if that is indeed the issue you’re having, it might be worth trying to add a box around the text and setting that as your clickable stimulus instead.
the clicking works perfect. the routine ends when clicking on the text. And i can see it stores the click.
The issue is that the next routine is not presented even when I call it in the Begin Routine tab
but perhaps creating a box will be a good ideae anyway since maybe the problem is that
if (mymouse_2.isPressedIn(ContinueButton_2)) {
continueRoutine = true;
is not applicable to a text stimuli. but i am not sure this is the case
That doesn’t look like code I would expect to see in a PsychoPy experiment unless you are embedding an html.
However, I also note that your text component is called textbox so presumably .getText is specific to that (which is a component type I haven’t yet started using).
yes. the getText is specifically aimed to call that component.
i have used e2e_textbox experiment to create that and it worked nicely in presenting every answer each frame. but i wanted to make some changes in the feed back by adding this condition .
it seemed very simple solution to presenting the text to the audience in the end of the experiment and it did work nicely off line
perhaps using embeded html like in your demo would be a good idea too but i am not t o sure how to call it so it will be visible to the participant in the end of the experiment (if he indeed got this condition)
Heya! Let me explain what this code does via some comments:
/* This line assigns the textbox to a window property so that it's globally available (i.e. across multiple routines and/or out of PsychoPy. I tend to use this to debug PsychoPy components using the browser console */
window.textbox = textbox;
/* This line is only for our automated testing systems; it informs our testing script that we're at a particular stage in an experiment */
document.body.setAttribute('data-report', 'textbox');
.getText() is an alternative way to get the text value of a textbox
thank you!
so i presume you define the textbox by creating in the trial routine the text component that is called textbox, correct?
Then, in the feedback routine, the $textbox.getText() you call it so the input will be presented as a text.
I created something similar only i condition it to be presented if a mouse click was clicked in the trial routine. and it seems to ignore it online. i don’t think the issue is in the routine components but perhaps in the way I conditioned the routine.
am i clear? i hope i am
Ah I think I know what’s wrong. That isPressedIn will only work in the Each Frame tab of the trial routine. However, based on that you’d like something to happen (or not) in the next routine. So what you could do is pass info from one routine to the other via a variable. For fun I’m giving two versions; a normal one and one with shorter code.
*** Normal version
In the Each Frame tab of trial routine set some variable.
so now that pavlovia is working and i get to test it. it indeed works but the feedback shows me the content tha i added in the textbox : “Type anything you want here”
instead of the actual input.
in my csv file i can see the content in the textbox.text tab so i know i saved the data
and you put it in the feedback text component or the code component?
i have a textbox named texbox
and in the feedback text component i called : $textbox.getText()