Now that you know your pickMessages() JavaScript function works properly, you can randomize the feedback messages of the remaining Question Slides in the project. The general steps are as follows:
- Use the Window | Question Pool menu item to open the Question Pool panel at the bottom of the screen.
- Select each Question Slide of the Question Pool one by one and change the onEnter action to Execute Javascript. Use the Script Window button to open the JavaScript window and type pickMessages();. Click OK to confirm and close the JavaScript window. Thanks to this step, each time a Question Slide is displayed to the Learner, the pickMessages(); function is executed and new messages are randomly picked from the aSuccessMessages and aFailureMessages arrays.
- Replace the current feedback messages of all the Question Slides with the v_randomSuccess andv_randomFailure Captivate variables.
- Test your work in a web browser using...