I am building a sample quiz for a client which has four branches. I've built it with one Result slide and am using a variable 'UserScore' to calculate only the result that affects their branch.
If I can get it to work properly I want my UserScore to be sent to the LMS not the ResultScore.Percent. Can this be done with JS?
I'm a JS noob so if you can give a detailed answer I'd be really grateful.
Thanks Matthew - I'm sure I'll have questions :-) have a good day - flooding and very wet here in Hervey Bay and I'm moving today to Brisbane - argghhh.
the removalist is running 7 hours late so I've had time to have a go at sending my custom variable score to LMS - SUCCESS thanks to the posts you linked me to...only thing that is not showing is the Passed / Failed.
Can you look at this code (which I duplicated from your post) and added a bit for the Complete status and see what I have done wrong.
var player = GetPlayer(); var passingScore = "80"; 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); lmsAPI.SetScore(player.GetVar("UserScore"), 100, 0); if (player.GetVar("UserScore")>= passingScore) { SetStatus("passed"); } else { SetStatus("failed"); }
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); lmsAPI.SetReachedEnd();
In your publish settings under Reporting and Tracking, what's your LMS Reporting set to. It may not make a difference in your LMS but it likely will in SCORM Cloud. The other thing you may find is, if your SL file is set to Completed/Incomplete and Storyline reaches the condition that would trigger completion such as a slide count, Storyline will overwrite your status. I tend to create a slide that cannot be reached. The new feature in SL360 gets around this by enabling a trigger to set completion.
We tend to use Completed / Incomplete or Passed / Incomplete. Failed has a special place in my heart but I wouldn't use it in an eLearning status:)
Hi Steve, thanks for the reply. I have it set to Passed/Incomplete and for this example I'm using SL2.
I'm not sure what you mean by a slide that cannot be reached (I understand the what not the why) - how will that affect pushing the information to the LMS?
I didn't create a custom passing score I was using Results.PassScore is that my issue
oops hang on I changed using the result slide yesterday when Matt suggested trying by number of slides...I do it again. Please hold
Nope that didn't work
I'm obviously making a rookie mistake.
In the JS I first used: the second line was setting PassingScore but in Russell's JS above I don't see that line
var player = GetPlayer(); var passingScore = "100"; 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); lmsAPI.SetScore(player.GetVar("Your_Score_Variable"), 100, 0); if (player.GetVar("Your_Score_Variable")>= passingScore) { SetStatus("passed"); } else { SetStatus("failed"); }
That is normal. When you set failed and incomplete, not supposed to get complete. When you set passed, you will get complete. Always on SCORM Cloud. Other LMS may display status differently. I think you're in a good place.
Just wanted to jump in and thank everyone who posted tips and advice here, you've provided the final piece in the jigsaw to help me complete a custom build I've been working on.
16 Replies
Thanks Matthew - I'm sure I'll have questions :-) have a good day - flooding and very wet here in Hervey Bay and I'm moving today to Brisbane - argghhh.
Hi Matt
the removalist is running 7 hours late so I've had time to have a go at sending my custom variable score to LMS - SUCCESS thanks to the posts you linked me to...only thing that is not showing is the Passed / Failed.
Can you look at this code (which I duplicated from your post) and added a bit for the Complete status and see what I have done wrong.
var player = GetPlayer();
var passingScore = "80";
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);
lmsAPI.SetScore(player.GetVar("UserScore"), 100, 0);
if (player.GetVar("UserScore")>= passingScore)
{
SetStatus("passed");
} else {
SetStatus("failed");
}
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);
lmsAPI.SetReachedEnd();
Hi, Wendy -
In your publish settings under Reporting and Tracking, what's your LMS Reporting set to. It may not make a difference in your LMS but it likely will in SCORM Cloud. The other thing you may find is, if your SL file is set to Completed/Incomplete and Storyline reaches the condition that would trigger completion such as a slide count, Storyline will overwrite your status. I tend to create a slide that cannot be reached. The new feature in SL360 gets around this by enabling a trigger to set completion.
We tend to use Completed / Incomplete or Passed / Incomplete. Failed has a special place in my heart but I wouldn't use it in an eLearning status:)
Hi Steve, thanks for the reply. I have it set to Passed/Incomplete and for this example I'm using SL2.
I'm not sure what you mean by a slide that cannot be reached (I understand the what not the why) - how will that affect pushing the information to the LMS?
Hi Matt
Ok so I've got currently got it set to the Result slide so I'll change that and try again. The completion is displaying its the pass/fail that isn't
Thank you!
Hi Matt
still gives me the same as above. Completion and a % score but no Passed/Failed in the Success category
Good morning Wendy,
I have this working in the SCORM cloud. Here is the code and a sample project for you to take a look at.
var player = GetPlayer();
var passingScore = player.GetVar("passingScore");
var UserScore = player.GetVar("UserScore");
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);
lmsAPI.SetScore(UserScore, 100, 0);
if (UserScore >= passingScore){
lmsAPI.SetPassed();
}else{
lmsAPI.SetFailed();
}
lmsAPI.SetReachedEnd();
Hey Russell
Thank you for replying :-)
I applied your JS to my file and something is not working (probably me) as it's early here in Australia.
Yes I get the Passed status but my passing score is 80 and I only scored 60. I don't see where in your JS you set the pass score to 80.
What is your Storyline variable passingScore set to?
Hi Steve
I didn't create a custom passing score I was using Results.PassScore is that my issue
oops hang on I changed using the result slide yesterday when Matt suggested trying by number of slides...I do it again. Please hold
Nope that didn't work
I'm obviously making a rookie mistake.
In the JS I first used: the second line was setting PassingScore but in Russell's JS above I don't see that line
var player = GetPlayer();
var passingScore = "100";
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);
lmsAPI.SetScore(player.GetVar("Your_Score_Variable"), 100, 0);
if (player.GetVar("Your_Score_Variable")>= passingScore)
{
SetStatus("passed");
} else {
SetStatus("failed");
}
Update:
Update
I made a change to the JS so now I am marked as failed when I fail- YAY but I've lost my completion status LOL
BUT
when I pass I get PASSED and COMPLETE
So close and yet so far.....
That is normal. When you set failed and incomplete, not supposed to get complete. When you set passed, you will get complete. Always on SCORM Cloud. Other LMS may display status differently. I think you're in a good place.
I think I love you Steve if that's it...have a nice weekend cos I surely will now.
Woo hoo - back to packing up my house to move :-)
Good luck:)
I second that nomination Matthew - that should do it :-)
Thank you both very much for your help.
Just wanted to jump in and thank everyone who posted tips and advice here, you've provided the final piece in the jigsaw to help me complete a custom build I've been working on.
This discussion is closed. You can start a new discussion or contact Articulate Support.