Show an error message if participant chose wrong answer


Author
Message
DSaraqini
DSaraqini
Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)
Group: Forum Members
Posts: 21, Visits: 59
I tried to look for an answer in the forum but couldn't find anything ... In the study that I am preparing, after we debrief the participants we want to make sure that they understand the deception of the study. Therefore we have two questions that they have to answer correctly in order to advance and finish the study. Those are yes/no questions. The right answer for both is 'no', therefore I want to display a message that says something like "The story about Jane was a fictional story. It was NOT a true story." This is the script I have so far that just shows the question and requires an answer without a message if they answer incorrectly:

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes"; "No")
/optionvalues = ("1"; "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<surveypage TrueStory>
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
</surveypage>

<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
DSaraqini - 5/20/2020
I tried to look for an answer in the forum but couldn't find anything ... In the study that I am preparing, after we debrief the participants we want to make sure that they understand the deception of the study. Therefore we have two questions that they have to answer correctly in order to advance and finish the study. Those are yes/no questions. The right answer for both is 'no', therefore I want to display a message that says something like "The story about Jane was a fictional story. It was NOT a true story." This is the script I have so far that just shows the question and requires an answer without a message if they answer incorrectly:

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes"; "No")
/optionvalues = ("1"; "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<surveypage TrueStory>
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
</surveypage>

<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>

You can /branch to a surveypage displaying your "error" message if the response to the question is yes.

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes","No")
/optionvalues = ("1","2")
/ validresponse = ("1", "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<surveypage TrueStory>
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
/ branch = [
    if (radiobuttons.TrueStory.response == "1") {
        surveypage.TrueStoryError;
    };
]
</surveypage>

<surveypage TrueStoryError>
/ caption = "The story about Jane was a fictional story. It was NOT a true story."
/showpagenumbers = false
/showquestionnumbers = false
/ showbackbutton = false
/ branch = [
    surveypage.TrueStory;
]
</surveypage>

<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>
DSaraqini
DSaraqini
Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)Associate Member (295 reputation)
Group: Forum Members
Posts: 21, Visits: 59
Dave - 5/20/2020
DSaraqini - 5/20/2020
I tried to look for an answer in the forum but couldn't find anything ... In the study that I am preparing, after we debrief the participants we want to make sure that they understand the deception of the study. Therefore we have two questions that they have to answer correctly in order to advance and finish the study. Those are yes/no questions. The right answer for both is 'no', therefore I want to display a message that says something like "The story about Jane was a fictional story. It was NOT a true story." This is the script I have so far that just shows the question and requires an answer without a message if they answer incorrectly:

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes"; "No")
/optionvalues = ("1"; "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<surveypage TrueStory>
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
</surveypage>

<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>

You can /branch to a surveypage displaying your "error" message if the response to the question is yes.

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes","No")
/optionvalues = ("1","2")
/ validresponse = ("1", "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<surveypage TrueStory>
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
/ branch = [
    if (radiobuttons.TrueStory.response == "1") {
        surveypage.TrueStoryError;
    };
]
</surveypage>

<surveypage TrueStoryError>
/ caption = "The story about Jane was a fictional story. It was NOT a true story."
/showpagenumbers = false
/showquestionnumbers = false
/ showbackbutton = false
/ branch = [
    surveypage.TrueStory;
]
</surveypage>

<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>

That worked! Is there any way to put the error message on the same page as the question though? With this script it's making it go to a new page and then back to the question
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
DSaraqini - 5/20/2020
Dave - 5/20/2020
DSaraqini - 5/20/2020
I tried to look for an answer in the forum but couldn't find anything ... In the study that I am preparing, after we debrief the participants we want to make sure that they understand the deception of the study. Therefore we have two questions that they have to answer correctly in order to advance and finish the study. Those are yes/no questions. The right answer for both is 'no', therefore I want to display a message that says something like "The story about Jane was a fictional story. It was NOT a true story." This is the script I have so far that just shows the question and requires an answer without a message if they answer incorrectly:

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes"; "No")
/optionvalues = ("1"; "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<surveypage TrueStory>
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
</surveypage>

<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>

You can /branch to a surveypage displaying your "error" message if the response to the question is yes.

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes","No")
/optionvalues = ("1","2")
/ validresponse = ("1", "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<surveypage TrueStory>
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
/ branch = [
    if (radiobuttons.TrueStory.response == "1") {
        surveypage.TrueStoryError;
    };
]
</surveypage>

<surveypage TrueStoryError>
/ caption = "The story about Jane was a fictional story. It was NOT a true story."
/showpagenumbers = false
/showquestionnumbers = false
/ showbackbutton = false
/ branch = [
    surveypage.TrueStory;
]
</surveypage>

<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>

That worked! Is there any way to put the error message on the same page as the question though? With this script it's making it go to a new page and then back to the question

> Is there any way to put the error message on the same page as the question though?

No, there isn't. You can make it go back to the question page automatically, though, if that's what you prefer.

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes","No")
/optionvalues = ("1","2")
/ validresponse = ("1", "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<surveypage TrueStory>
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
/ branch = [
    if (radiobuttons.TrueStory.response == "1") {
        surveypage.TrueStoryError;
    };
]
</surveypage>

<surveypage TrueStoryError>
/ caption = "The story about Jane was a fictional story. It was NOT a true story."
/showpagenumbers = false
/showquestionnumbers = false
/ showbackbutton = false
/ nextbuttonposition = (-10%, -10%)
/ branch = [
    surveypage.TrueStory;
]
/ timeout = 3000
</surveypage>


<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
Dave - 5/20/2020
DSaraqini - 5/20/2020
Dave - 5/20/2020
DSaraqini - 5/20/2020
I tried to look for an answer in the forum but couldn't find anything ... In the study that I am preparing, after we debrief the participants we want to make sure that they understand the deception of the study. Therefore we have two questions that they have to answer correctly in order to advance and finish the study. Those are yes/no questions. The right answer for both is 'no', therefore I want to display a message that says something like "The story about Jane was a fictional story. It was NOT a true story." This is the script I have so far that just shows the question and requires an answer without a message if they answer incorrectly:

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes"; "No")
/optionvalues = ("1"; "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<surveypage TrueStory>
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
</surveypage>

<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>

You can /branch to a surveypage displaying your "error" message if the response to the question is yes.

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes","No")
/optionvalues = ("1","2")
/ validresponse = ("1", "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<surveypage TrueStory>
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
/ branch = [
    if (radiobuttons.TrueStory.response == "1") {
        surveypage.TrueStoryError;
    };
]
</surveypage>

<surveypage TrueStoryError>
/ caption = "The story about Jane was a fictional story. It was NOT a true story."
/showpagenumbers = false
/showquestionnumbers = false
/ showbackbutton = false
/ branch = [
    surveypage.TrueStory;
]
</surveypage>

<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>

That worked! Is there any way to put the error message on the same page as the question though? With this script it's making it go to a new page and then back to the question

> Is there any way to put the error message on the same page as the question though?

No, there isn't. You can make it go back to the question page automatically, though, if that's what you prefer.

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes","No")
/optionvalues = ("1","2")
/ validresponse = ("1", "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<surveypage TrueStory>
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
/ branch = [
    if (radiobuttons.TrueStory.response == "1") {
        surveypage.TrueStoryError;
    };
]
</surveypage>

<surveypage TrueStoryError>
/ caption = "The story about Jane was a fictional story. It was NOT a true story."
/showpagenumbers = false
/showquestionnumbers = false
/ showbackbutton = false
/ nextbuttonposition = (-10%, -10%)
/ branch = [
    surveypage.TrueStory;
]
/ timeout = 3000
</surveypage>


<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>

Alternatively, something like this is possible as well:

<radiobuttons TrueStory>
/caption = "Was the story about Jane being a missing person a true story?"
/options = ("Yes","No")
/optionvalues = ("1","2")
/ validresponse = ("1", "2")
/correctresponse = ("2")
/orientation = vertical
/required = true
</radiobuttons>

<values>
/ truestoryerrormessage = ""
</values>

<surveypage TrueStory>
/ caption = "<%values.truestoryerrormessage%>"
/ subcaption = " "
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/questions = [1 = TrueStory]
/showpagenumbers = false
/showquestionnumbers = false
/ showbackbutton = false
/ branch = [
    if (radiobuttons.TrueStory.response == "1") {
        values.truestoryerrormessage = "The story about Jane was a fictional story. It was NOT a true story.";
        surveypage.TrueStory;
    };
]
</surveypage>

<survey TrueStory>
/pages = [1 = TrueStory]
/ screencolor = black
/ txcolor = white
</survey>
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search