Hi, Kev,
the only way to do that now is to use the JavaScript action. CourseLab variables are stored in global JavaScript arrays (one for slide scope and other for module scope). Let it be slide var for example. Then you will need this action sequence:
VARIABLE (my_var, Math.random()*100)
JAVASCRIPT {
g_arSlideVars['my_var'] = Math.round(g_arSlideVars['my_var']);
}
That's all - my_var is rounded. If you var has entire module scope, then name of the array must be changed to g_arVars.
Hi, Kev,
the only way to do that now is to use the JavaScript action. CourseLab variables are stored in global JavaScript arrays (one for slide scope and other for module scope). Let it be slide var for example. Then you will need this action sequence:
VARIABLE (my_var, Math.random()*100)
JAVASCRIPT {
g_arSlideVars['my_var'] = Math.round(g_arSlideVars['my_var']);
}
That's all - my_var is rounded. If you var has entire module scope, then name of the array must be changed to g_arVars.