Copy link to clipboard
Copied
I'm building a foreign language assessment with audio passages that the user must listen to then answer two questions about it. The user can only play the audio twice. But even if I put 2 in the No. of Attempts, when I tested it I was able to play the audio unlimited times. What's the trick?

You seem to misunderstand 'attempts' for an interactive object, will try to clarify. It is not limiting the number of clicks ON the interactive object (here a button) but telling how many attempts can be 'failed', which means clicking OUTSIDE of the object. For your use case the Failure action will never happen, because the user always clicks on the button, never outside of it. Same with the Continue project which you left for the Failure action: never happens.
For the Success action you use the
...Copy link to clipboard
Copied
Create an advanced action to play audio and disable the button.
P.S. The first "question" is really a statement. ![]()
Copy link to clipboard
Copied
You seem to misunderstand 'attempts' for an interactive object, will try to clarify. It is not limiting the number of clicks ON the interactive object (here a button) but telling how many attempts can be 'failed', which means clicking OUTSIDE of the object. For your use case the Failure action will never happen, because the user always clicks on the button, never outside of it. Same with the Continue project which you left for the Failure action: never happens.
For the Success action you use the Play Audio command, with Continue project unchecked: this means that the user can click multiple times, the playhead is never released and the audio can be played as many times as you want. The solution is indeed to use a conditional advanced action (not a standard action because you want to allow 2 attempts, sorry David - TLCMediaDesign) and a counter variable. These are the steps:

It is always safer to disable the button before hiding it. Or you could just keep the Disable. This action also allows you to show the attempts left in a text container:
It is also very easy to change the number of attempts by just editing the default value. Think this will be one of the (easy) scripts in my future actions cookbook. Tnx for the question.
Copy link to clipboard
Copied
Thank you--it works great!
Copy link to clipboard
Copied
Was pretty sure it worked, created a file to check the action.
You can find more use cases and tips for advanced/shared actions on my blog:
Copy link to clipboard
Copied
Well, now I need it to play the audio in its entirety twice. Someone with a trigger finger could inadvertently click twice and not hear the full audio recording twice.
Copy link to clipboard
Copied
That will be more complicated, because you have to disable the button until the audio clip finishes. Have a look at this thread:
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more