January 28, 2020 at 5:18 pm #4674January 28, 2020 at 5:21 pm #4675
In the brackets before the hyperlink starts I put the code for that with ‘a’ and so on. So you can ignore the link, it doesn’t do anything anyways.January 28, 2020 at 5:33 pm #4677
1. Using HTML codes, as you mention, is probably the solution that is best in terms of cross-browser compatibility. You can find a useful table here: https://www.starr.net/is/type/htmlcodes.html
An example of a script:
PennController( newButton("grüßen") .print() .wait() )
This is of course not ideal in terms of readability from the experimenter’s end. Another solution is to save your script using an UTF8 encoding. In order to do that, you need to edit your script file on your local device (using your own text editor) and make sure to save it with a UTF8 encoding, and then upload your script file back to your project. Note that opening the online editor and clicking “Save” will fall back to the old, non-UTF8 format, so you need to keep editing the file locally and uploading it later.
2. You want to use the
targetattribute with the value
'_blank', like this:
<a href='https://expt.pcibex.net/' target='_blank'>Open the PCIbex Farm</a>
3. You are right, you need to use a Selector element, but then you no longer need a Key element:
newButton("continue", "Continue") .print() , newSelector("next") .settings.add( getButton("continue") ) .settings.keys( " " ) .wait()
Let me know if you still have questions
JeremyJanuary 29, 2020 at 11:39 am #4683
thank you very much for the help so far. I successfully applied everything.
I have one follow-up question to question 3:
How do i apply that choice to proceed by either space bar or a click anywhere on the window between two lines of text? So I want to print one text and before printing the next one the participant right now has to press any key, but adding the option of a mouse click would be convenient.
AkiraJanuary 29, 2020 at 12:09 pm #4685
Giving the option to click anywhere on the screen is a little tricky in PennController: you need to create a Canvas that covers the entire surface o the window. Note that this will likely prevent any interactions with elements on the page until the Canvas is removed (which you should be fine with, in your case). Here’s an example:
newText("instructions", "Please click anywhere on the screen or press the spacebar") .print() , newCanvas("screen", "100vw", "100vh") .print("center at 50vw", "center at 50vh") , newSelector("continue") .settings.add(getCanvas("screen")) .settings.keys( " " ) .wait() , getText("instructions").remove(), getCanvas("screen").remove() , newText("thanks", "Thank you!") .print()
Let me know if you have questions
You must be logged in to reply to this topic.