Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

participants should only press the next button when they answerd my form_base

Hi there,
my problem is, that i have a form base with rating scale widgets and text input widgets and I want that my participants are only able to press next button, when they answerd all widgets and not before. I have read a lot of the discussions but I dont know if there is a command that I have to put in the script of the form base or do i have to put a separately python inline script after each form base and there do i have to repeat the syntax for the form base. I hope this is unterstandable and there is someone who can help me.

Sabrina

Comments

  • Here is my form base
    set timeout infinite
    set spacing 15
    set rows "1;1;1;1;1;1"
    set only_render no
    set margins "20;20;20;20"
    set description "A generic form plug-in"
    set cols "1;1"
    set _theme gray
    widget 0 0 2 1 label text="Bitte beantworte die folgenden Fragen?"
    widget 0 1 1 1 label center=no text="Bist du ein Mädchen oder ein Junge?"
    widget 1 1 1 1 rating_scale nodes="Mädchen;Junge" var=response1
    widget 0 2 1 1 label center=no text="Wie alt bist du?"
    widget 1 2 1 1 text_input center=no frame=yes return_accepts=yes stub="Tippe hier …" text="" var=response2
    widget 0 3 1 1 label center=no text="Wurdest du in Deutschland geboren."
    widget 1 3 1 1 rating_scale nodes="Ja;Nein" var=response3
    widget 0 4 1 1 label center=no text="Wenn Nein, dann tippe bitte ein, in welchem Land du geboren wurdest."
    widget 1 4 1 1 text_input center=no frame=yes return_accepts=yes stub="Tippe hier …" text="" var=response4
    widget 0 5 2 1 button center=yes frame=yes text=Weiter

  • Hi Sabrina,

    Check form validators:

    https://osdoc.cogsci.nl/3.2/manual/forms/validation/

    Hope this helps,

    Eduard

  • Hi Eduard,
    thanks for the link, it helps me.
    But now I have another question.
    In my form base there is a rating scale and only if it is answerd with "Nein" (see response3, its the second rating scale) then they have to fill in the text input and this is the problem which I want to solve.
    So I think I have to add something, because until now it works that they only can continue when they answered the rating scale.

    Thanks again for help

  • Hi Sabrina,

    I haven't tried it myself (will give it a go if necessary), but can't you just define your validating function in a way that it only returns True if both the rating scale as well as the text input have input? Both items have a separate response variable, so that shouldn't be a problem, in theory.

    Let me know if you need help, I can try to make this.

    Eduard

Sign In or Register to comment.