PennController for IBEX › Forums › Support › Best way to transfer HTML-based experiment to pcIBEX?
- This topic has 1 reply, 2 voices, and was last updated 5 years, 2 months ago by
Jeremy.
-
AuthorPosts
-
September 14, 2020 at 7:18 pm #6120
mschrumpfParticipantHello.
I am currently transferring an experiment from a different platform to pcIBEX. The structure is very basic: There are-instruction pages with a “next” button
-a demographic data form and
-exercise and trial pages with a random prompt, a text input field and a “next” button.Since I have all of these on my hand as .html files, I am wondering what the quickest way would be to incorporate these into a pcIBEX experiment.
I have already found info how to do .html data survey forms on the forum.
I don’t know how to incorporate the instruction pages with a simple button in the middle though. These buttons are coded the following way:
`<form action=”next” method=”post”>
<p align=”center”>
<input type=”submit” name=”submit” value = “I want to participate”>’
pcIBEX does not know how to handle the “next” action, so it sends the user to an empty page. Is there a way to link to the next trial with a button inside a .html element?I will probably re-code the exercise and trial pages from scratch, but if there is an easier way, I would be very happy to hear about it.
September 14, 2020 at 7:37 pm #6121
JeremyKeymasterHello,
Re-coding everything from scratch is probably still the fastest and easiest way, indeed. The integration of HTML documents in a (PC)Ibex experiment is rather limited, basically you can report data from input fields to the results file using log but here you’re talking about controlling the flow of the trial/experiment by waiting for a click on a particular element included in the HTML content.
I guess one workaround would be to do something like this:
newTrial( newHtml("test.html").print().log() , newFunction( ()=>new Promise(r=>$("input[type=submit]").bind('click', e=>{ e.preventDefault(); e.stopPropagation(); r(); return false; })) ).call( ) )The call command on the Function element will pause the execution of the script until a submit button is clicked
Jeremy
-
AuthorPosts
- You must be logged in to reply to this topic.