Solved
display message on radio click-javascript
Hello-Rather than using display logic, I'd like to show a specific message when any response is given on a multiple choice question.
Best answer by fleb
Hi @profjm,
that's a much better explanation. What about something like this:
Put this script into the header of your survey.
<script>
function display_correct(Q, n ) {
Q.questionclick = function(event, element) {
if(element.type == "radio") {
alert("The correct answer is " + n);
}
}
}
</script>
You'll be able to access the function from any part of your survey.
You'll run this function like this:
Qualtrics.SurveyEngine.addOnload(function()
{
display_correct(this, 5);
});
In there is just one question on the page and you'd prefer to automatically proceed to the next question after the respondent closes the error message, add the following line to the function exactly bellow the `alert` function: `this.clickNextButton();`. It is also a simple way how to prevent respondets from modifying their original answer.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
