def courses_df() -> DataFrame: # arrange pook.activate() response_json = f""" {{ "courses": [ {{ "id": "{COURSE_ID}", "name": "{NAME}", "section": "{SECTION}", "descriptionHeading": "{DESCRIPTION_HEADING}", "room": "{ROOM}", "ownerId": "{OWNER_ID}", "creationTime": "{CREATION_TIME}", "updateTime": "{UPDATE_TIME}", "enrollmentCode": "{ENROLLMENT_CODE}", "courseState": "{COURSE_STATE}", "alternateLink": "{ALTERNATE_LINK}", "teacherGroupEmail": "{TEACHER_GROUP_EMAIL}", "courseGroupEmail": "{COURSE_GROUP_EMAIL}", "teacherFolder": {{ "id": "{TEACHER_FOLDER_ID}", "title": "{TEACHER_FOLDER_TITLE}", "alternateLink": "{TEACHER_FOLDER_ALTERNATE_LINK}" }}, "guardiansEnabled": "{GUARDIANS_ENABLED}", "calendarId": "{CALENDAR_ID}" }} ] }} """ resource = setup_fake_classroom_api("courses", response_json) # act return request_latest_courses_as_df(resource)
def teachers_df() -> DataFrame: # arrange pook.activate() response_json = f""" {{ "teachers": [ {{ "courseId": "{COURSE_ID}", "userId": "{USER_ID}", "profile": {{ "id": "{PROFILE_ID}", "name": {{ "givenName": "{GIVEN_NAME}", "familyName": "{FAMILY_NAME}", "fullName": "{FULL_NAME}" }}, "emailAddress": "{EMAIL_ADDRESS}" }} }} ] }} """ resource = setup_fake_classroom_api([(f"courses/{COURSE_ID}/teachers", response_json)]) # act return request_latest_teachers_as_df(resource, [COURSE_ID])
def submissions_df() -> DataFrame: # arrange pook.activate() response_json = f""" {{ "studentSubmissions": [ {{ "courseId": "{COURSE_ID}", "courseWorkId": "{COURSEWORK_ID}", "id": "{ID}", "userId": "{USER_ID}", "creationTime": "{CREATION_TIME}", "updateTime": "{UPDATE_TIME}", "state": "{STATE}", "late": "{LATE}", "draftGrade": "{DRAFT_GRADE}", "assignedGrade": "{ASSIGNED_GRADE}", "alternateLink": "{ALTERNATE_LINK}", "courseWorkType": "{COURSEWORK_TYPE}", "associatedWithDeveloper": "{ASSOCIATED_WITH_DEVELOPER}", "assignmentSubmission": {{ "attachments": [ {{ "driveFile": {{ "id": "a", "title": "b", "alternateLink": "c", "thumbnailUrl": "d" }} }} ] }}, "submissionHistory": [ {{ "stateHistory": {{ "state": "e", "stateTimestamp": "f", "actorUserId": "g" }} }} ] }} ] }} """ resource = setup_fake_classroom_api([ (f"courses/{COURSE_ID}/courseWork/-/studentSubmissions", response_json) ]) # act return request_latest_submissions_as_df(resource, [COURSE_ID])
def coursework_df() -> DataFrame: # arrange pook.activate() response_json = f""" {{ "courseWork": [ {{ "courseId": "{COURSE_ID}", "id": "{ID}", "title": "{TITLE}", "description": "{DESCRIPTION}", "materials": [ {{ "link": {{ "url": "{MATERIALS_LINK_URL}", "title": "{MATERIALS_LINK_TITLE}", "thumbnailUrl": "{MATERIALS_LINK_THUMBNAIL_URL}" }} }} ], "state": "{STATE}", "alternateLink": "{ALTERNATE_LINK}", "creationTime": "{CREATION_TIME}", "updateTime": "{UPDATE_TIME}", "dueDate": {{ "year": {DUEDATE_YEAR}, "month": {DUEDATE_MONTH}, "day": {DUEDATE_DAY} }}, "dueTime": {{ "hours": {DUETIME_HOURS}, "minutes": {DUETIME_MINUTES} }}, "maxPoints": {MAX_POINTS}, "workType": "{WORK_TYPE}", "submissionModificationMode": "{SUBMISSION_MODIFICATION_MODE}", "assigneeMode": "{ASSIGNEE_MODE}", "creatorUserId": "{CREATOR_USER_ID}", "scheduledTime": "{SCHEDULED_TIME}", "topicId": "{TOPIC_ID}" }} ] }} """ resource = setup_fake_classroom_api([ (f"courses/{COURSE_ID}/courseWork", response_json) ]) # act return request_latest_coursework_as_df(resource, [COURSE_ID])
def courses_df() -> DataFrame: # arrange pook.activate() aliases_response_json = """ { "aliases": [] } """ resource = setup_fake_classroom_api([ ("courses", COURSES_RESPONSE_JSON), (f"courses/{COURSE_ID}/aliases", aliases_response_json), ]) # act return request_latest_courses_as_df(resource)