Last active
December 24, 2015 14:24
-
-
Save pcote/0938d338b9412b251eea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route("/addscore", methods=["POST"]) | |
def add_score(): | |
json_data = request.get_json() | |
if "exercise_id" not in json_data or "score" not in json_data: | |
abort(400) | |
exercise_id = json_data.get("exercise_id") | |
score = json_data.get("score") | |
model.add_attempt(exercise_id, score) | |
return jsonify(dict(result="success")) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment