Forum Discussion
Setting a project variable as a tracked score for an LMS?
Hoping someone can help with this. The course I'm working on has a collection of number variables which are collated into a single 'score' by the end. I need to be able to track this score in the LMS, but all of the work arounds I've found seem to only mark the course as complete/incomplete.
Does anyone know if there's a way around this?
Thanks!
Joe
- JordanAsh-a83d8Community Member
This is something I do to track the value of an incorrectclicks variable in my system simulations.
This provides me with a score between 0 and 100 for each user, but this could be modified to work for larger scores as well.
At the end of each course I have a scene containing 9 True/False questions and a results slide.
Each question slide is worth a different number of points.
- 40
- 20
- 15
- 10
- 5
- 4
- 3
- 2
- 1
All of these points added together give a total possible score of 100.
On each of these question slides I set the correct value as true and add the following triggers to the slide:
(This shows the triggers for the question slide worth 40 points - the other slides would need the number 40 changing to the slide values and the TotalIncorrectClicks variable swapped with the variable you want to track.)
Each of these slides will automatically advance after a fraction of a second. I also add a rectangle on top of the question slide with text saying loading... so users don't see the slide content underneath.
My results slide contains scoring for all nine question slides and has a trigger to submit the results when the timeline starts.
I also set the passing score for my quiz as 0% but this might be different for your use case.
After uploading the package to the LMS the value of the variable for each user will be shown as the score.
You can then create reports in your LMS to show the average score for each activity.
- AlexMilyaev-f86Community Member
You need to sum all variables into one in Storyline.
This can be done using regular triggers. For example, you have variables score1, score2, and score3. You create a variable called score. You create a trigger to assign the value of score1 to the score variable when the slide time starts. Then, you create a second trigger to add score2 to the score variable. And a third trigger to add the value of score3 to the score variable.
Then, on the slide where you want to send the final result to the LMS, you need to insert the code in the trigger when the slide starts.
When the slide time starts, execute JavaScript.
And insert this code into JavaScript:
var player = GetPlayer();
function findLMSAPI(win) {
if (win.hasOwnProperty("GetStudentID")) return win;
else if (win.parent == win) return null;
else return findLMSAPI(win.parent);
}
var lmsAPI = findLMSAPI(this);
var score = player.GetVar("sum");
lmsAPI.SetScore(score,20,0);
lmsAPI.CommitData();
SetStatus("passed");
SCORM2004_Finish();