There isn't a feature to make Storyline "round up" the percents, although it's something I know a few users have submitted a feature request for. In regards to the threads you've mentioned reading, the work arounds do involve some additional set up and if youre having difficulty with one of those methods you may wan to reply in that thread to see if anyone is able to assist you.
It is not exactly straightforward, but here's one way you can achieve this :
A) Copy the value of Results.ScorePercent to another numeric variable (say Results). B) Trigger the execution of a JS trigger when value of 'Results' changes. C) Inside the JS trigger use GetVar to get the value of 'Results', then use Math.round (see here), then SetVar the same variable. D) On your Results slide, be sure to display 'Results' instead of 'Results.ScorePercent'
There are other ways, but this will probably be enough for now.
**note that the third line, I used Math.floor, which rounds down. If you use Math.ceil, it will round up. And if you use Math.round, it will round it either up or down depending on the number.
Second trigger is this:
Then, in the text field for your score, I replaced '%Results.ScorePercent%" with "%results%"
That's it! Just remember your triggers are layered in the order as seen above. And also, you will not be able to see this in Storyline preview as it does not process javascript, and also won't be able to see it work if you launch the story.html file locally on your computer. You'll need to upload it to a server and view it there to see it work.
4 Replies
Hi Julie,
There isn't a feature to make Storyline "round up" the percents, although it's something I know a few users have submitted a feature request for. In regards to the threads you've mentioned reading, the work arounds do involve some additional set up and if youre having difficulty with one of those methods you may wan to reply in that thread to see if anyone is able to assist you.
It is not exactly straightforward, but here's one way you can achieve this :
A) Copy the value of Results.ScorePercent to another numeric variable (say Results).
B) Trigger the execution of a JS trigger when value of 'Results' changes.
C) Inside the JS trigger use GetVar to get the value of 'Results', then use Math.round (see here), then SetVar the same variable.
D) On your Results slide, be sure to display 'Results' instead of 'Results.ScorePercent'
There are other ways, but this will probably be enough for now.
Hope this helps,
Alex
Thanks Alexandros, that worked for me.
Here's what I did for anyone that wants to know:
and here's the script:
**note that the third line, I used Math.floor, which rounds down. If you use Math.ceil, it will round up. And if you use Math.round, it will round it either up or down depending on the number.
That's it! Just remember your triggers are layered in the order as seen above. And also, you will not be able to see this in Storyline preview as it does not process javascript, and also won't be able to see it work if you launch the story.html file locally on your computer. You'll need to upload it to a server and view it there to see it work.
Thanks for sharing those steps here Bob, it's always helpful to have another example to point too.
This discussion is closed. You can start a new discussion or contact Articulate Support.