Millisecond Forums

Combining something with an html

https://forums.millisecond.com/Topic30957.aspx

By amanuel2 - 3/2/2021

Hello!

I am working on making a consent form and I'm using the HTML function. I want to add to the same page with the HTML an option to accept or deny the consent.
Right now I have the HTML consent form on one page, and another with the option to accept or deny. Is there a way I can have them both on the same page so the accept or deny will just be at the end of the consent HTML file?
I've posted my code below.

<html consent1>
/ items = ("consent.html")
/ size = (100% ,100%)
</html>

<trial consent1>
/ stimulusframes = [1=consent1]
/ validresponse = (57)
</trial>


<text consent2>
/ items = ("By clicking “YES”, you are indicating that you fully understand the previous information and agree to participate in this study.")
/ size = (80%, 10%)
/ vjustify = center
</text>


<text agree>
/items = ("Yes, I agree to particpate.")
/position = (25%, 70%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ txcolor = (black)
/txbgcolor = (white)
/size = (30%, 20%)
/ vjustify = center
</text>

<text disagree>
/items = ("No, exit the study.")
/position = (75%, 70%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ txcolor = (black)
/txbgcolor = (white)
/size = (30%, 20%)
/vjustify = center
</text>

<trial Consent2>
/inputdevice = mouse
/stimulusframes = [1 = consent2, agree, disagree]
/validresponse = (agree, disagree)
/monkeyresponse = ("agree")
/ontrialend = [if (trial.Consent2.response == "disagree") script.abort()]
</trial>

<block myblock>
/ trials = [
    1 = consent1, consent2
]
</block>
By Dave - 3/2/2021

amanuel2 - 3/2/2021
Hello!

I am working on making a consent form and I'm using the HTML function. I want to add to the same page with the HTML an option to accept or deny the consent.
Right now I have the HTML consent form on one page, and another with the option to accept or deny. Is there a way I can have them both on the same page so the accept or deny will just be at the end of the consent HTML file?
I've posted my code below.

<html consent1>
/ items = ("consent.html")
/ size = (100% ,100%)
</html>

<trial consent1>
/ stimulusframes = [1=consent1]
/ validresponse = (57)
</trial>


<text consent2>
/ items = ("By clicking “YES”, you are indicating that you fully understand the previous information and agree to participate in this study.")
/ size = (80%, 10%)
/ vjustify = center
</text>


<text agree>
/items = ("Yes, I agree to particpate.")
/position = (25%, 70%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ txcolor = (black)
/txbgcolor = (white)
/size = (30%, 20%)
/ vjustify = center
</text>

<text disagree>
/items = ("No, exit the study.")
/position = (75%, 70%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ txcolor = (black)
/txbgcolor = (white)
/size = (30%, 20%)
/vjustify = center
</text>

<trial Consent2>
/inputdevice = mouse
/stimulusframes = [1 = consent2, agree, disagree]
/validresponse = (agree, disagree)
/monkeyresponse = ("agree")
/ontrialend = [if (trial.Consent2.response == "disagree") script.abort()]
</trial>

<block myblock>
/ trials = [
    1 = consent1, consent2
]
</block>

> Is there a way I can have them both on the same page so the accept or deny will just be at the end of the consent HTML file?

Yes, of course. /size and /position the <html> element so that it doesn't take up the entire screen, then display everything in a single <trial>.