src/schoology-extractor/data_generation/assignments.py
def load_assignments(
    request_client: RequestClient, section_id: str, assignments: List[Dict]
) -> List[Dict]:
    """
    Load a list of assignments via the Schoology API.

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    section_id: str
        The Schoology id of the section that the assignments are associated with
    assignments: List[Dict]
        A list of JSON-like assignment objects in a form suitable for submission to the
        Schoology assignment creation endpoint.

    Returns
    -------
    List[Dict]
        A list of JSON-like assignment objects incorporating the response values from the
        Schoology API, e.g. resource ids and status from individual POSTing
    """
    assert (
        len(assignments) > 0 and len(assignments) < 51
    ), "Number of assignments must be between 1 and 50"

    logger.info("Creating %s assignments via Schoology API", len(assignments))

    post_responses: List[Dict] = []
    for assignment in assignments:
        response: Dict = request_client.post(
            f"sections/{section_id}/assignments", assignment
        )
        post_responses.append(response)

    logger.info("Successfully created %s assignments", len(post_responses))
    return post_responses

    Load a list of assignments via the Schoology API.

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    section_id: str
        The Schoology id of the section that the assignments are associated with
    assignments: List[Dict]
        A list of JSON-like assignment objects in a form suitable for submission to the
        Schoology assignment creation endpoint.

    Returns
    -------
    List[Dict]
        A list of JSON-like assignment objects incorporating the response values from the
        Schoology API, e.g. resource ids and status from individual POSTing
    
Load a list of assignments via the Schoology API.
Parameters

request_client : RequestClient
A RequestClient initialized for access to the Schoology API
section_id: str
The Schoology id of the section that the assignments are associated with
assignments: List[Dict]
A list of JSON-like assignment objects in a form suitable for submission to the
Schoology assignment creation endpoint.

Returns

List[Dict]
A list of JSON-like assignment objects incorporating the response values from the
Schoology API, e.g. resource ids and status from individual POSTing
Load a list of assignments via the Schoology API . Parameters request_client : RequestClient A RequestClient initialized for access to the Schoology API section_id : str The Schoology id of the section that the assignments are associated with assignments : List [ Dict ] A list of JSON - like assignment objects in a form suitable for submission to the Schoology assignment creation endpoint . Returns List [ Dict ] A list of JSON - like assignment objects incorporating the response values from the Schoology API e . g . resource ids and status from individual POSTing
def load_assignments(
    request_client: RequestClient, section_id: str, assignments: List[Dict]
) -> List[Dict]:
    assert (
        len(assignments) > 0 and len(assignments) < 51
    ), "Number of assignments must be between 1 and 50"
    logger.info("Creating %s assignments via Schoology API", len(assignments))
    post_responses: List[Dict] = []
    for assignment in assignments:
        response: Dict = request_client.post(
            f"sections/{section_id}/assignments", assignment
        )
        post_responses.append(response)
    logger.info("Successfully created %s assignments", len(post_responses))
    return post_responses
def load_assignments ( request_client : RequestClient , section_id : str , assignments : List [ Dict ] ) -> List [ Dict ] : assert ( len ( assignments ) > 0 and len ( assignments ) < 51 ) , "Number of assignments must be between 1 and 50" logger . info ( "Creating %s assignments via Schoology API" , len ( assignments ) ) post_responses : List [ Dict ] = [ ] for assignment in assignments : response : Dict = request_client . post ( f"sections/{section_id}/assignments" , assignment ) post_responses . append ( response ) logger . info ( "Successfully created %s assignments" , len ( post_responses ) ) return post_responses
Load a list of assignments via the Schoology API.
Load a list of assignments via the Schoology API .
"""
    Load a list of assignments via the Schoology API.

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    section_id: str
        The Schoology id of the section that the assignments are associated with
    assignments: List[Dict]
        A list of JSON-like assignment objects in a form suitable for submission to the
        Schoology assignment creation endpoint.

    Returns
    -------
    List[Dict]
        A list of JSON-like assignment objects incorporating the response values from the
        Schoology API, e.g. resource ids and status from individual POSTing
    """
request_client
RequestClient
section_id
str
assignments
List[Dict]