src/google-classroom-extractor/edfi_google_classroom_extractor/api/submissions.py
def request_all_submissions_as_df(
    resource: Optional[Resource],
    course_ids: List[str],
    sync_db: sqlalchemy.engine.base.Engine,
) -> DataFrame:
    """
    Fetch StudentSubmissions API data for the given coursework
        and return a StudentSubmissions API DataFrame

    Parameters
    ----------
    resource: Optional[Resource]
        a Google Classroom SDK Resource
    course_ids: List[str]
        a list of course ids to retrieve coursework for

    Returns
    -------
    DataFrame
        a Coursework API DataFrame with the fetched data

    Notes
    -----
    DataFrame columns are:
        courseId: Identifier of the course
        courseWorkId: Identifier for the course work this corresponds to
        id: Classroom-assigned Identifier for the student submission, unique
        per coursework
        userId: Identifier for the student that owns this submission
        creationTime: Creation time of this submission
        updateTime: Last update time of this submission
        state: Status of this submission
        late: Whether this submission is late
        draftGrade: Optional pending grade. If unset, no grade was set. Decimal
            values are allowed.
        assignedGrade: Optional grade. If unset, no grade was set. Decimal
            values are allowed.
        alternateLink: Absolute link to this course work in the Classroom web UI
        courseWorkType: Type of course work this submission is for
        associatedWithDeveloper: Whether this student submission is associated with the
            Developer Console project making the request
        submissionHistory: The history of the submission as JSON
        CreateDate: Date this record was created by the extractor
        LastModifiedDate: Date this record was last updated by the extractor
    """

    submissions_df: DataFrame = request_latest_submissions_as_df(
        resource, course_ids
    )

    submissions_df = _sync_without_cleanup(submissions_df, sync_db)
    cleanup_after_sync(SUBMISSIONS_RESOURCE_NAME, sync_db)

    return submissions_df

    Fetch StudentSubmissions API data for the given coursework
        and return a StudentSubmissions API DataFrame

    Parameters
    ----------
    resource: Optional[Resource]
        a Google Classroom SDK Resource
    course_ids: List[str]
        a list of course ids to retrieve coursework for

    Returns
    -------
    DataFrame
        a Coursework API DataFrame with the fetched data

    Notes
    -----
    DataFrame columns are:
        courseId: Identifier of the course
        courseWorkId: Identifier for the course work this corresponds to
        id: Classroom-assigned Identifier for the student submission, unique
        per coursework
        userId: Identifier for the student that owns this submission
        creationTime: Creation time of this submission
        updateTime: Last update time of this submission
        state: Status of this submission
        late: Whether this submission is late
        draftGrade: Optional pending grade. If unset, no grade was set. Decimal
            values are allowed.
        assignedGrade: Optional grade. If unset, no grade was set. Decimal
            values are allowed.
        alternateLink: Absolute link to this course work in the Classroom web UI
        courseWorkType: Type of course work this submission is for
        associatedWithDeveloper: Whether this student submission is associated with the
            Developer Console project making the request
        submissionHistory: The history of the submission as JSON
        CreateDate: Date this record was created by the extractor
        LastModifiedDate: Date this record was last updated by the extractor
    
Fetch StudentSubmissions API data for the given coursework
and return a StudentSubmissions API DataFrame

Parameters

Optional[Resource]
a Google Classroom SDK Resource
course_ids: List[str]
a list of course ids to retrieve coursework for

Returns

DataFrame
a Coursework API DataFrame with the fetched data

Notes


Fetch StudentSubmissions API data for the given coursework and return a StudentSubmissions API DataFrame Parameters Optional [ Resource ] a Google Classroom SDK Resource course_ids : List [ str ] a list of course ids to retrieve coursework for Returns DataFrame a Coursework API DataFrame with the fetched data Notes
def request_all_submissions_as_df(
    resource: Optional[Resource],
    course_ids: List[str],
    sync_db: sqlalchemy.engine.base.Engine,
) -> DataFrame:
    submissions_df: DataFrame = request_latest_submissions_as_df(
        resource, course_ids
    )
    submissions_df = _sync_without_cleanup(submissions_df, sync_db)
    cleanup_after_sync(SUBMISSIONS_RESOURCE_NAME, sync_db)
    return submissions_df
def request_all_submissions_as_df ( resource : Optional [ Resource ] , course_ids : List [ str ] , sync_db : sqlalchemy . engine . base . Engine , ) -> DataFrame : submissions_df : DataFrame = request_latest_submissions_as_df ( resource , course_ids ) submissions_df = _sync_without_cleanup ( submissions_df , sync_db ) cleanup_after_sync ( SUBMISSIONS_RESOURCE_NAME , sync_db ) return submissions_df
Fetch StudentSubmissions API data for the given coursework
and return a StudentSubmissions API DataFrame
Fetch StudentSubmissions API data for the given coursework and return a StudentSubmissions API DataFrame
"""
    Fetch StudentSubmissions API data for the given coursework
        and return a StudentSubmissions API DataFrame

    Parameters
    ----------
    resource: Optional[Resource]
        a Google Classroom SDK Resource
    course_ids: List[str]
        a list of course ids to retrieve coursework for

    Returns
    -------
    DataFrame
        a Coursework API DataFrame with the fetched data

    Notes
    -----
    DataFrame columns are:
        courseId: Identifier of the course
        courseWorkId: Identifier for the course work this corresponds to
        id: Classroom-assigned Identifier for the student submission, unique
        per coursework
        userId: Identifier for the student that owns this submission
        creationTime: Creation time of this submission
        updateTime: Last update time of this submission
        state: Status of this submission
        late: Whether this submission is late
        draftGrade: Optional pending grade. If unset, no grade was set. Decimal
            values are allowed.
        assignedGrade: Optional grade. If unset, no grade was set. Decimal
            values are allowed.
        alternateLink: Absolute link to this course work in the Classroom web UI
        courseWorkType: Type of course work this submission is for
        associatedWithDeveloper: Whether this student submission is associated with the
            Developer Console project making the request
        submissionHistory: The history of the submission as JSON
        CreateDate: Date this record was created by the extractor
        LastModifiedDate: Date this record was last updated by the extractor
    """
resource
Optional[Resource]
course_ids
List[str]
sync_db
sqlalchemy.engine.base.Engine