示例#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
示例#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
示例#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})
示例#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})