PennController for IBEX › Forums › Support › Best way to transfer HTML-based experiment to pcIBEX? › Reply To: Best way to transfer HTML-based experiment to pcIBEX?
September 14, 2020 at 7:37 pm
#6121
Keymaster
Hello,
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