Now that the JavaScript code is in place, we can safely use the new random feedback messages capability of the project. You can do this by following these steps:
- Still in the Chapter14/takeTheTrain.cptx file, use the Filmstrip to go to the Knowledge Check question of slide 10.
- Double-click the red Failure Caption and delete the text it contains.
- Use the Insert Variable icon of the Properties inspector to insert the v_randomFailure User Variable in the failure message. Increase the maximum length to 150 characters to accommodate longer messages.
- Repeat the same set of operations to insert the v_randomSuccess variable in the green Success Caption.
Thanks to the preceding actions, the value of the v_randomSuccess and v_random failure variables will be displayed in the feedback messages for the Knowledge Check question of slide 10. The final thing we need to do is generate those random messages using our pickMessages() JavaScript function when the playhead...