Skip to content
Ahmed Castro edited this page Mar 9, 2016 · 22 revisions

save_progress

A post method that stores a JSON data for each course section for each user. This data can be retrieved later using the get_progress method.

Parameters

  • Json user data to be stored

Returns

  • Error array if any

Example

  $.post("/javascript_api/save_progress",{progress{"player1_wins":game.player1_wins,"player2_wins":game.player2_wins},
    function(data)
    {
      console.log(data["error"])
    })

get_progress

A get method that retrieves the data previously stored by the save_progress function. The data is stored in the JSON format.

###Parameters

None

###Returns

  • Json progress previously stored

  • Error array if any

Example

    $.get("/javascript_api/get_progress",
      function(data)
      {
        game.player1_wins=data["player1_wins"]
        game.player2_wins=data["player2_wins"]
      })

unblock_achievement

post method

###Parameters

  • Achievement id

###Returns

  • Error array if any

get_achievemnts

get method

###Parameters

  • user id

###Returns

  • Achievment list

  • Error array if any

###Example

Clone this wiki locally