Template for Randomized Questions and Answers
-
Hello, I’m trying to create a video with random questions and answers, i.e., three boxes with only one correct result.
I would like that, after a certain number of seconds, the color and text change based on whether it’s the correct answer, but randomly, i.e., only if it’s specified that this answer should change in a particular box.
Example:
Question 1
Option/box 1
Option/box 2
Option/box 3Correct answer in box 3
Question 2
Option/box 1
Option/box 2
Option/box 3Correct answer in box 1
-
While I’m not entirely sure I understand what we’re trying to accomplish here, there is a technique for controlling the color of an asset using Templater data that will almost certainly be useful for this particular scenario.
To accomplish this, we’ll need to start by bringing our color hex code into a text layer. For this example, I’ll refer to this layer as “color”. Once the value is loaded into the layer correctly, we’ll need to apply the Fill Effect to the asset whose color we want to change. Finally, we’ll want to open the Fill Effect and ALT/Option click on the Stopwatch next to “Color” to enter an Expression. From there, we can enter this:
hexToRgb((""+thisComp.layer("color").text.sourceText+""))
into the Expression field. This Expression will look at the hex code data in the “color” layer and then use it to set the Fill Color.
Hopefully, that helps to get things moving in the right direction, but if you have any follow-up questions, please feel free to let us know, and we’ll do what we can to help out.
Thanks,
Jeff
-
Hi! @Jeff ,
Thank you for your response.
Here’s an example regarding my question:
For instance, it displays three options, and depending on the correct answer, it is either marked in green or with some random checkmark icon.
-
Thanks for the clarification. This should absolutely be doable with Templater. You’ll probably need to use a combination of Expressions driven by Templater data like the one suggested above and maybe some of Templater’s flag options to turn layers on and off as needed.
Hopefully, that’s enough to get you started, but if you have any additional questions, feel free to post them here or get in touch with us directly at support@dataclay.com
Thanks,
Jeff