I am currently designing an experiment that a participant listens to a sound file and records the short answer to it. The current design allows participants to record their responses while listening to sound files. I want the subjects to record their responses after the sound file is finished. In other words, I would like to have a text entry box at the end of the sound file where the participants can record their answers. I would be really grateful if you could let me know the code to make this possible.
FYI, below is the code that I have made for each trial. So far, I have added codes regarding "Next Button' and "setTimeout", so that the participants cannot move on to the next trial by themselves, but automatically move on to the next trial after 15000 ms. I have also added codes to hide audio file, so that they cannot replay the sound file after they hear it once.
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
$('NextButton').hide();
$('PreviousButton').hide();
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
jQuery('audio').on('ended', function() { jQuery(this).hide(); });
setTimeout(function () {jQuery('#NextButton').click();},15000);
Thank you very much!
text entry after the sound stimuli
Best answer by rondev
In the addOnReady function add below line:
jQuery("#"+this.questionId+" .InputText").hide();
Change your code with the below in OnReady:
var that =this;
jQuery('audio').on('ended', function() {
jQuery(this).hide();
jQuery("#"+that.questionId+" .InputText").show();
});
Also, I wonder that is 15 seconds enough to hear the sound and write the answer for it.
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.
