I found your embedded html very useful, thanks.
Although I’m not quite sure I understood how to use it.
I save it in local exp folder, but how I do recall it in my psychopy script to make it “load”?
Hi! I’ve implemented your html form (it’s great, thank you so much by the way for making it). I’m trying to use the participant’s responses to gauge their eligibility for the study. Is there functionality for that? I’ll post the code I’m trying to use below, but it doesn’t seem to be working.
Here is some sample code I’m trying to use (it’s in the End Routine part of builder.) Basically, if the participant says they have been diagnosed with dyslexia for my word experiment, after the form is completed and the routine ends I want the experiment to quit.
expInfo[‘age’] = psychoJS.experiment._currentTrialData[‘age’];
expInfo[‘gender’] = psychoJS.experiment._currentTrialData[‘gender’];
expInfo[‘dyslexia’] = psychoJS.experiment._currentTrialData[‘dyslexia’];
if ((expInfo[‘dyslexia’] === “Yes”)) {
psychoJS.quit({message: ‘Unfortunately, you are not eligible for our study today. Thank you for your time!’});
}
I don’t have a ton of experience with JS so there may be some oversight there as well.
Thank you for your help! I was thinking about the console but the embedded html only works online right? I know how to use the Psychopy console but where does the console in Pavlovia print out to? (sorry for the newbie question!)
Please look at my crib sheet if you haven’t come across it before.
Developer Tools
Use Developer Tools (Ctl-Shift-I in Windows/Chrome, Cmd-Opt-J or Cmd-Opt-I in Mac/Chrome, F12 in IE/Edge, Ctrl-Shift-J in Windows/Safari, Ctrl-Opt-J in Mac/Safari) to view errors via the browser console if you aren’t getting sufficient information from PsychoPy. You can add print(var) (which translates to console.log(var); ) to check the value of a variable var at a particular point. N.B. If you need to stop your participants doing this and being able to view trial variables you may be loading from Excel, add log4javascript.setEnabled(false); to code_JS [sotiri]. This will prevent cheating on experiments with a performance based reward.
Hi! I noticed that with the form, participants could hypothetically press submit and bypass the form without filling any of it out. Is there any functionality within the app to limit progression past the routine until everything has been answered? Thanks!
There’s probably a way of doing it within the html but the easiest way for a PsychoPy user would be to put a loop around the form with only ends when the appropriate responses have been given. The disadvantage would be that this would clear the form when re presenting it, unless you add additional URL variables when calling the form.
Hi Wakefield - thanks as always for these useful tools!
I wonder if it would be easy to extend this to support slider responses here? Happy to help. Here’s a little demo for slider responses using html using the same iframe code from your demographics demo.
Thanks for the suggestion. I’ve updated formtohtml.php to cope with slider, heading and description.
I’ve added the following as the default contents for the form
index questionText options layout type questionWidth responseWidth
0 Demographics heading
0 Thank you for agreeing to take part. In order to help me describe my participants, please could you answer the following questions? description
1 What gender are you? Woman, Man, Non-binary, Different Gender Identity[specify], Prefer not to say vert radio 0.4 0.6
2 How old are you? Under 17,18,19,20,21,Over 21 horiz choice 0.4 0.6
3 Are you a student? Yes, undergraduate,Yes, taught postgraduate,Yes, research postgraduate,No vert radio 0.4 0.6
4 How fluent are you in English? 1,2,3,4,5 horiz slider 0.4 0.6
Wow it really is easy to use! Would it be ok for us to do a mini tutorial to feature it? I really like this as an alternative until online forms is out of beta mode
Did you notice that you have to make a couple of edits to the html (and can’t simply save as in Chrome)? I disallow scrolling of the html itself but people will want to be able to scroll the preview.
I should also add a matrix table to the demo before you show it.
Honestly I actually didn’t edit the html, I just copied the source and saved it as a file in the same location as the demographics demo. (I think scrolling was still enabled as it was in the iframe?)