I assume maybe possible with scripting. I am trying to use the "Survey question" trick to pass score (variable) to LMS, but it seems this only works with text variables. What I really need is how to modify the trick to pass a number variable to LMS.
Yes that was my starting point. But it only works with text variables. but I figured out how to add script to convert number variable to text variable, and then this works. It's so simple, a shame SL doesn't just build it into the product. 99% of my variables are numbers, not text.
This thread is a bit older so I'm not certain that folks are still subscribed. I'm not equipped to assist with Javascript, but you may want to share a bit more about what specifically you need to know in terms of next steps? You could also reach out to any users in this forum using the "contact me" button on their profile.
I'm trying to change 30 separate number variables to 30 separate text variables. Do I need to repeat the javascript above 30 times, or is there a more elegant solution?
If you can name the number variables as Num1, Num2, Num3, Num4, and Text1, Text2, Text3, etc (it doesn't matter what the name is as long as you distinguish them by a number increasing from 1-30).
Then you can use this:
var player=GetPlayer();
var number = 0;
var text = "";
for (var i = 1; i<=30; i++)
{
number = player.GetVar("Num"+i); text = number.toString(); player.SetVar("Text"+i, text);
I have a slide where I need the students to choose 5 options. Each option has 5 marks assigned to it. Since I need to award marks on each response hence I couldn't rely on Pick Many.
For this purpose, I created a numeric entry variable 'Score' and assigned a trigger(attached screenshot). This variable adds all the marks based on what option the student has chosen.
Now I need to reflect the accumulated marks from this custom variable in my LMS, hence I followed the instructions you have outlined by using the How Many survey slide. But the result is not awarded.
Hi Sumrah! I'm not sure if this is what you're going for, but check out this sample I created. I had created a "survey" type quiz slide which customized feedback based on what the total score was in the survey. I added Matthew's twist of using the How Many survey question type to enable the survey score to be reported to the LMS.
I'm attaching the file so you can see the setup. Hoping that helps!
It would be Extremely helpful if storyline converted number to string when checking what a var is equal to. example i have a custom question slide where the user fills in blanks like 4 or 5 per slide. Some have multiple answers that have to be tested for. the client would like the user to be able to say type in 4 or four or 4mm as the answer BUT storyline will not do this on its own. This also something a less knowledgeable storyline author would have issues figuring out why its not working.
There are multiple text input boxes on screen at once. example, textinput 1, with correct answers of 4, four, 4mm. textinput 2 with correct answers of 6, six, 6mm.
when doing the actions to to see if the imputed text is is one of those it will see 4, and 6 as not being = to the correct answers as storyline doesnt convert number to string. it works perfectly fine for questions that do not need to have just a number as a possible answer.
And yes I could just use javascript and do it fully myself but this should be something storyline does on its own. it also will confuse newer authors as to why its not working if they have a limited understanding of how programing actually works.
Thank you for returning with additional details! I'd be happy to share this with my team in the form of a feature request. I'll link this conversation so that I can return when I have an update to share.
17 Replies
I assume maybe possible with scripting. I am trying to use the "Survey question" trick to pass score (variable) to LMS, but it seems this only works with text variables. What I really need is how to modify the trick to pass a number variable to LMS.
Hi Bruce! Sounds like you've already seen this article then.
Hopefully someone in the community will be able to assist you.
Yes that was my starting point. But it only works with text variables. but I figured out how to add script to convert number variable to text variable, and then this works. It's so simple, a shame SL doesn't just build it into the product. 99% of my variables are numbers, not text.
Some javascript that should work
Number to Text
Text to Number
Thanks Jackson :)
Good Afternoon Everyone,
So to follow up, I am stuck after I implement the Javascript:
What would be the following steps?
Hi Ruben,
This thread is a bit older so I'm not certain that folks are still subscribed. I'm not equipped to assist with Javascript, but you may want to share a bit more about what specifically you need to know in terms of next steps? You could also reach out to any users in this forum using the "contact me" button on their profile.
Thanks Matthew :)
Hi All,
I'm trying to change 30 separate number variables to 30 separate text variables. Do I need to repeat the javascript above 30 times, or is there a more elegant solution?
Mark,
If you can name the number variables as Num1, Num2, Num3, Num4, and Text1, Text2, Text3, etc (it doesn't matter what the name is as long as you distinguish them by a number increasing from 1-30).
Then you can use this:
var player=GetPlayer();
var number = 0;
var text = "";
for (var i = 1; i<=30; i++)
{
number = player.GetVar("Num"+i);
text = number.toString();
player.SetVar("Text"+i, text);
}
Thanks, Zsolt! This is really helpful.
Hello Matthew
I have a slide where I need the students to choose 5 options. Each option has 5 marks assigned to it. Since I need to award marks on each response hence I couldn't rely on Pick Many.
For this purpose, I created a numeric entry variable 'Score' and assigned a trigger(attached screenshot). This variable adds all the marks based on what option the student has chosen.
Now I need to reflect the accumulated marks from this custom variable in my LMS, hence I followed the instructions you have outlined by using the How Many survey slide. But the result is not awarded.
Please help! What am I doing wrong?
Hi Sumrah! I'm not sure if this is what you're going for, but check out this sample I created. I had created a "survey" type quiz slide which customized feedback based on what the total score was in the survey. I added Matthew's twist of using the How Many survey question type to enable the survey score to be reported to the LMS.
I'm attaching the file so you can see the setup. Hoping that helps!
It would be Extremely helpful if storyline converted number to string when checking what a var is equal to. example i have a custom question slide where the user fills in blanks like 4 or 5 per slide. Some have multiple answers that have to be tested for. the client would like the user to be able to say type in 4 or four or 4mm as the answer BUT storyline will not do this on its own. This also something a less knowledgeable storyline author would have issues figuring out why its not working.
Hi Jason,
If you have multiple answers, a fill-in-the-blank may work better for you:
By design, each slide can have one fill-in-the-blank question, but many in the community have created slides with multiple:
There are multiple text input boxes on screen at once. example, textinput 1, with correct answers of 4, four, 4mm. textinput 2 with correct answers of 6, six, 6mm.
when doing the actions to to see if the imputed text is is one of those it will see 4, and 6 as not being = to the correct answers as storyline doesnt convert number to string. it works perfectly fine for questions that do not need to have just a number as a possible answer.
And yes I could just use javascript and do it fully myself but this should be something storyline does on its own. it also will confuse newer authors as to why its not working if they have a limited understanding of how programing actually works.
Hello Jason!
Thank you for returning with additional details! I'd be happy to share this with my team in the form of a feature request. I'll link this conversation so that I can return when I have an update to share.
You can always share ideas by submitting a feature request!
This post was removed by the author