Skip to content

Instantly share code, notes, and snippets.

@beneater
Created May 25, 2012 21:46
Show Gist options
  • Save beneater/2790785 to your computer and use it in GitHub Desktop.
Save beneater/2790785 to your computer and use it in GitHub Desktop.
Add an exercise topic
$.ajax({
url: "/api/v1/topicversion/default/maplayout",
type: "GET",
success: function(maplayout) {
maplayout.topics["logical-reasoning"] = {}
maplayout.topics["logical-reasoning"].icon_url = "/images/power-mode/badges/default-40x40.png"
maplayout.topics["logical-reasoning"].id = "logical-reasoning"
maplayout.topics["logical-reasoning"].standalone_title = "Logical reasoning"
maplayout.topics["logical-reasoning"].x = -29
maplayout.topics["logical-reasoning"].y = 40
maplayout.polylines.push({
"path": [{
x: -29,
y: 40
},{
x: -29,
y: 40
}]
});
console.log(maplayout);
$.ajax({
url: "/api/v1/topicversion/edit/maplayout",
type: "PUT",
contentType: "application/json",
data: JSON.stringify(maplayout),
complete: function(a, result) {
console.log(result);
}
});
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment