Skip to main content
Participant
August 19, 2011
Question

How to stop audio when quiz 'submit' button is pressed

  • August 19, 2011
  • 30 replies
  • 6041 views

Our customer want us to 'speak' the quiz questions and answers by default. Problem is that the audio keeps playing when the submit button is pressed and overlaps with the spoken responses. Is there any workaround that will enable us to play the audio until the submit buttons is pressed without overlapping on the responses. This questions was asked in another audio forum post, but the workaround to default the audio to 'off' is not acceptable in our case. Any workarounds?

This topic is closed to new replies. Start a new post to keep the conversation going.

30 replies

Known Participant
October 7, 2015

I've been messing around with this for a while now as it's an irritating thing that the client wants me to fix. Adobe, this is a feature it would be handy to build into Captivate 10

However, today I found a little workaround that will keep the client happy and is simple to execute.

I changed my fancy Submit button graphic to a transparent button and deleted all of the wording associated with it (so the word submit). I then inserted a straight image, which was my original submit button graphic. I then applied a fade to this and placed it at the end of the timeline AFTER the audio finishes.

Therefore to a user, the submit button is only visible once the audio has finished. Incidentally, I bought a widget for $10 that is discussed a lot from cpguru which hides the submit button until the audio stops, but it only works in flash, not HTML5, so is therefore no use for my (HTML5) project.

It's a bit of a dodgy workaround, because (of course) the transparent button is there all of the time. But I figure if they're maverick enough to click a button they can't see, they'll have to suffer the double talking consequences

It will suffice for me as a workaround, until Adobe fix this issue - which, judging by the amount of times the question has been asked in the forum, is a features users would find helpful.

Inspiring
November 16, 2016

Thanks for posting your solution.  However, it is annoying to the learner that they must listen to the full audio clip before they can click submit and navigate to the next slide.

I have the same issue that I want to stop audio on a quiz slide when the submit button is clicked. Has there been any improvements in Captivate 9 that would make this possible?

TLCMediaDesign
Inspiring
November 17, 2016

Put this in the head of the index file just under the opening <script> tag:

var interfaceObj, eventEmitterObj;

window.addEventListener( 'moduleReadyEvent', function ( e )
{
interfaceObj = e.Data;
eventEmitterObj = interfaceObj.getEventEmitter();
initializeEventListeners();
});

function initializeEventListeners()
{
eventEmitterObj.addEventListener( 'CPAPI_SLIDEENTER', function ( e )
{        
  for ( var i = 0; i < e.Data.si.length; i++ )
  {   
   if ( cp.model.data[ e.Data.si[ i ].n + 'c' ].accstr.indexOf( 'Submit' ) != -1 )
   {
    var str = cp.model.data[ e.Data.si[ i ].n  ].mdi;
    str = str.substring( 0, str.length - 1 );
    var submit_btn = document.getElementById( str );
    submit_btn.addEventListener( 'click', function()
    {
     var mySlideAud = cp.movie.am.slideAudios[ e.Data.audioName ];
     mySlideAud.nativeAudio.pause();
     mySlideAud.nativeAudio.currentTime = 0;
    });   
    break;
   }    
  }
});
}

Inspiring
August 22, 2011

You can also use CPGuru's Hide Submit Button Widget: http://www.cpguru.com/2011/01/06/hide-submit-button-widget-for-adobe-captivate-5/. This will hide the Submit Button while the audio is playing.

Participant
August 22, 2011

Thanks much Chris_Cap. I will also try this and report back. This may be the path of least resistance if we can live with the limitations until a better solution is identified or developed.

Lilybiri
Legend
August 20, 2011

Hello,

Will try to explain how I understand the way a Question slide works:

  • on the timeline you see a pausing point, this will be used twice
  • when the user clicks on the Submit button, playhead is not released but the Success/Failure captions pop up, but you cannot control anything else such like stopping the audio
  • when the user presses Y or clicks on the slide, the playhead is released, the Success/Failure actions are executed and (eventually - unless you changed navigation by those actions) the user is navigated to the next slide

First thing you can change is the pausing point of the question slide, but once an audio clip started playing, this will continue and thus not solve your problem.

It is only in that second step that you can do more customising by changing the Success/Failure actions, perhaps to an advanced action.

Are you using this default behavior? And the audio is attached to what: to the slide or to the text captions for the questions and to the Success/Failure captions for the answers?

I think the solution will be to skip the first step, by deleting the Success/Failure captions. When clicking on the Submit button in that situation, the Success/Failure actions will be executed immediately (and the playhead will be released). Attach the audio for the questions to an invisible object (rectangle without fill or stroke), that you hide with the advanced actions to be triggered by Success/Failure and show custom Text Captions for Success/Failure with audio attached to them. Because the playhead is now released, you will either have to time correctly so that the user will have to listen to the audio totally or to insert a static button widget that pauses the slide. But here I'm a bit stuck because I do not know which version of CP you are using, please?

I blogged about using audio objects a while ago, but did not offer detailed explanations because no one asked for it until now. Have a look:

Playtime with audio and widgets

Lilybiri

Participant
August 21, 2011

Hi Lilybirl,

Thank you so much for jumping in and helping to explain the question slide behavior. Thanks to you, I now understand how to delete the success/failure captions, and attach audio to an invisible object for the question, and a captions for the custom success/failure responces.

Unfortunately, I'm now stuck on how to pause the playhead and then create an action that prompts the user to "click anywhere or press 'y' to continue". I'm using Captivate 5.5, and I don't see a pause option for the static button widget. Thanks for any further guidance you can provide.

Lilybiri
Legend
August 21, 2011

Hello,

I didn't know which version you were using. In Captivate 5.0 the Buttons widget was static but had pausing. In 5.5 it was replaced by both a Static widget (without pausing) and an interactive one (with pausing). I complained about it, because you cannot add an interactive widget on a question slide nor on a master slide. The Adobe team did listen to my complaint and they offered me a new version of the static widget that pauses at half its duration. You cannot change tha pausing point, just change the timeline (shorter and later on the slide timeline) to influence the pausing point.

Oh, yes, they allowed me to make this  widget public, you can download it on my blog in this post:

What I (dis)like in Captivate 5.5

The paragraph is in red. You can add this static button, and just put Next on it, perhaps make it appear (with its pausing) just at the pausing point of the question slide, where the playhead will be released on the moment the user clicks on Submit. That way there will not be confusion, because the widget will only appear after the Submit has been clicked.

Lilybiri