Using javascript for submitting test results
Jul 12, 2016
Hi,
For a customer we are building a test. In the test are two question-banks. One for attempt 1 and one for attempt 2.
We tried submitting the results of both tests with javascript. This is what we tried so far:
Saving the score of the test:
Action: Adjust Variable
Variable: MijnScore
Operator = Assignment
Value Variable - Results.ScorePercent
When Timeline starts
Object: resultslide (attempt1)
Action: Adjust Variable
Variable: MijnScore1
Operator = Assignment
Value Variable - Results.ScorePercent
When Timeline starts
Object: resultslide (attempt2)
Execute javascript (below the action-trigger) for both the resulslides:
var player = GetPlayer();
//Define new variable for score
var ScoreNaarLMS = player.GetVar("MijnScore and MijnScore1 for attempt 2");
//get LMS API
var lmsAPI = parent;
//set score; the first number is the score
lmsAPI.SetScore(ScoreNaarLMS, 100, 0);
Unfortunately this set up does not work. Tried it in Scormcloud. Only the value complete is there, but no score or passed/failed result is being registered.
Can anyone provide a suitable solution?
Thank you,
Best regards Sjors.
3 Replies
Hi Sjors!
JavaScript is not something I'm very savvy at and we do not offer support for this. Hopefully some of your fellow community members will be able to chime in and assist you here.
Hi Leslie,
Thank you for your quick respons!
Too bad that javascripting is not supported. It could make some work much more complete. However i am looking for a workable solition to have one result in the LMS bases on two questionsbanks(2 attempts).
Why the two banks? Well so i can control which questions are being asked.
Is there a way? Because storyline either calculates the results of two tests or has the option to pass both. I mis the option pass one test...!
Hi Sjors!
Not that you couldn't accomplish your goal with JavaScript - it's just not something I can support.
Perhaps this thread, or the links within, will be able to assist you.
This discussion is closed. You can start a new discussion or contact Articulate Support.