Hello,
I had someone help me come up with a code in order to read the text in my surveys. However, when I put the code into javascript for my survey, the synthetic voice reads the questions twice and I only need it to be read once. The code is below if anyone can show me how to change the code so it only reads the questions once that would be great.
Qualtrics.SurveyEngine.addOnReady(function () {
// Find the HTML element containing the question.
const questionTextContainer = this.getQuestionTextContainer();
// Parse for the question from the HTML element.
const questionText = questionTextContainer.innerText;
// Construct an object used to speak the question.
const utterance = new SpeechSynthesisUtterance(questionText);
// Adjust the rate at which speech is outputted, where 1 = default rate, <1 is slower and >1 is faster.
utterance.rate = 2.00;
// Output the speech.
window.speechSynthesis.speak(utterance);
});
window.onbeforeunload = function () {
window.speechSynthesis.cancel();
}
Javascript Coding
Best answer by rondev
If you are testing it in the preview mode then once the code is run for mobile view and another for desktop view, try to test it using the annonymous survey link.
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
