예제 #1
0
def get_base_data():
    response = {'loggedin': loggedin()}
    if loggedin():
        response['login'] = session['login']
        t_id = session['u_id']
        response['u_id'] = t_id
        response['solved'] = get_team_solved_tasks(t_id)
    return response
예제 #2
0
def check_flag(_id, u_id, flag):
    task = Task.query.filter_by(id=_id).first()
    solved = get_team_solved_tasks(u_id)
    if int(_id) in solved:
        return 'Вы уже решили этот таск'
    if task is None:
        return 'Нет такого таска'
    if task.flag == flag:
        solve_task(u_id, task)
        return "Правильно!"
    else:
        return "Неа :("
예제 #3
0
def check_flag(_id, u_id, flag):
    task = Task.query.filter_by(id=_id).first()
    solved = get_team_solved_tasks(u_id)
    if int(_id) in solved:
        return SubmitResult.ALREADY_SOLVED
    if task is None:
        return SubmitResult.NOT_FOUND
    if task.flag == flag:
        solve_task(u_id, task)
        return SubmitResult.OK
    else:
        return SubmitResult.WRONG_ANSWER
예제 #4
0
def check_flag(_id, u_id, flag):
    task = Task.query.filter_by(id=_id).first()
    solved = get_team_solved_tasks(u_id)
    if int(_id) in solved:
        return 'Вы уже решили этот таск'
    if task is None:
        return 'Нет такого таска'
    if task.flag == flag:
        solve_task(u_id, task)
        return "Правильно!"
    else:
        return "Неа :("