I am new on the plartform and I want to retrieve the answer choice value(actual text) of an option selected in a multiple choice question where you can only select a single choice, but all I get with my code is an empty string.
here is my code:
Qualtrics.SurveyEngine.addOnPageSubmit(function() {
var questionID = "QID278"; // Replace with your question ID
var question = Qualtrics.SurveyEngine.getInstance(questionID);
console.log("Selected choice text: " +question.getChoiceAnswerValue());
});
I also tried using question.getSelectedAnswerValue () but it gives me Null.
any advise will be appreciated.