def post_submit(user, data): resp = post_request(SUBMISSIONS, data=data, headers=get_headers(user)) return resp.json()
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']
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()
def get_entity(user, entity_id, url_template): entity = get_request(url_template.format(entity_id), headers=get_headers(user)) return entity.json()
def get_courses(user, **kwargs): courses = get_request(STEPIK_API_URL + "/courses/", params=kwargs, headers=get_headers(user)) return courses.json()