Javascript Help Needed - Scoreoid with Storyline

Oct 04, 2014

Hi

I have been trying to find a way to have leaderboards included in a couple of learning games I've designed over the last year.   I have managed to get the Google Doc solution to work, but only when off our corporate network, so had to rule this out a while ago.

I have recently though, stumbles across Scoreoid, which is a gaming backend platform, that is free and is accessible whilst on my work network too, so this seems like it could solve all my frustrations.

However, I need some Javascript to send the SL variables" username" and "score" to Scoreoid.

I had some success yesterday, managing to get username into Scoreoid, but not score.  I have fiddled so much with the code trying to get it to work, I now can't remember which 'version' worked for name (shame on me).

From what I can gather, the script would be something like...

var player=GetPlayer();
var name=player.GetVar("Name");
var score=player.GetVar("Score");

$.post("https://www.scoreoid.com/api/createScore", {api_key:"ea7ffcf2c71d56d8eb4fe259e6e890a3975a3fbe",game_id:"cb4858631a",response:"xml"},
    function(data) {

"score":score, "username":name},

      alert("Data Loaded: " + data);
      console.log("Data Loaded: " + data);
    });

I have included the jquery library in source files and added <script src="jquery-1.11.1.min.js"></script> to head of output html.  But I am clearly missing something.  Has anyone had any success with integrating Storyline with Scoreoid?  Or does anyone fancy the challenge of getting it working?

Just to clarify, what I am trying to do above, is get the variables into Scoreoid.  I would then need to use a different code to request the top 20 scores from Scoreoid and then set the SL variables ready to be displayed on screen.

This would open up a lot of possibilities for all SL users, so really hoping someone has the time to help with this.

I will continue to beaver away in the meantime.

Any help would be much appreciated.

Thanks

1 Reply

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