Example #1
0
def next():
    try:
        unsolved = Drill.get(Drill.user == g.user, Drill.solved == False)
        unsolved.solved = True
        unsolved.save()
    except peewee.DoesNotExist, e:
        pass
Example #2
0
def next():
    try:
        unsolved = Drill.get(Drill.user == g.user, Drill.solved == False)
        unsolved.solved = True
        unsolved.save()
    except peewee.DoesNotExist, e:
        pass
Example #3
0
def solve(id):
    print request.form
    attempt = request.form.get("solution")
    drill = Drill.get(Drill.id == id)
    drill.solution = attempt
    drill.save()

    success = drill.compare()

    return json.dumps({"result": success})
Example #4
0
def solve(id):
    print request.form
    attempt = request.form.get("solution")
    drill = Drill.get(Drill.id == id)
    drill.solution = attempt
    drill.save()

    success = drill.compare()

    return json.dumps({"result": success})