Пример #1
0
def post_submit(user, data):
    resp = post_request(SUBMISSIONS, data=data, headers=get_headers(user))
    return resp.json()
Пример #2
0
def get_attempt_id(user, step_id):
    data = json.dumps({"attempt": {"step": str(step_id)}})
    attempt = post_request(ATTEMPTS, data=data, headers=get_headers(user))
    return attempt.json()['attempts'][0]['id']
Пример #3
0
def get_entities_with_ids(user, ids, page, url):
    url = url + "?" + prepare_ids(ids) + '&page=' + str(page)
    entities = get_request(url, headers=get_headers(user))
    return entities.json()
Пример #4
0
def get_entity(user, entity_id, url_template):
    entity = get_request(url_template.format(entity_id), headers=get_headers(user))
    return entity.json()
Пример #5
0
def get_courses(user, **kwargs):
    courses = get_request(STEPIK_API_URL + "/courses/", params=kwargs, headers=get_headers(user))
    return courses.json()