Perform a Division Operation, Store the value, Send as Quiz Result

Feb 13, 2014

The subject line says it all, pretty much. I want to perform a division operation (x/y) and send the result (z) as the result of my quiz score. Is this possible? If not, what would a suggested work-around be?

I'm aggregating 3 quiz scores into one (hence my division problem) and trying to send that to as my main quiz result. Thanks in advance!

7 Replies
Phil Mayor

Steve's javascript solution would be my solution of choice, I would PM him to get the code.  

Otherwise to divide the built in variables you need to use an intermediary

e.g. set the value of a user denied variable to the value of the quiz result and then divide it by two.  I would then use Steves code to set the score in the LMS or set it to the value of an interaction and pass that to the LMS using a quiz slide

Jason Johnson

Thanks for the info! Very helpful. I was trying to find a way to force a quiz score to a variable if I were to allow the end-user to enter a number in a text field and make that the final score hypothetically. I'm not doing that; just an example. I would hard code the value up-front but I don't know how the user will perform on all 3 quizzes that I'm aggregating so there's no way to know.

I know how to use Javascript to manipulate variables but will that approach allow you to manipulate "Results.ScorePercent" or "Results.ScorePoints"? That could be my smoking gun and it sounds like that's what Steve did. Thoughts?

Thx again! =)

Phil Mayor

you can override the score I used to do it in noodle using code Steve wrote, I had to set the course to track by slides viewed to ensure storyline didn't overwrite the score when it was closed but it worked, I don't have access to those files anymore though sorry.

You can do the calculation and then set that to the value of a hidden question and then use a results slide to pass that to the LMS

This discussion is closed. You can start a new discussion or contact Articulate Support.